This assumes standard 3-way lighting with a child ‘dumb’ toggle switch connected to the travelers.
Component | Description.
——— | ———–
Relay1 | A dummy component that stores the power state of the switch.
Relay2 | The actual hardware switch.
Button1 | It’s 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.
Backlog Rule1 ON Switch1#state do Power1 2 endon; Rule1 1
Toggles Power2 when the button is pressed.
Backlog Rule2 ON Button1#state do Power2 2 endon; Rule2 1
If the device is sent an EVENT it will Toggle Power2.
Backlog Rule3 ON event#OFF do power2 2 endon ON event#ON do power2 2 endon; Rule3 1
For explicit on / off and toggle rule3
Backlog Rule3 ON event#OFF do power2 0 endon ON event#ON do power2 1 endon ON event#TOGGLE do power2 2 endon; Rule3 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.|