Putting a Sonoff in your wall switch box

I love the details n explaination. I know the Tasmoto flashing was done to get it into home assistant. What I’m curios is can the same wiring be done and can it still be using the original sonoff firmware n the ewelink app???

I might work on a separate api that connects ewelink app to home assistant which might help more ppl.

Is the above possible with inbox firmware ?

You don’t have that sort of control over the GPIO in the official firmware, so no external toggle switches etc, other than if you connect one across the terminals of the built-in button. That could only be a momentary button but also entirely possible for someone to put the Sonoff programming mode by mistake and mess it up.

Even if someone wrote a component to use the official firmware I believe you still wouldn’t be able to use a flashed Sonoff’s best features.

1 Like

There is and someone has pointed out how to set it. It’s buried in the video comments somewhere, I’ll see if I can find it.

Can you elaborate? What about if the switch that feeds power isn’t the one you want to use - like on the other end of the room or house - what do you do with the switch that you do want to use?

Not sure what you mean.

Never mind. I don’t think I fully understood how you described what you did. Thanks.

1 Like

Any luck with this?

Luck with what, it all works as it should?

Thanks for this DrZzs. I do have 1 question. I am not an electrician but I am not afraid to work on something like this either. I have been taking things apart since I was a kid :)… Sometimes they go back together… lol.

My question is. All my standard breakers are 20 amp breakers in my house. Will putting a 10amp sonoff switch for general lights be any type of risk? Fire or other? If something on the line overloads and blow the breaker will it fry the Sonoff?

Thanks.

I think if you put more than 10 amp at 120v through the sonoff, the metal connecting wire on the back of the circuit board will melt and break the circuit. There is a risk that this metal is near something like paper or cloth that it will start a fire that is why the sonoff is in a plastic container. Also, if you put the sonoff in a proper switch box, it shouldn’t have anything in there that will start a fire. You cannot put more than 10amp through the sonoff so it would never trip your 20 amp breakers, it will just burn your sonoff first.

Thanks RobDYI, sorry for asking more questions. I know that the Sonoff wont trip the breaker.
What I am afraid is if I have a circuit with say 4 lights on it. Different switches. So I put in 4 sonoffs 1 for each switch. And lets say there is an outlet on this circuit. Or someone screws in one of those Lightbulb plugs into the light socket. and then plugs in a a 12 amp shopvac. Could this in theory fry all 4 sonoff devices since they are on the same line as the shop vac drawing 12 amps?

Does that make sense. or am I just being over cautious…

Thanks again.

No, it won’t. The current is not going to be equal on all parts of that circuit.
I totally plagiarized wikipedia just now:
“In a series circuit, the current through each of the components is the same, and the voltage across the circuit is the sum of the voltages across each component. In a parallel circuit, the voltage across each of the components is the same, and the total current is the sum of the currents through each component.”
What you’re describing with 4 sonoffs and an outlet on the same circuit breaker is a parallel circuit. It’s like branches on a tree. The weight (current) on each branch is only carried by that branch (each sonoff). The trunk of the tree is the circuit breaker, it carries the weight of all the branches, which for you is 20amps. So 12 amp shop vac plus 4 sonoff’s with 2amp loads each would add up to 20 and trip the breaker, but wouldn’t damage any of the branches.
Hope that helps.

I wrote this before I read your last question:

I’ve started putting 10amp fuses on the input line of my sonoffs. So now IF it ever overloaded it will pop the fuse before anything in the sonoff catches fire.
I took apart an expensive smart switch and that was one of the few differences I found from the sonoff.
There’s a video on YouTube that shows what will happen if you overload a sonoff basic. I’d share it if I had the link handy but I don’t right now. Essentially rob is right. The solder lines heat up and melt through the plastic box. The whole thing gets super super hot. BUT it was something like 20 amps before that started happening. So if it did get overloaded to that level your breaker might actually trip before anything really burns up.
If you use the fuse non of that will happen anyway.
The Zzonoff video has the details on using the fuse and the tear down of the UL approved light switch. https://youtu.be/B38e1HAMUXs

Awesome, Thanks for that reply. It makes sense. To be safe Ill add the fuse.I know what is in the walls but others don’t so for me its better to be safe then sorry.

It sounds like I have a fun project in front of me to change all my light switches :).

I did see the video on youtube where the guy overloaded it. That actually made me feel better because he was really overloading it and it took a while for it to burn out.

Thanks again both DrZzs and RobDYI.

sorry if I missed this somewhere along all the video and replies, but I live in an old house where the light switches does NOT have neutral wiring (3 wires). Will this hack work for the basic 2 wire switches…one black and one white?
Again, apologies if I missed it somewhere on this thread.
Thanks.

the short answer is Yes, but you’d have to do it differently.
Hard to say exactly what you’ll have to do without really seeing the way things are wired in your situation. Most likely you’ll have to put the Sonoff with the light in the ceiling instead of in the switch box. Then connect the wires that go to the switch box to GPIO 14 and ground.
There’s a little more to it than that. You’ll have to do some tinkering to get it working, but it is certainly possible.
Hope that helps. Come back if you try it and get stuck.
Good Luck!

Man for someone who’s not to keen on messing around with electricity, not sure how much I want to venture off into that. Thanks…let me see if I can gather up the B@lls to try it :slight_smile:

that’s understandable.
I feel pretty confident with having a sonoff in the switch box. I’ve been criticized for doing so by folks who don’t think it’s safe. Putting a sonoff in the ceiling, where you don’t have easy access to it, and where someone besides you is unlikely to ever find it seems… unwise. But I know people have done it without a problem, so it is certainly possible.

We should devise a system for rating project based on the amount of b@lls required to pull it off.

Anyone living with US wiring should automatically be awarded the maximum number. Can only assume that’s why you’re only trusted with half the voltage. Mind you, it’s great for those that like to tinker, you’d have to go really wrong to make it any worse :slight_smile:

Only place I’ve been that seems to care less about safety is Cuba, they have bare live wires hanging out of the walls but at least they have an excuse and it seems kind of quaint over there.

Hi looks like a great article unfortunately not usable in the UK from what I understand we have radial circuits for the lighting so its power is fed to the Rose not the switch I did have one potential work around for this but wanted to run it by other with more knowledge.

Each light switch effectively requires two Sonoffs, although if the lights are closely situation u might want them to turn on and off together or use the double output version of the Sonoff but here goes my idea to get away with the lack of input power on the switch in the uk.

As in your first image where you say it can’t be done but find another switch that’s the norm here so wire the cables to the input and then loop to the output (effectively making this circuit always on regardless of the switch), then wire the switch to GPIO14 tweak the configuration to post a status to MQTT instead of trying to actually do anything to the output, then have a second Sonoff attached to the ceiling rose which is subscribed to that topic and toggles it’s power accordingly. The second Sonoff could be providing power to a single or multiple lights mileage would very depending on existing setup.

Obviously the feed to the Sonoff located at the switch will need to be fed before the other Sonoffs Output or it will break when it is turned off.
This is just something I have thought up so go easy, hopefully I haven’t missed any glaringly obvious reason this is not possible.

I think you can do it with just one sonoff and many different light switches. I am not from the UK so please get someone else to verify. I think if you put the sonoff in the rose and disconnect any switch from the rose and connect it to a gpio on the sonoff, it will work. You can connect several switches to different gpio’s or the same.

image