Tuya-Convert might not be possible for this device if the manufacturer started using newest Tuya firmware since this template was published (2020-07-21).
This assumes standard 3-way lighting with a child ‘dumb’ toggle switch connected to the travelers.
Component | Description ——— | ———– Relay1 | Adummy component that stores the power state of the switch. Relay2 | The actual hardware switch. Button1 | its exactly what you think it is. When pushing the button it automatically TOGGLES Power1 Switch1 | The secondary switch electrically controls the light, and its state changes on Switch1.
There are a couple things we need to do to get this switch to work correctly.
This is normally set to 0 by default. This is the desired value. I recommend runnning anyways to make sure it is set.
For more information about SwitchTopic you can find it here: https://tasmota.github.io/docs/Buttons-and-Switches/#switchtopic
Setting this to 1 allows for the switch to be a toggle and not just 1 or a 0
For more information about SwitchMode you can find it here: https://tasmota.github.io/docs/Buttons-and-Switches/#switchmode
Updates the state of the dummy relay when switch1 changes state.
Rule1 ON Switch1#state do Power1 2 endon; Rule1 1
Toggles Power2 when the button is pressed.
Rule2 ON Button1#state do Power2 2 endon Rule2 1
If the device is sent an EVENT it will Toggle Power2.
Rule3 ON event#OFF do power2 2 endon ON event#ON do power2 2 endon; Rule2 1
For more information about Rules you can find it here: https://tasmota.github.io/docs/Rules/
Home Assistant Configuration
SetOption19 should not be used in this setup!
SetOption19 will expose both relays and will become very confusing to what the switch state is.
Below is an example I used to get this configuration working in Home assistant.
switch: - platform: mqtt name: "Exterior Lights" state_topic: "stat/tasmota_XXXXX/POWER1" command_topic: "cmnd/tasmota_XXXXX/EVENT" availability_topic: "tele/tasmota_XXXXX/LWT" qos: 0 payload_on: "ON" payload_off: "OFF" payload_available: "Online" payload_not_available: "Offline"
|state_topic||is based on the dummy relay on the smart switch. This is what tells Home Assistant if the light is on or off.|
|command_topic||This is what Home assistent will use to trigger Rule3 on the device via MQTT.|