ESPHome Connectivity Issues

I’ve got a couple Sonoff S31s I recently switched over to ESPHome. I am using the API instead of MQTT, however it randomly (and frequently) drops the API connection for about one second once or twice an hour. When the device loses the API connection, it powers off. This results in my S31 being power cycled a couple of times an hour.

[12:01:59][D][sensor.cse7766:147]: Got voltage=122.9V current=0.2A power=15.5W
[12:02:04][D][sensor.cse7766:147]: Got voltage=122.9V current=0.2A power=15.6W
[12:02:09][D][sensor.cse7766:147]: Got voltage=122.9V current=0.2A power=15.5W
WARNING Disconnected from API.
INFO Connecting to 192.168.10.217:6053 (192.168.10.217)
WARNING Couldn’t connect to API (Error connecting to 192.168.10.217: timed out). Trying to reconnect in 1 seconds
WARNING Disconnected from API.
INFO Connecting to 192.168.10.217:6053 (192.168.10.217)
INFO Successfully connected to 192.168.10.217
[12:02:27][D][sensor.cse7766:147]: Got voltage=159.0V current=0.3A power=20.1W
[12:02:32][D][sensor.cse7766:147]: Got voltage=122.9V current=0.2A power=15.6W
[12:02:37][D][sensor.cse7766:147]: Got voltage=125.4V current=0.2A power=15.9W
[12:02:42][D][sensor.cse7766:147]: Got voltage=123.4V current=0.2A power=15.6W

Has anyone else seen this behavior? If there is a way to keep the relay in its current state on reboot, that would also probably fix the problem.

I realized I was still on an old github repository, which wouldnt allow me to update to 1.12.2 (was on 1.10). Fixed that, updated ESPHome to 12.2, then reflashed one of my devices to see if that fixed the problem, but now cannot connect to the device with error 111… It shows up as connected on my wifi, but no connectivity to ESPHome.

Finally figured this out after alot of troubleshooting. Needed to add “baud_rate: 0” under “logger:”

Must have been a breaking change from 1.10 to 1.12. Small change…big problems!

logger:
baud_rate: 0

And either the updated firmware or the baud rate modifier seems to have solved the connectivity problems

The documentation still lists baud rate as optional:

baud_rate ( Optional , int)

And it is certainly not needed.

I assume it had something to do with the S31 switch and its use of the uart bus for the power consumption data.

1 Like