Putting a Sonoff in your wall switch box

No. the rocker and the sonoff button or the mqtt command all just toggle the lights. That’s the beauty of TASMOTA. It makes it so any input (rocker, sonoff board push button, or mqtt command) will toggle the lights. So if the lights are off, any one of those actions will turn them on. And the same goes when the lights are on.

I’ve got my Sonoff Dual sitting on my desk. For this week’s video I’m doing more about Holiday LEDs (since that’s a popular topic right now), but the week after I’ll either do the Sonoff Dual, or a Three-way switch with a sonoff or Sonoff flashing Over-the-Air. Which ever project I can get working first I’ll do next.
I think those will be the topics for the next 3 weeks. Just working on which order they’ll be done in.

Thanks for the support fellas!

2 Likes

Another feature of the sonoff with 3+ light switches is that when one of the other light switches is used, it turns the power off on the sonoff and when its turned back on, the sonoff starts on. This allows the other switches to control the light by turning them off and then back on.

RobDYI, can you explain this a little more? I think I follow but not 100%. I have a couple of lights that are currently not 3 way switches but I was hoping i would be able to turn them in to 3 way switches by using a Sonoff and code in HA.

Its a hall that has 2 lights at each end but they didnt not wire them together for a 3 way so one switch controls the light closest to it and same goes for the other. I would like to have them both turn on and be able to control it like a 3 way and not have to run the another wire.

As I postedl on the other thread you started you are after a creating a two way circuit not three but RobDYI is describing adding a Sonoff to an existing properly wired multi way circuit.

To avoid wiring it properly, you could use a Sonoff on each circuit and then set up automations in HA where one Sonoff being turned on would trigger the other and vice versa.

I think Bobby is right, it appears you have one light and one switch at one end of the hall and a totally separate light and switch at the other end. If the two light - switch combos are not connected, you will need two sonoffs to control both lights.

If the lights are connected, then it might be possible to get it to work with one sonoff.

image

Correct. Two completely separate switches which would take 2 sonoffs. I guess where my issue is how to get the sonoff to work correctly or HA to make it work.

I actually started another thread specifc to my situation here. 3 way switch with sonoff

Which specific bits are you unsure of?

There are many guides to flashing Tasmota onto a Sonoff and then setting it up to use the wall switch as a toggle, along the necessary MQTT set up in HA to use it. Then it’s a bog standard automation to get them to work together.

This maybe a stupid question but im just getting into playing with the Sonoff’s and I really like your setup of putting them in the wall.
Once all said and done, are they still controllable via google home voice command. I currently have 1 sonoff switch on one of my pendant lamps and 1 sonoff touch controlling my kitchen lights both controllable by voice command using my google home mini.

I don’t have google home (yet), so I can’t say for sure. If you have google home communicating with Home Assistant then my guess would be that it would still work.
It won’t work through the native Sonoff app if you put Tasmota on it.

Thank you for the info. Can’t wait to order a few more switches to play with.

1 Like

Made a video about flashing with Tasmota OTA. It’ll be out in the morning.

1 Like

Is it possible you can share wiring diagram? I am not electrician so it’s hard for me to understand. If you provide wiring diagram then it will help a lot. Thanks in advance. I have proper 3way switch ( one light being controlled by 2 switches) installed correctly and trying trying to add sonoff to be controlled from HA and physical switch.

I tried so many different way to make 3 way switches to work with one basic sonoff but it’s not working. I am excited for you to make this video so I can make this work.

Here you go…

Number of switches is irrelevant.

Thank you for quick reply. I try to make sense out of the diagram you provide but it seems like its too complicated for me.

I have only 2 physical switches (3 way switches) and I see that it doesn’t make any difference based on your post but let me ask you following 3 questions:

  1. Does it matter if my wire to light fixture is located at one switch and main power located at second switch? And I have traveler wires (red, black and ground ) running between those 2 switche. Neutral is also running in that bundle but it’s not connected to switches instead it’s connected to bundle of other neutral wires.

  2. Is there harm connecting wire with power to Gpio14?

  3. Based on below diagram how and where does sonoff connects?

From the looks of it, that odd way of wiring means it’s a non-starter for you as the you have some points you need to connect to in one switch box and some in the other.

You need the feed from the mains and the feed to the lamp in one place which would normally be at the light fitting or at one of the switch boxes.

You definitely can’t put mains power onto the low voltage side of the Sonoff, best case scenario would be an instantly dead Sonoff but it could be far worse.

Guess what I end up burning my sonoff basic so it no longer works. lol. but now this is what i came up with to control USA typical 3-way switch configuration. And i wanted to get your opinion before i order new sonoff switches and start playing with them. I think this should work if i can automate if sonoff one status change it automatically changes second sonoff status. And when server down the physical switch should just work normal.

Also, another question if I use dual sonoff instead of two sonoff would it do same trick or not?

Again thanks a lot for helping me out here buddy.

I was playing with following Idea but it didn’t go any where

Hi there, I just registered a few minutes ago and I have the same problem as patelrahul30297. I have 2 switches switching the same lamp(s) from two locations. It’s called “alternative switch” here in Hungary. Anyway, I think that the right wiring would be:

Left: original alternative circuit, hot source comes from the wall at the first switch, neutral and two switched to the second and to the lamp.
Right: both switches used to control SONOFF, source goes (from somewhere) to the lamp, interrupted by the SONOFF (sorry I had a relay symbol only).

The reason is that you’ll need all 3 wires to keep the “alternative” way of working and controlling the GPIO14 on the SONOFF board. The problem here is that you still need the supply for the lamps, so if you cannot feed the lamp(s) locally, you cannot solve the problem. Correct me if I am wrong please :slight_smile:

As far as I can tell your first diagram should work, do be very careful though and probably a good idea to leave some sort of note as to what you’ve done in the wall box in case an unprepared third party goes in there at any point in the future :astonished:

Hi Bobby, I know, I am the new guy here, but I do not agree. :slight_smile:
I mean it should work physically IF the server runs. The two module do the trick. As soon as they go offline, the physical switch cannot close the circuit as it goes thru the modules on both sides (or I missed something here?).

On the other hand, you need to configure the modules carefully, because you do not know which side closed at a given moment. If you want to switch from WIFI, you have to switch on the upper sonoff. The problem here is that you cannot switch off by the physical switch, only if the sonoff pins configured as a button, not a switch. My point here is that I do not know what will happen if a button-mode input gets continuous short.