SuperHouseTV #17: Home automation control with Sonoff, Arduino, OpenHAB, and MQTT



*
*

The Sonoff from Itead Studio is a fantastic little mains-switching module with a built-in ESP8266 and WiFi. If you want an easy way to control mains devices such as lamps and fans, this could be it!

Sonoff modules are preloaded with firmware that allows them to be controlled by a phone app, so they’re very easy to get started. But that’s just the beginning: using a USB-serial converter and the Arduino IDE, you can load your own software on the Sonoff and make it do your bidding. I used the Arduino IDE to load a sketch with MQTT support and OTA (over the air) updates, allowing it to be controlled by OpenHAB.

SuperHouse:
– www.superhouse.tv
– twitter.com/superhousetv
– www.facebook.com/superhousetv/
Jonathan Oxer:
– www.facebook.com/jonoxer/
– twitter.com/jonoxer

Please support me on Patreon: www.patreon.com/superhouse

43 Replies to “SuperHouseTV #17: Home automation control with Sonoff, Arduino, OpenHAB, and MQTT”

  1. Bill Filson

    Thanks for an excellent and complete tutorial very well presented. I have and application where I need to control a bank of separate switches. I have been looking at the Sonoff Smart Remote Control Wireless Switch Universal Module 4ch DC 5V 12V Y0T7. This has 4 relays. It has the same sockets to reprogram the board but will the the blynk software be able to handle the 4 relays?
    UPDATE: I found your "Video SuperHouse #30: Reflash ANY Sonoff, even if you don't know the pinout
    " it told me all I needed to know, so I don't need any help – Thanks again – Great work

  2. Carlos Andres Zapata Cuervo

    I just tried to install tasmota on one of those devices, but it seems to work only when connected through the serial pins, when connected to the wall plug it doesn't connect, I might need to install that firmware to try it out (I also use MQTT) I'll be looking forward to your next videos 🙂

  3. ron klo

    Can the TH10 support 2 waterproof thermal sensors in parallel and act upon the temperature changes on 1 of the sensors? I have a pool heater that I want to control with the TH10. I would like to control the temp remotely, and monitor the pool temp, as well as monitor the exhaust temp to tell me if and when the heat is on. Or can I use another input on the TH10 for that without adding the resistor and jumper. I bought a th10 and did the mode before testing it, and found it's not getting picked up on my wifi. I'd like to do this with the native ewelink app. Thanks.

  4. Michael

    Thank you! Just got a pair of esp32's and got my first ever OTA going. Though it only worked once, checking it your source code I was able to confirm my suspicious/stupidity… The initial OTA section of must also be in the OTA uploaded code.. doh

  5. Mathew Davis

    Don't forget to let your viewers know it's illegal for anyone without an electrical licence that they can't do anything you are showing. If they do they're 100% liable for all damages and or deaths caused by doing so

  6. Anton Martinez

    Hi Jonathan, I've recently bought a couple of sonoff basic, and I want to make them work with my lights without loosing the regular wall switch usage. Your videos about the subject are the best, and the way you explain things it's very simple and clear! So, thanks for that! I've a really quick question, I'm looking for an usb adapter for it, and I'm guessing if any adapter would work, given that I've seen a lot of options and I want to buy something that works (because I've to wait for a long shipping after I buy it). Thanks in advance!

  7. Fabio Cecamore

    Hi Jonathan, thanks for all your videos. I really like the idea of making domotic my house but I've a question. I would like to know if during the standby period of the device if it produces WiFi transmission (and if so, how much) considering that if there should be more than 50 devices installed in a house, the transmission could end up being unsafe for human exposure. Cheers

  8. EDITHA2004

    Nice video presentation. I just want to ask you, I'm a Filipino, our power line provided by our power company in most of the residential areas in Philippines are using 2 hot or live 110v and ground. Then of course all of our appliances or units available in Philippines are 220v rating. My questions are: 1. If I connect 1 hot wire to L and another hot wire to N which is supposed to be Neutral in your video presentation but due to Philippines 2 hot wires power designed (even the N-in is directly connected to N-out but the circuits of Sonoff is connected to N line), the Sonoff circuit won't damage? What will be the alternative connection to match in our 2 hot wires power line. 2. Are you really confident that the relay switch metal size can handle to switch on and off safely the appliances like electric fan or spot light etc.except low wattage lights (can be seen in other Sonoff youtube video presentation). I know that they marked the unit limited to maximum power load but looks the size of relay switch is unsafe to replace our existing light switch, the safest way but may not be economical is to use contactors. My point is, still hard to trust the Chinese made products.

  9. Mark Becker

    Is there any danger is using the Sonoff with aluminum wiring? Is the "Earth connection" the same as "ground wire" in the US? Does the Earth connection need to be encased, or not touch the Sonoff unit?

Leave a Reply

Your email address will not be published. Required fields are marked *