Gosund SW6 3-Way Switch
Model reference: SW6
Gosund SW6 3-Way

Available from:


Flashed with:

GPIO #Component
GPIO00 Button1
GPIO01 None
GPIO02 Led1i
GPIO03 None
GPIO04 Switch1
GPIO05 None
GPIO09 None
GPIO10 None
GPIO12 None
GPIO13 None
GPIO14 Relay2
GPIO15 Relay1
GPIO16 LedLinki
{"NAME":"Gosund SW6","GPIO":[17,0,56,0,9,0,0,0,0,0,22,21,158],"FLAG":0,"BASE":18}
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 | 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.

Device Configuration

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.

SwitchTopic 0

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

switchmode1 1

For more information about SwitchMode you can find it here: https://tasmota.github.io/docs/Buttons-and-Switches/#switchmode

Rules Configuration


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.

Switch Confiugration

Below is an example I used to get this configuration working in Home assistant.

  - 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"
Topic Description
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.