I’m facing a challenging issue with my Sonoff S20 smart plugs, which are operating on ESPHome. These devices were functioning flawlessly until a recent update to my Home Assistant setup.
Background: I decided to completely overhaul my Home Assistant system. In this process, I smoothly migrated my Z-Wave and ESPHome configurations. However, post-update, I’ve been encountering a major problem.
Issue: After updating the firmware on my ESPHome devices, I had to switch from using an API password to an API key. Since making this change, my Sonoff S20 plugs have begun restarting approximately every 4 hours. They default to their ‘off’ state after each restart, which is my preferred setting, but the frequency of these restarts is quite bothersome.
Here are the details of my current setup:
Home Assistant Info:
Core: 2024.1.3
Supervisor: 2023.12.1
Operating System: 11.4
Frontend: 20240104.0
ESPHome Info:
Version: 2023.12.6
Request for Assistance: I am unsure if the switch to an API key is related to this issue, but it’s a major change that coincides with these problems. Has anyone else experienced similar behavior with their smart plugs or ESPHome devices after an update? Any advice or potential solutions would be greatly appreciated.
Here is one of the plugs configs.
esphome:
name: sonoff-plug5
friendly_name: sonoff-plug5
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret api_key
ota:
password: !secret ota_pass
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
power_save_mode: none
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff S20 5 Button"
on_press:
- switch.toggle: relay
- platform: status
name: "Sonoff S20 5 Status"
switch:
- platform: gpio
name: "Sonoff S20 5 Relay"
pin: GPIO12
id: relay
output:
# Register the green LED as a dimmable output ....
- platform: esp8266_pwm
id: s20_green_led
pin:
number: GPIO13
inverted: True
light:
# ... and then make a light out of it.
- platform: monochromatic
name: "Sonoff S20 5 Green LED"
output: s20_green_led
sensor:
- platform: wifi_signal
name: "Sonoff S20 5 RSSI"
update_interval: 30s
I’m eager to find a solution that doesn’t involve rolling back the updates, as the rest of my smart home system is performing optimally with the new versions of Home Assistant and ESPHome.
Thank you very much in advance for your help and insights!
A log from a esphome node should tell us the restart reason. You can also use the debug component to get the last reset reason conveniently into HA.
Other thing worth trying upfront that only takes a minute would be to delete a troublesome esphome node (doesn’t delete any history or anything) and then just add it again to see if it improves …
Thanks I’ll get the debug component up and running and report back. Unfortunately I wish it was just one troublesome node. It’s all of the Sonoff S20 plugs, I’ve got 8 of them running ESPHome.
Tried commenting everything except the relay and debug from the config of the S20 plug and got the same exception restart. I have been able to find some posts about this being an memory leak type error, but have not found anyway to fix it yet.
Yes, sounds like some fundamental - not user serviceable error indeeed! I suggest open an issue over at the esphome github to properly get this investigated.
Yourself can still try to change the arduino framework version used - maybe you can ship around this error…
So the end solution was to dump ESP Home on these Sonoff S20 plugs and go with Tasmota. Everything has been running stable this week with no unplanned restarts. I am a fan of ESP Home and may try switching them back in the future. I’ll post if I find anything on this issue.