ESPHome devices lose their connection

Esphome is a nightmare when devices disconnect. I can not start HA than, happened many times and today I uninstalled esphome. Tasmota is way better and stable

OK, I did as you suggested and I now have about 80% fewer ā€œdevice unavailableā€ issues.
I have 2 since midnight, but itā€™s a whole lot better.
Iā€™ll disable band steering tonight tonight and see if that improves things further.

What a load of nonsense.

Agreed. ESPhone is a work of Art. These problems have zero to do with that software and everything to do with low level network chip hardware and drivers.

@SimonPth This was a really tough nut to solve. Took me 2 days of intense study, and the ā€œfixā€ was so simple. Now the devs need to figure out whatā€™s really going onā€¦

Jeff

2 Likes

Nonsense comment

I have a number of esphome devices that I have retired but not been bothered to remove them from home assistant integrations. So it identical to the esp device being disconnected while HA starts. Nevertheless it does not prevent HA from starting. That is why I say nonsense to your claim that HA will not start if an esphome device is disconnected.

I will ask though, are yours connected via api or via mqtt? I use api.

Api, it happened to many times, have posted logs many times, last time on discord two days ago. Till the esp is disconnected no Ha. Ha waited on reboot 1 hour for esp!



2020-05-24 19:14:36 INFO (MainThread) [homeassistant.components.esphome] Trying to reconnect in 60 seconds


2020-05-24 19:15:36 INFO (MainThread) [homeassistant.components.esphome] Can't connect to ESPHome API for 192.168.1.42: Error connecting to ('192.168.1.42', 6053): [Errno 111] Connect call failed ('192.168.1.42', 6053)


2020-05-24 19:15:36 INFO (MainThread) [homeassistant.components.esphome] Trying to reconnect in 60 seconds


2020-05-24 19:16:36 INFO (MainThread) [homeassistant.components.esphome] Can't connect to ESPHome API for 192.168.1.42: Error connecting to ('192.168.1.42', 6053): [Errno 111] Connect call failed ('192.168.1.42', 6053)


2020-05-24 19:16:36 INFO (MainThread) [homeassistant.components.esphome] Trying to reconnect in 60 seconds

I had to ask someone to compile .bin file with my data for another nodemcu to start Ha, horrible situation. Have deleted everything with esphome, because it happened to many times that Ha wont start. Now I am very happy with tasmota, much more stable, wifi is stable, ha can reboot, no baseline calibrations for sensors,ā€¦

I get those messages all through my log file. It doesnā€™t stop HA running though. IMHO there is something very wrong with your system, but it isnā€™t caused by home assistant.

1 Like

System work very well, stable, without any errors,ā€¦ this happens only with esphome.

Hi guys,

not sure if this applies to your enviroment but could be an helpful information.
I had issue with Esp disconnecting (8266/32 - flashed with tasmota or ESPhome) and finally found that issue was some devices/services in the network floading it is mDNS packets.

This was not and issue of ESPhome obviously or ESP itself but, as far as I understood, a combination of router mDNS packet handling and lack of CPU/memory power (compared to other devices) of other devices (like your smartphone).
In particular in my case I have a synology RT2600AC router while mDNS packes were generated by a Fingbox and also by ESPhome itself.

Removing Fingbox from my network and turning off ESPhome while not needed solved the issue.

That is interesting. I will try removing Fingbox, however, what I also noticed today is that restarting HA resolves the issue, albeit temporarily.

Are you running Esphome continuously or turning it on only when needed?

ESPHome is running continuously.

Turning off the Fingbox made no difference for me.

Iā€™ll stop ESPHome now. All was rock solid until this morning with my ESP32. I made no changes.

I stopped ESPHome and restarted HA. Still losing the API connection.

I should add that nothing has changed with the ESP32.

I run HA in a VM and had a clone from a few days ago so I started that up. Same problem. Issue is definitely with the ESP32 running ESPHome, in my view.

Why it would just change for no apparent reason is beyond my understanding. Restarts havenā€™t fixed it.

I have the same issue with some esp32: are you using BLE_Tracker component?
I saw the randomic behaviour you mentioned with it.

Also, quite interestingly, I have been in touch with Synology (makers of my router) support: they are stating ESP32, although losing connection to HA, are NOT losing connection to wifi networkā€¦which if true would be definelty point the problem to ESPHome.

I have no proof of that unluckily

I just restarted HA again and now Iā€™m back to stability! Go figure.

Iā€™m not running BLE tracker.

Iā€™m not losing connection to the network either. Itā€™s just the ESPHome-HA API pipe that breaks.

It was fine for about 30 minutes and then the issue returned.

Iā€™ve flashed another ESP32 with the same binary and, for now, it seems to be stable.

this happens to me too: flashing, ESP32 is fine, after few weeks starts to lose connection.

Removing power for 30-40s and connecting it back makes no difference: reflashing does

Are you saying reflashing the same device or flashing another device with the same binary?