Search this forum for the word ‘unavailable’ and also ‘disconnect’ and you’ll find that this is a pretty common problem not specific to ESP32’s, but to all ESPs whenever there is any kind of imperfection in the network link.
e.g. dropped packets or unusual latency. Try using ‘ping’ against your ESP for a while, and see how many packets are lost. There should be none, but if it’s nonzero, that may be the root cause of your problem, and it’s not necessarily unique to your LAN.
That is, if you can remove the latency and lost packets you would see a dramatic improvement WRT HA connection. I’m convinced that the ESPhome-HA link is too fragile to tolerate even minor net flaws, and needs to be made more tolerant.
So my cards are on the table. But maybe they’ll help you avoid a slew of unnecessary diagnosis work.
(yes, I have an axe to grind, because I’ve been observing this phenomenon for about a year now, but everyone blames power, or bad DHCP, or whatever else there might be. I have seen fragile session layers before, and this one rings all the same bells.)
2 Likes