Proposal: sonoff integration without modifying the firmware

Hello World,

I’ve read some discussions on using sonoff devices in Home Assistant and I just came across this blog post today with a reverse engineering of the setup procedure and the network protocol for the sonoff devices. This brought me to an idea on how to use sonoff devices without modifying their firmware at all:

We could write a component for home assistant mimicking as the normal ITEAD server that the sonoff. So then the device can talk it’s usual protocol with Home Assistant and we would not have to modify it. This way you can connect Home Assistant to the sonoff device without going through the ITEAD servers.

With the setup procedure it’s a bit more difficult, as you need to connect to a certain wifi network and then send the right commands to the device. You probably cannot do this from home assistant and thus cannot fully automate the setup procedure within Home Assistant. So we would require some steps on the outside, like a separate script or a smartphone app.

Has anyone tried this yet?
Is anyone willing to work on this topic together with me?

8 Likes

How can I help

Easier just to flash them than go that route and also gain a the extra features at the same time.

Tasmota (and other custom firmwares) are so much better than stock I just can’t see why you’d want to, to be honest.

I balked a little at first at having to solder header pins - but it turns out that isn’t even necessary if you use SonOTA.

It’s not necessary to solder anything to flash the normal way either.

I Flashed 4 Sonoff S20’s en 2 Basic’s all with SonOTA trough WIFI, no cables and soldering required.
All successfully integrated within Home-Assistant through mqtt.

I agree with you guys, it does not make any sense to implement this. SonOTA is probably the way to go…

Please point me in the right direction to update the firmware over the air.

TIA
Geoff

It’s in the wiki.

Can flashing of sonoff 4ch pro be done without soldering?

Looks like you’d have to be incredibly dexterous but potentially possible…

Anyone flashed SOnoff 4ch pro without soldering? The link provided above requries soldering.

Not soldering is just doing the same thing but holding the connections on, sorry I tried to help!

No this is great…i misunderstood the instructions. Thanks a lot.

ITead has changed their factory firmware so OTA flashing no longer works if you have devices shipped with the newer Sonoff image. Therefore we’re back to physical modification of each Sonoff basic and the effort of flashing every switch.

So, for someone that wants basic capability w/o depending on the Sonoff cloud by implementing an HA hub, then I’d be very much in favor of having “factory” Sonoff device support directly in HA.

Some pogo pins would likely remove the need for solder.

Am I right thinking that when flashed that the ewelink software doesn’t work anymore? Therefore if for any reason there is an issue with Home Assistant you can’t control the switch?

At the moment I’m using IFTTT and a binary switch+automation to control the S22’s.

I’m going to flash them to Tasmota tomorrow but will need to consider where I use those if they are dependant on Home Assistant. One place is that I have the RPi for HA powered by one of these in case I need to remotely restart the Pi. I’ll switch that for an Xiaomi the has external control as well as HA integration. Then use the S22 on my coffeemaker… or another Pi…

There will be a LAN protocol soon: https://mobile.twitter.com/ITeadstudio/status/981346940775378944

2 Likes

Hi David,
do you remember the configuration you put in Configuration.yaml for binary switch and automation?
I only manage to do it with 2 scripts ( one to turn on and one to turn off ).

From my yaml file:

script:
scripy:
sequence:
# This is Home Assistant Script Syntax
- service: ifttt.trigger
data:
event: test

scripy1:
sequence:
# This is Home Assistant Script Syntax
- service: ifttt.trigger
data:
event: Test1

Thanks
Daniel

I put it all in a blog post here Hope that helps.

2 Likes