I have an OpenWRT router, DHCP leases are stored in RAM and won't persist a through a power outage. Once power is restored, everything - including ESPHome devices - starts afresh, and gets back to work.
Well, everything except HA. Though I can't find this behaviour documented, it seems HA (the ESPhome integration at least?) won't re-resolve the name when the old IP is active. This is a problem when everything reboots: inevitably some devices will get assigned previously used IP addresses. It seems HA simply pings the (stale) address and erroneously concludes the name resolution is still valid when it's not.
I appreciate there are a lot of broken networks out there and hence the oft-quoted advice is to just statically assign everything, but it'd be nice if HA at least cleared out the name resolution cache on boot; or better did some kind of device fingerprint to check for reallocated IP addresses. ("PRs welcome"?)
Is there some way "flush the name cache" manually? i.e. force HA to re-resolve all device names?
Aside: router reboots alone aren't a problem as the client address persists, and typically the DHCP client will request a renewal of their lease and the router/DHCP server obliges and records the lease. The issue is when the entire LAN - incl. the HA server - restarts at the same time.
A related (unresolved) thread: Why does HA depend on devices having static IP addresses?