Sonoff, MQTT and Home-Assistant.

A few months ago Itead.cc, a Shenzen based manufacturer of open-source hardware, released the Sonoff wifi module. This is a dirt cheap ( $5 ) wifi connected switch that even comes with a nice enclosure. So cheap it is impossible not to buy.

By default they can be configured for use with the eWeLink app. As far as I can see this is a chinese cloud based smart appliance service, haven’t tested it but I assume it needs an active internet connection.

There are a few things that I dislike about that:

  1. Do I really want my data on a Chinese cloud platform? Not really.
  2. What happens if they decide to stop? Then its a paper weight.
  3. Does it work when my internet connection is down? Probably not.
  4. Only works with the Phone App.

The great thing about these Sonoff module is that they use the populair ESP8266 and have the UART / Programming pinsavailable on the PCB, just add some headers and you can flash them with your own software.

Other people already created alternative firmware for them so that saves a lot of time. KmanOz made the Sonoff-HomeAssistant firmware for these modules. They have everything I want, no OTA (it has to switch, nothing more, what would I want to update?), mqtt, and some info on setting it up with Home-Assistant.

Within an hour you can have it integrated in your HomeAssistant Setup.

After soldering some headers (5 minutes including warmup), searching for my FTDI cable (30 minutes), flashing ( 5 minutes), have it not working because of an old Mosquitto server in the Ubuntu Repo’s (15 minutes), updating it and adding it to home server (5 minutes).

Result:

Currently my Aquarium has the Sonoff module as switch, with a schedule to turn it on/off. And the light in our living room with the hard to reach switch is now automated.

I still have 2 Sonoff modules laying around…
What to automate next..