Sonoffs can work with Home Assistant without changing the Firmware!

277,390
65
Published 2020-02-12
www.pcbway.com/
www.drzzs.com
All the instructions are on this Github page: github.com/AlexxIT/SonoffLAN

Non-Flashers rejoice! There’s a custom component for Home Assistant that lets you use Sonoff Devices without changing the firmware, and best of all, it doesn’t use the cloud either :0

Let me give you 2 min of DIY smart home history. Way back in 2017 Sonoff made the cheapest smart switch (they still do). When other switches cost $30 the Sonoff Basic was only $5. The problem was, you could only use it with their app. Until geniuses like Theo Arends (He’s the TA in TASMOTA) started writing new firmware for Sonoffs that would allow these $5 switches to be used with a whole host of different smart home hubs, including Home Assistant. The process for flashing Sonoffs with new firmware has been easy for some people, and not so easy for others. Countless hours have been spent across the world fidgeting with jumper wires, grounding GPIO-0 and sorting out espcomm errors. That’s all over now! Okay, maybe that’s a little too dramatic, but it is fair to say that if you’ve been struggling to flash your Sonoffs, relief is here!

I gotta give the Sonoff folks some credit. They listened to their customers who wanted to have more control over their devices. In 2019 they included a local area network option for controlling their devices. They didn’t really communicate very well how it worked though so it wasn’t very accessible to most of us. There have been a couple components for Home Assistant that allowed you to use Sonoffs without changing the firmware. I’ve had mixed success with them, until now.

This guy AlexxIT, has made a beautifully simple custom component that sets up your Sonoffs to work in HA without using the cloud. I verified that once you have your non-flashed sonoffs setup this way, you can totally disconnect your house from the internet and they will still be controllable through HA. Are you excited now? Good, you should be! Let’s go through the setup.

The Hero of the Day is AlexxIT. This is his work, so give him a high five when you see him on the street. Or buy him a coffee on github.

Install Home Assistant Community Store
Quick demo on how to do that
Jenny’s video -    • Home Assistant Anniversaries + Instal...  
On the HACS settings page, under Custom Repositories, put AlexxIT/SonoffLAN and for Category select “integration”
Go to Integrations and search for SonoffLAN
Select it and Install it
Restart Home Assistant
Now we have to get the API_KEY for each of your sonoff devices.
Alex describes a way to do that without connecting to the eWeLink app
If you’ve already connected your sonoffs to the ewelink app that method might not work, at least it didn’t for me.
Setup your Sonoff Device with the eWeLink App
Put the email or phone number you used and your password in your secrets file
In your configuration.yaml:
There are other options
reload: When HA restarts it’ll connect to the itead servers and get info about your devices. It puts that info in a file called .sonoff.json
If you want it to retrieve info about new devices every time HA restarts you can make this “Always”, otherwise it’ll only do it once. If you add more devices, delete .sonoff.json, if that file isn’t there it will connect to the sonoff servers and download the information again.
Once that file is created you can delete your user and password if you want. The component doesn’t need to connect to the sonoff servers ever again as long as that .sonoff.json file is there.
Check the config, and restart HA
Go to States page and search for switch.sonoff-1+++
Customize it how you want, add it to the UI, make automations etc.

There are some more options and specific examples on Alexx’s github page.

That’s it! You’ve got control of your sonoff device in HA, without flashing and without the cloud!
My new little sonoff micro that I was all sad about not being able to flash, is now working with HA without ever connecting to the Sonoff servers. How great is that!?!

I expect I will still flash Tasmota on at least some of my Sonoff devices. I like to add other functions like Temperature & Motion Sensors. You can’t do that with the stock firmware. But if you’re not planning to add any other sensors to the device, you certainly don’t NEED to change the firmware anymore. Thanks Alex!

If you speak russian Alex also has a blog about smart home stuff: sprut.ai/client/blog/2308

IMPORTANT LINKS:
drZzs.com/
#DrZzs

www.drzzs.com/shop
drzzs.com/products/
www.amazon.com/shop/drzzs

Social Media:
Discord DrZzs - discord.me/drzzs
DrZzs Facebook Page: fb.me/DrZzs
Message: m.me/DrZzs
Group: www.facebook.com/groups/1969622823351838
Discord Home Assistant - discord.gg/c5DvZ4e
Twitter: twitter.com/Dr_Zzs
Instagram: www.instagram.com/drzzs/

All Comments (21)
  • @jordancobb509
    Just starting out in Home Assistant. Your videos have already become an invaluable resource.
  • @cecastil
    Great tutorial as always! I just tried it with the Sonoff S31 plugs and the custom component also provides voltage, current and power consumption reading... perfect for washer & dryer status automation.
  • Hello! I want to start by saying thank you for all that information you share with us through your videos. I really appreciate it! Keep up the good work!
  • @MidwayMaiTais
    I tried for hours to flash my R3 DIY to Tasmota with no luck and just lived with the R3 not included in Home Assistant. I came across this video today and this just worked. Thank you so much.
  • @sewashburn0529
    Thanks again DrZZs! I switched over to this integration after the other one ceased working after a HA upgrade.
  • @piterpaicon
    I have over 14 Sonoff basic with ewelink installed at home. I'm just starting with homeassistant. After 10 hours of trying and following yours and others videos I have all my sonoffs in homeassistant as well as ewelink! - HAPPY!!! - THANK YOU!
  • @ddacombe4752
    Many thanks for this. I just got my first sonoff device with v3 firmware, followed this video and setup was a snap. The installation has changed a little and become even easier.
  • WOW. you and Alex deserve so much credit. Alex for the work on the integration and you for bringing it to the public! I needed this so bad as I have the newer touch light switches that I didn't want to flash.
  • @ronensegal1177
    I have been looking for something like this for a very long time... Thank you very much! I can just say that for me, adding the country code had to be done in addition to the leading 0 of the phone number (unlike how you would actually dial the number). Great add-on and tutorials!
  • @Pinkywafer
    Great video as always doc! Thanks for including my video!
  • @somecallitfun
    Your instructions were great. Got it working in about an hour. Thanks so much.
  • @tommh44
    Wish I could give you two thumbs up. You gave me a BONUS with this video. I have a Xiaomi BLE sensor which I have been trying to figure out how to use. I noticed an integration for that while you were installing sonoff. Installed it too. AND it works!!!!!! Thanks for all you do for us.
  • @Sym0nd0
    This is awesome, I've just got my RF Bridge and had read horror stories about flashing them. Came to watch your vid on doing that and discover I don't need to anymore. 🕺🏼 Thanks Drzzz and Alex!
  • @andygrichting
    that's amazing... I was dreading for so long to re-flash these devices... that was sooo much easier. thanks a lot man
  • @bdubs6666
    This was awesome and very simple, thank you very much. I already had HACS installed so installing AlexxIT Sonoff custom component was easy. I bought 3 of these SR26 Sonoff smart switches a few months ago with the intentions of flashing the firmware to ESPHOME. But it involved soldering wires to very small and cheaply built PC boards. So naturally, I screwed up the first one. But that to DrZzs, I salvaged the other 2 smart switches and am controlling my Christmas light with them.
  • Wahhhh - thanks for explaining the drill, That was the main thing that was sacry, having to flash those sonof mini and the sonoff outlet, and Now they work with HA, Flawless ! Huge Kudos to Mr AlexxIT - being able to pull that is game changer
  • @jasebates7589
    thanks - I got this to work although the GUI is a little different now compared to the video. don't know how the heck I got it to work seemed to take a whole heap of keep trying but without this video, as a guide, I would never have done this in a million years! so thank you so much for your help :)
  • @vasiliserbin
    Thank you, Justin! I'm digging into the HA world. This video was quite informative.
  • @ajarvis92
    You are a legend! I was on the brink of returning my zigbee hub and you just saved it! Thanks for your awesome content!