Hello there,
I'm totally fond of the whole ESPHome idea & implementation.
Its integration into the Home Assistant ecosystem is brilliant and I love the way you can program a whole device's logic right into its ESPHome code without having to rely on Home Assistant for a lot of a device's smart functions implementations. All of this is really cool.
I've been using Tasmota before, it's really nice too. But I now have a tendancy to convert/start using new devices with ESPHome directly.
There's just one thing that just doesn't feel right to me and that ultimately prevents me from going "all ESPHome" : the state of switches on reboot / power loss.
This is actually something I've been bothered with for a long time and it's even become a decisive aspect of my choice between Tasmota and ESPHome : every time a device's switch absolutely needs to keep its previous state on reboot I always use Tasmota even though I know I'll miss a lot of the above capabilities I'm really happy with in ESPHome.
I read quite a lot about restore_mode, flash_write_interval and the abundant forum litterature they generated but I can't seem to find anything as satisfying as Tasmota's straightforward way of handling switches' states after reboots : they simply remain as they are. Simple as that.
My recent new experience was with 3 x Sonoff POWR320D. These devices, unlike the Sonoff Basic, have bistable relays so I initially thought that reboots wouldn't do much as these types of relays need to be explicitely set/reset to change state. But, guess what ? No.
On every reboot, my relay (exposed as a switch in Home Assistant/ESPHome) gets set to the OFF position on reboot, whatever the settings I tried in the code. With Tasmota, it doesn't. The reboot has absolutely no effect on the relay (neither has it on the built-in LED). They just remain the way they were bofore power-cycling...
The options I tried in ESPHome are :
- The described code/setup on ESPHome devices' page
- Adding different flavors of
restore_mode :combined with aflash_write_interval: 0s
Nothing seems to do the trick. It's as if on every reboot, at quite an early stage, before anything even gets displayed on the screen, the relay gets set to its off position.
I (really) tried a lot of stuff but this time, the devices really can't start on a different state than the one they were in before power outage / intended interruption. So I reluctantly reverted to Tasmota which perfectly does the job of restoring an identical device in such a situation.
Let's be clear : I like Tasmota. I'm not being judgmental or anyhting. It's just that I miss the configurability and programming/scripting abilities offerd by ESPHome.
If anyone has an idea on how I could reliably get reboot-proof switch states in ESPHome, I'm all ears ![]()