SOLVED - Some ESPHome nodes show unavailable in Home Assistant, but show online in ESPHome GUI

Hi,

I’ve got a weird problem.

As per the title, some nodes are showing as Unavailable in Home Assistant. However, they remain Online from the ESPHome plugin gui. I can Show Logs on the affected nodes, and they’re clearly alive - the logs show live response from sensors and switches attached to these nodes.

Anybody had this problem before?

1 Like

OK I solved this. Leaving this post up in case anyone else has this problem.

I think this happens when you use DHCP, but don’t explicitly reserve IP addresses. If an ESPHome device is integrated into Home Assistant, and then its IP address changes, it will vanish from Home Assistant, but still be up and running.

The solution is to assign a static IP address to the Node, or reserve the automatically assigned address in your router/DHCP server.

6 Likes

I use an ISC BIND and ISC DHCP server with Dynamic DNS. If the node get’s a new IP address via DHCP, the new IP address is registered in DNS by the DHCP server and the node can be reached using the DNS name. As far as I know wifi:-> domain: is mandatory for this to work correct.

I will have to double check my ESPHome nodes but I’m pretty sure I have a few that use DHCP and do not have a static IP address set in the DHCP server (Unifi). I’ve never had issues with them showing up or staying connected to either HA or the ESPHome GUI. In fact I had a node that was disconnected for probably close to a month (longer than the DHCP lease time) and when I re-connected it, it showed up almost immediately. But I do not know if it got a new IP address or somehow got the old one again.
I do run both of these in docker containers but with host networking, so I don’t know if that’s a difference that would affect results.

I got same problem with esphomes when using dhcp and when dhcp gave new ip address home assistant lost connection to esphomes. I had to remove node and add node again to be visible in homeassistant. I changed wifi configuration on esphome to static ip. That should be good workaround but this is bug that appeared about early 2020 and worked in 2019 versions of home assistant.