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?
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.
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.
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…
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