Sonoff-HomeAssistant (Alternative firmware for Sonoff Switches for use with mqtt/HA)

@danichispa Do you mean the LED strips? I have already ordered them and am waiting on delivery. I also have ordered the POW unit which will report back Power in wattage.

1 Like

Yes, I was meaning the LED strips. Glad to see that you have ordered them, it means better firmware :wink:
I think I’ll order some of them later this week

@KmanOz rulez! :bulb:

Do you have any idea how to control exterior blinds? Maybe this?

@Jiran looks interesting, although currently firmware has only two states, clockwise turn, and anticlockwise turn… someone forgot to program a stop button! Im sure @KmanOz can soon fix that :smile:

@switched Yes, you are right. But isn´t there some mechanism in blinds motors which causes motor to stop if there is some higher pressure? Do you know some other cheap solution for blinds controlling?

Hello,

I’ve been trying to put this Sonoff units behind a wall switch, to make them both work (physical switch and “mqqt switch”. How did you achieved this? what was the wiring diagram you used (can you show me some image or something?!) ? did you used with ESPEasy? What was the configuration you gave? I am really struggling for several days to achieve this and if it can be done with one of this units I would fill my house with them. But first I would like to know how you wired it and configured it. And if you had problems with it? Can you support me? It would be highly appreciated.

I really really hope you can help me.

I was thinking about that as well.
Have a look at 2-way-switch-wiring or 2-gang-switch wiring.

But I am not sure how the sonoff would know about the toggle on the physical switch.
Maybe the new switches that can measure watt usage could find out.

Datamonkey

That’s a 2 way switch. You just need to parallel the Sonoff over the other switch and pretend the relay is just another switch. You need Active and Neutral going to the Sonoff only to power it, only Active is switched. Does that make sense?

Also the Sonoff DOES NOT know about the toggle. That means if you turn on the wall switch, it overrides the Sonoff and the status is not displayed on HA. To do what you’re suggesting requires a proper smart switch. This is a compromise for a fraction of the cost. Your house though will operate as normal, but also be Automated. Worst case scenario is a switch will stay on because someone has manually overridden it. Not ideal, but super cheap.

Also remember these switches can be used with anything that has a power cord, Cut the cord, insert a Sonoff inline and boom. I use them for lamps that are plugged into a normal wall socket as well.

Additionally I have a switch on HA that kills all automations. I sometimes use it when guests are here as I have auto lights around the house and they’re not use to it and most people will use wall switches irrespective. I throw that switch on HA and the house is basically normal.

HVPereira

LOL why would I use ESPeasy when this thread is a discussion on firmware that I wrote for the Sonoff?

The new switches can measure wattage, but it’s a mechanical switch on your wall, even if you knew it was on, someone still needs to go and turn it off. There’s no way other than an expensive proper smart switch for the ultimate setup. It comes at a cost of course.

:smiley:

Wouldn’t that mean that if the Sonoff is ON, the real switch is useless? It won’t be able to turn the light off.

But I agree, the 2 way switch is not working because the Sonoff does not have the 3 pins as in the schema above.

Are these devices UL Listed?

Correct. Like I said above if the wall switch is turned on, it overrides HA. Here’s how I use my switches. Because I have motion detection in each room, at sunset all rooms go into auto mode. I never touch a wall switch when I walk into a room. If I am in the room for a long period I either turn the wall switch on OR use my iPhone which has the Home app and turn the room on. I use Homebridge-HomeAssistant. It’s not ideal for sure, but again I automated my home for $300-$400 instead of 1000’s of $$$ because my home although new wasn’t setup for Home Automation and was wired normally.

No I don’t think they are. You take a chance. They are built well though and have plenty of clearances internally for isolation.

With sticking anything in the wall, that’s been my struggle for the last year – how to do it safely. I generally have faith in the build quality of these widely used components(*). Unfortunately, for me it was not a matter of safety so much as insurance. If a fire occurs in the home, even if it has nothing to do with the non-UL listed device, just having a non-UL listed device like that in the wall may nullify the warranty and it could be a half million dollar gamble, which I am not willing to take. Currently my plan is to put some switches in the wall plate, running the wires to the microcontroller which is not behind a wall, but in the closet.

(*) Even so, there were heat issues with adafruit’s huzzah. They said: “Revision history: as of May 15, 2016 we have changed the power supply to run from a 6V DC max rather than 12V. At 12V the power supply would overheat anyways!” Page here

Anyway, did not mean to ramble, but it’s good for people to know the tradeoffs with these devices and the implications for not only safety but for insurance in the event of a problem.

1 Like

I couldn’t agree with you more. I look at it like this though. If you install them correctly and don’t overload them you are going to be pretty safe. They’re built well, they use good quality components and the little tiny switchmode supply they use drops (240V in Australia) to 3.3V and draws negligible current. Plugged in with or without a load there is no heat emitted from them. There’s just not enough current being drawn at 3.3v for them to get hot. I’v seen far worse products that are UL or CE approved. As I said, you take a chance.

Actually I have an idea that might help you to have this sorted out and working as a actual wall switch, just look at the terminals you can add:

with this terminals you can connect to the wall switch ground and Vcc(3.3V) from the ESP8266 GPIO, and leave the MAINS only to Sonoff. I am not sure if this works but i guess it does can you comment on it? This way it would only be about internal logic on the sonnof and whenever you activate the switch it would be like you are pressing the button.

What do you guys think?

if that works … wow so simple :slight_smile:

i do not have any spare Sonoffs (on order) to try this, they are all currently connected up and working …
Do we know the GPIO ?

Note: Currently using Homie for MQTT/HA

Honestly I am not sure what is the GPIO for the button but for sure with some internet research you might find it easily. If you do it, could you gently share your findings as well some pictures on how you achieved it?

The GPIO for the button is 0. If you have a look at the firmware it’s defined in there :smiley:

Hi @KmanOz could you be please so kind and try to make FW for IM160601001 (itead motor switch) I can buy one for you if you want :wink: