Flashing the Sonoff SwitchMan with ESPHome!
Вставка
- Опубліковано 23 лип 2024
- Check out PCBWay: www.pcbway.com/
In this video we are taking a look at some new Smart Home Wall Switches from Sonoff - The Sonoff SwitchMan M5. These are available in a 1,2 or 3 button configuration and because of the ESP32 inside, they can be flashed with ESPHome or Tasmota. In this guide, I will show you exactly step by step how to flash them with ESPHome, for native and local control with Home Assistant.
If you'd like to support me and future projects:
Patreon:
/ everythingsmarthome
Sonoff SwitchMan M5:
bit.ly/3HTRig3
Parts List:
USB to Serial: amzn.to/3lsPfnJ
DuPont Wires: amzn.to/3acqhEV
ESPHome Configuration for Sonoff SwitchMan M5:
everythingsmarthome.co.uk/how...
Buy Me a Coffee:
www.buymeacoffee.com/EverySma...
Written Article:
everythingsmarthome.co.uk
EVERYWHERE YOU CAN FIND ME:
Everything Smart Home Community Discord:
discord.everythingsmarthome.c...
Twitter: / everysmarthome (@EverySmartHome)
Instagram: / everythingsmarthome
Facebook: / everythingsmarthomeoff...
#homeassistant #smarthome #esphome
________________________
Some of the links above are affiliate links, where I earn a small commission if you click on the link and purchase an item. You are not obligated to do so, but it does help fund these videos in hopes of bringing value to you!
0:00 - Intro
0:56 - Sonoff SwitchMan M5 Overview
1:43 - Things you will need
3:02 - Disassembly and Wiring
4:50 - ESPHome Firmware Install
8:14 - ESPHome Configuration of Relays
9:19 - Adding them to Home Assistant - Наука та технологія
this is cool. props to Sonoff for continuing to make their devices easy to flash (and open up without adhesives and stuff). local control FTW!!!
Agreed!
@@EverythingSmartHome Esp 32s are a nice bonus as well because they have bluetooth support
Thank you for the informative instructions. I have successfully flashed my Switchman US version, with the bluetooth tracker being able to get data from a Xiaomi BLE H&T sensor, too. One question about the indicator lights settings. With your yaml, the led id lights turn on when the relays are ON, and off when they are off. Is there anyway to turn on the led lghts when the relays are off, and turn off the leds when the relays are on? That would make more sense. Thanks.
thanks for the video! you're showing how to flash M5, but do you know how to wire R5 or TX series to USB to Serial adapter? thanks
Is there a option within ESPHome code to have/set the dimmer function of these to work via HomeAssistant?
Thanks for the tutorial.
In the video, you can see that when you click on the right button, the led light does not light up. I have the same problem. Please have you solved the problem with the right light coming on if the right relay is on?
Here is to hope that Sonoff will produce a variant that also fits in EU sockets (round variant)
Took ages before Aqara finally produced one, but this video convinced me to grab these Sonoff switches instead 🤣
Back to the waiting game I guess
can multiple of these switches be mounted when the junction boxes are directly above or next each other?
thank you for your clear and concise video.
did you try to add double click and long press functionality to the switch through the esphome yaml?
Is this possible?
Большое спасибо за то, что Вы делаете! Комментарий для поддержки канала😉
Very informative. Could you please recommend smart blind motor that work with sonoff.
Thanks!
Thanks for the tutorial.
I have a M5 1-C and I noticed that in your config in switch section instead of PIN 22 should be 23 in order to work.
Question:
How do I create a light entity instead of switch entity?
I wish I had seen your comment a couple of hours earlier, before I rewired the switch again and checked my config file against the original 😞
I really like these switches aesthetically, but I'll have to hold out to see if they do a US-style version. It'd also be great if they did a lighter coloured version for houses with white walls.
4:45 you can also use GND near the 5V pins
Hello. Are the sonoff M5 compatible with HA without flashing them i.e through the ewelink integration?
Thanks! I am just looking at the page with the switches. They have type 80 and type 86. What is that about? Thanks.
One is for use with the optional frame and one is a normal switch
i have 2gang swithcman and only left LED shows status when relay is on or off, where could be problem? P.S. LED light switch turns both LEDs on
A No Neutral version of the switches would be awesome also. I realise the display would need full power though.
Would be good to see!
I have the 3 gang version but it keeps disconnecting from eWelink. I don't have home assistant so running through Google home. Tried mac address binding with no luck. Any ideas?
Is there any way to do this with the 6 button switch. ?
is this applicable to the newer version of switchman m5?
Great video as always. Do you know if these available within the UK yet?
Thanks! They should be!
have you tried these with espresence detection?
Hi Lewis! It's a pleasure to find your channel. I enjoy every video here.
I was thinking about using Z-Wave antenna on some kind of SBC like RPi 4B (4GB+) with an SSD I have around to get OpenWRT installed as a base for running my own home router, I have individual APs that can be used so wireless power doesn't worry me.
I was thinking about installing HASS under Docker, I tried in VMs and so on and it works perfectly AFAIK.
Just the question for you as a professional... Do you recommend the HASS OS instead of containers? I want to have less devices running for my network/smart home appliances.
Currently running a VeraEdge (that it's making me crazy) and Z-Wave is used on all devices here, including thermostats and so on.
Hello, thanks! It depends on how comfortable you are working with containers really. I would ask why you want to go for containers over HA OS?
@@EverythingSmartHome I feel comfortable enough with containers, I use them every day so that's not a issue. But I want to have one device to rule them all. HAOS looks good but AFAIK cannot use as router.
OpenWRT is lightweight enough and has support for Docker.
I like the Supervisor + Addons on HAOS but I think I can live without them.
I already have Switchman R5 integrated in HA and they show up as sensors. Single press, double press and hold are working. But unfortunately I'm missing release function for hold. So I'm not able to dim during hold and set light during release. Is this something that could be solved by flashing them? I Have dug all over the internet to find a solution but can't see any ideas that is is suitable.
The Sonoff NSFPanel had a US and EU version. I see in the specifications these accept 100-240V. Do these work with US boxes?
I've no idea sorry - it doesn't look like it at the moment
It looks like the US version fits into a single gang US standard switch box. The only real difference is that in the US version, the display is in portrait mode, and the buttons are smaller.
I'm doing some remodeling, and am very tempted to get a UK box, so I can use the square landscape version.
Hey, thank you for the video - there are not so many instructions around it seems.
I spent many hours trying to tasmotize and ESPHome, bit neither worked out.
My four computers all don’t talk to the switch. ESPHome tells me: Failed to initialize, Try resetting your device…
How can I troubleshoot this process?
Any help or links would be appreciated
Maybe you have ones with locked bootloader as i had. Then there is no luck other than replacing ESP chip itself.
Thanks for the tutorial I have flashed ESPHome firmware onto my Switchman M5 single relay switch. I am getting this "WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures" above the config YAML and the relay is not turning the light on although the dashboard shows the switch change when I physically press the button, but the state icon doesn't change. Please can you help?
I've found the answer to my issue in the HA forum and then I noticed the comment from 'KNOCK' below. It's working now. 🙂
Just a 3 channel and 2 NS Panels to go.
I want to flash, but first want to make a backup of the original firmware. How would you do that?
I love the look of these, but wont be able to use them due to their requirement of a Neutral in the switch boxes which i don’t have in my house :(
That sucks :( Hopefully the Zigbee versions are no neutral!
I am still waiting for these switches to come back into stock! Can't find them anywhere atm
Soon hopefully!
I would love to see some examples of some mundane (booring tasks) executed via home assistant. For example having a qr code reader, or image recognition camera next to my fridge so i can scan "buy milk" to my grocy list when i feel its starting to get empty, Or maybe a verbal command via mycroft or something? add milk to the shopping list.
you could use NFC tags to do this.
It doesnt look like it s possible to have the ability to disconnect the relay from one of the switches? At least not the code shown. Or is there updated code that allows for this?
Now the big question with my remodelling in june!
Aqara zigbee switches (great zigbee mesh) vs. Switchman m5 (great bt mesh)
All will offcourse be used in combination with the NSPanel Pro and NSPanel (ESPHome).
I might be late for your remodelling but this is possible:
- comment out /remove the on_press part of the sensors
- add a name to each binary sensor
Have received 3 switches from itead store. Serial connection is not working. Can't flash any of them. Maybe someone know something about this? Maybe they added some block of flashing or smth else?
So you’re saying if I wanted to replace my home with these switches I’d need to perform this 1-handed balancing act just to get them to work seamlessly with home assistant ?
No, didn't say that. You can use the community Sonoff integration if you want.
Could you also use Sonoff LAN from HACS to control these?
Should be able to yeah!
Can any of these be used as dimmer switches (inc panel)? I recently purchased the dimmer (tasmota flashed) switches from Athom and to say I'm disapointed in them is an understatement as I am constantly having to power cycle them from the fuse box to get them to work for a short period of time.
Huh that's strange. Tried flashing ESPHome on them instead?
@@EverythingSmartHome would you know how I do that. I've tried using the usb serial cable and grounding out gpio0 but esp flasher errors with "Chip Auto Detection failed:" but guess that's with it not going into programming mode. I'm using a Mac btw.
Yes it's in this video 😅
@@EverythingSmartHome doh! 😖 of course it is
Hi, the yaml for 2 gang, which is one i decided to try out, is not 100% correct it is missing led on pin22
como seria a configuração correta pra ele?
How can I recover the original M5 firmware?
Hi guys. Maybe little update for you. I have ordered 10 of theese switches in white color directly from Itead webside and they already came with locked bootloader. So no possibility to flash them. When you hold up the GPIO0 to ground it sends following message : Download mode is disabled. Restart with GPIO0 high. I have tried to order grey ones locally and they had unlocked bootloader and flashed fine. Just little info for you. I will have to replace CPUs in theese with clean ones to be able to flash them.
Can you use these with smart bulbs? Hue, Lifx or Wyze?
Depends on your smart home platform but certainly possible!
Note - The M5 1 gang switch I recently got has relay on GPIO 23 instead of 22
I've just installed the Aquara zigbee switches which are very similar. Works great with Deconz.
Did you get the double rocker one working in home assistant?
@@dodgecrickets7862 yeah. It just appears like any other Zigbee device. You get an entity for each rocker.
@@puntoboy_gaming nah mate .. not mine .. my one dose not come up at all not even with the battery level ..
@@dodgecrickets7862 battery? The ones I have are mains powered. I have aquara buttons as well and they work fine too.
@@puntoboy_gaming ohh right ,. I have the zigbee that is battery powered .. maybe that’s why ..
What's the advantage of this over an identical looking ZigBee switch?
No advantage, just different use cases really! Not everyone has ZigBee
Do you know what the type (80/86) option is about?
Believe one is for use with the optional frame if you want to have a row of them side by side
@@EverythingSmartHome Ahh okay, thanks :) turns out they need a neutral which my house doesn't have in the switches :( so no use for me anyway. I'd love a comparison on some of the live only smart switches on the market!
Does anyone if these SONOFF products are certified or being sold in Australia? Quick Google says no :(
Wish downunder more smart home products, it was a push just to get shelly's certified.
Found the answer in a Facebook comment, no such plans to get it certified :( even though it supports up to 240v
That's a shame, have you looked at the Aqara ones?
As someone else has commented, I'm not quite sure what the advantage of flashing these with ESPHome is over using the native Sonoff integration. That's local anyway isn't it (I don't currently have any Sonoff devices), so just wondering about this?
Separate topic, but what is the make/model of your 3D printer? Looking to buy one and the Creality Ender 3 V2 seems to be daily highly rated. Yours looks similar from what I can see. Any plans on making a 3D printing video. It seems you need a 3D printer if you are going to start dabbling in making your own sensors.
A few reasons:
Way more customizable I can add a double or a triple press (or more) to these to control other automations or devices if I wanted to as well as some other advanced functions
Speed - ESPHome is far quicker to respond than the Sonoff app is (it may be a few hundred ms but that's a lot when switching on a light and is pretty noticeable at least to me)
The Sonoff integration is a community integration and not an official one. While the work done for it is amazing and it works really well, there is always the chance that something can change on the Sonoff side which causes it to stop working. With ESPHome it's an official integration, and I'm in control of any updates to the device itself.
One less app I need on my phone.
The printer is a Prusa MK3S, it's not cheap and a lot more than the Ender is but IMO it's worth it. I never have to do any tweaking or tinkering to it to get it to print, it just works all the time without fail. A lot of people I know with more budget printers spend a lot of time tweaking and tinkering with the settings to get them to print properly - I personally just want the printer to work. Unless of course you want to tinker with it then that's a completely different story. Hope that helps!
@@EverythingSmartHome Thanks for the super informative reply. Makes sense now regarding flashing to ESPHome.
Regarding the Prusa, I have also been looking at that and wondering if it was worth the extra money. I didn't recognise it as I thought they had loads of orange parts. 🙂 I am after a printer that works with very little fiddling. I want it as a tool, rather than something to tinker with (Home Assistant gives me enough to tinker with as it is 😄), so that's a good recommendation. Thanks.
@@EverythingSmartHome Just been looking and can't see an all black Prusa model anywhere, where did you get that? Is it a special/limited edition or something?
I see now that it's possible to order it in all black on their website. I hadn't noticed that option. 😄
Yep looks like you found it! And same for me, the printer is a tool!
Are those switches have Bluetooth so they can be used ESPpressense?
I believe they do!
ESPHome is superb and Sonoff providing ESP based devices is great as well. One point: majority of home installation is WITHOUT neutral line in which case... nothing like this works ;-(
Apparently WiFi switches without neutral aren't very safe. ZigBee without Neutral is safe however. No idea as to the validity but that's what we were told
@@EverythingSmartHome it is not about safety I think - neutral wire has nothing to do with safety of the switch - without neutral there is not much of power you can deliver via the capacitor (that usually is put in parallel to load) - when you have relays in the module it might be not enough power though. Anyway, rewiring the house... not easy solution, especially when you rent ;-)
It depends on the country you live in, where I am from all homes have a neutral wire
@@zyghom itead does sell the Sonoff T4EU1C - which works without neutral on a switch wire only (parasitic) , quite a clever design, but with several limitations however.
I would like to buy these switches without the back part without the relays and without the power supply. I am renovating an apartment from scratch with all new electric. I think it would be great to have only the actual switches with the ESP32 and the electronic on the wall. Then I plan to use Home Assistant to control mostly LED lights and other smart devices. Do you know if those switches or similar are available without the high voltage back part?
Not as far as I'm aware!
Sounds like KNX to me.
with how easy it is to flash them, why do they not have an option to just buy them flashed? It would also be super cool if they had a version of this with a motion sensor / temp sensor built in.
Motion sensor would be cool, temp sensor would be difficult to get right since the esp32 generates some heat
@@EverythingSmartHome As evidenced by the wildly inaccurate temp's shown by NSPanels!
Love these switches! I joined your discord but cannot send a message? There was no verify bot or anywhere to accept the rules? 👍🏻
That's strange, try leave and join again, it should pop up some prompts!
@@EverythingSmartHome tried that a few times. I get a pop up saying a few things to do (like introduce yourself) but when posting, I get an error saying
Your message could not be delivered. This is usually because you don't share a server with the recipient or the recipient is only accepting direct messages from friends. 🤷🏻♂️😂
MKBHD tshirt and LTT store banana. Choose your side man :P :D
😂😂
Still no sign of a zigbee version ? :(
Wink Relay!
You probably should get pogo pins, they'll make better contact that those, I've flashed a bunch os sonoff devices with them and it's a breeze.
I've got some actually, but find this much quicker tbh
@@EverythingSmartHome I've just stuck my pogo pins to the male part of the pins you used and pressed them against the pad, that way I've never had a connection issue. But to each his own 😉, you do whatever works for you,and that's what matters
ESPHome devices turn all switches on after a Power Outage, which I found to be a problem
This is a simple change in the config
I can't really see the point of flashing functional Sonoff switches with Tasmota, especially since advanced functions such as powermeter may then be lost. The switches can be seamlessly integrated into HA without flash and also offer the advantage of free cloud use, which is associated with monthly fees for HA.
A few reasons:
Way more customizable I can add a double or a triple press (or more) to these to control other automations or devices if I wanted to as well as some other advanced functions
Speed - ESPHome is far quicker to respond than the Sonoff app is (it may be a few hundred ms but that's a lot when switching on a light and is pretty noticeable at least to me)
The Sonoff integration is a community integration and not an official one. While the work done for it is amazing and it works really well, there is always the chance that something can change on the Sonoff side which causes it to stop working. With ESPHome it's an official integration, and I'm in control of any updates to the device itself.
One less app I need on my phone.
Those are the main ones for me!
It is not so much about having a (Sonoff) app. running on the UI, but about the fact that the Sonoff switches in HA can run without restrictions without flashing and also offer functions that are no longer accessible after flashing. In addition, the switches (without flash) can also be operated via the Internet, which is only possible after flashing with the HA Cloud. By the way, the multi tip programming is a HA feature that is not dependent on a flash.
Apart from the fact that changes and further developments of the firmware can no longer be used after a flash, which I rate more as a disadvantage than an advantage. Another advantage is that switches can be integrated into HA across networks (i.e. over long distances), which after flash is only possible via the $5/month HA Cloud.
In other words, apart from the ms delay in the state change, there are few to no advantages that speak in favor of flash.
None of those that you mentioned are correct. You do not need HA cloud to make these accessible to the internet, I don't use HA cloud and can access.mine anywhere in the world.
Please state the features you are referring to? You need to give examples like I did. Double press and triple press are not possible with stock firmware by using HA, since these need to happen locally on the device.
@@EverythingSmartHome
I understand that you can reach your HA from anywhere in the world. But my example was to reach the switches in widely distributed networks.
So if switches are extremely far apart and in different local networks, but they are still to be centrally combined in the HA-UI, you will not be able to avoid an Internet solution.
Multi-tap can be generated relatively easily within the HA UI and a wide variety of solutions can be displayed via the available software functions.
I still have the advantage of proprietary firmware. Quite the contrary. In addition to the relatively unreliable flash method, I actually only see disadvantages.
But anyway. Everyone has to find the solution that best suits their needs.
However, I always prefer the simplest and most reliable solution, especially if it brings me significant advantages.
Multi tap cannot be done in the HA UI, not the way I can do it in esphome. It just can't.
And that is a poor example with regards to a "wide" network. You wouldn't do that for many reasons.
You class proprietary firmware as an advantage? That surprises me, if you are into HA of course :)
Regarding your last remark. From what I came across, switches that work without neutral wire, are not usually routers, but end devices unfortunately :(
Oh really? Didn't know that! Wonder why that is?!
@@EverythingSmartHome if a device doesn't have a neutral it needs to let a bit of power go through the lamp even when off so using as little power as possible is important otherwise the lamp might glow a bit
Good to know, thanks!
I have WETEN no-neutral zigbee light switches from aliexpress, they are routers. They're also not that great, not very sensitive and all quirks of no neutral switches apply - some bulbs will flash and need to be replaced with dimmable versions to work correctly at all.
Banana for scale
Forgot to use it!! 😭
Is there a zigbee version? No........
Hi, don't forgot to hide you ssid password.
It's just a burner password in this so no need to hide
"soldering is not required"... if you happen to have 3 hands and willing to risk bricking the device if you lose connection mid-flash!
In my opinion, you should be recommending TO solder some header pins on to these connections to ensure a good electrical connection and not risk the alternative.
There is really no risk. You don't need 3 hands, I did many of them by myself...as far as I know I don't have 3 hands.
@@EverythingSmartHome Or you could be responsible and recommend the proper way to your viewers.
advertorial SKIP!