3-way switch and 2 sonoff basic = 4-way switch

Hey guys,

I have a 3-way switch that controls one light (i.e. 2 switches controlling one light) and I want to add another switch (i.e. sonoff basic) into the mix so I can control the connected light with the 2 rocker switches and the sonoff. (so make it a 4-way switch).

(I am in United States so 4-way switch = 3 switches controlling a device :slight_smile:)

I have been researching through the forums and I don’t see any easy way to do this with just 1 sonoff (I’ll need to add another wire into the outlet).

I was wondering if I could do this with 2 sonoffs. Here are my initial thoughts:

  1. Put one sonoff each in the rocker switchbox. On the input side, connect common and neutral on both.
  2. Remove rocker switch 1 and 2 from the AC circuit.
  3. Connect rocker switch 1 to sonoff 1. Leave the output of sonoff 1 disconnected.
  4. Connect rocker switch 2 to sonoff 2 and connect sonoff 2 output to the light

The above wiring seems straightforward to me. What I am not sure is how to configure the software.

I essentially have 2 sonoffs commanding one relay.
Sonoff 1:
It needs to send MQTT when GPIO 14 is toggled. This messages needs to be listened by sonoff 2. sonoff 1 relay should be disabled.

Sonoff 2:
Listen to MQTT from sonoff 1 and monitor state of its own gpio14. Both these inputs should be in “toggle mode” i.e. any change in the input from either source should toggle the relay.

I have been reading about switchModes/switchTopics here:

I am not very certain how I can achieve this. Any help will be much appreciated. (Please give examples of what the yaml would look like for this)

Here is my 3 way and 4 way setup… you just need to get a relay too. problem with this is wrong status of switch in home assistant. You can always separate those swithces from mains and use them to toggle sonoff.

Here is my example of the mqtt / yaml side of things.

You would have to add a 3rd entry to the light group and the - alias: Living Room Lights Off part

Can you wire another low voltage wire from the new 4 way location to the Sonoff handling the 3 way? Just two conductors.

I’m looking to solve the same problem. Did you land on something that works? Dave.