ESPHome Devices "Offline" but only for dashboard status

I recently swapped out my network equipment. I was using UniFi APs, switches, and a UDM-Pro. I am now using Eero Pro 6 and an unmanaged switch.

ESPHome now shows all of my nodes as “Offline”. If I use the visit button on each node from the dashboard, it opens the page correctly and I can interact with the node. I can click the logs button on the dashboard and it will connect and show me logs directly from the node. The node responds to ping and nslookup via hostname from my computer on the same network. The node can also be seen by and controlled from HA regardless of IP address (static or DHCP). It’s just the dashboard for ESPHome is saying the node is offline which is preventing me from doing OTA updates.

My setup is this:

  • ESPHome (2022.3.0) and HA (2022.3.5) in docker on a Synology NAS
  • ESPHome docker using ports (opened 6123 and 6052)
  • ESPHome docker with variable ESPHOME_DASHBOARD_USE_PING="true"
  • HA docker using --net=host
  • “Flat” network architecture, no VLANs, no guest wireless networks, everything in the same subnet
  • ESPHome nodes are a mix of ESP8266 and ESP32
  • ESPHome nodes have a DHCP reservation

Things I have tried:

  • All nodes have static IP addresses assigned through a DHCP reservation, but this also occurs when they just receive a random IP address. HA can still talk to them, but ESPHome dashboard shows it is offline
  • Reconfigured ESPHome docker container to use --net=host, but there was no change and nodes still show as offline
  • created a brand new node with a basic configuration. it connects to my WiFi and HA says it found a new device, but ESPHome dashboard still shows it is offline.
  • downgraded ESPHome docker to 2022.2.5 which is what I was running before I swapped my network equipment and the dashboard still shows the nodes as offline.

I’m starting to think Eero is doing something with mDNS/Avahi. Has anyone else encountered this before or have any ideas I can try out?

The error I get when attempting an OTA update is:

======================== [SUCCESS] Took 124.96 seconds ========================
INFO Successfully compiled program.
INFO Resolving IP address of office_cabinet_lights.local
ERROR Error resolving IP address of office_cabinet_lights.local. Is it connected to WiFi?
ERROR (If this error persists, please set a static IP address: https://esphome.io/components/wifi.html#manual-ips)
ERROR Error resolving IP address: Error resolving address with mDNS: Did not respond. Maybe the device is offline., [Errno -2] Name or service not known

If I go to the node “office_cabinet_lights.local” in a browser, it connects and I can interact with the node. I have also tried this with a node that has a one word name (I’ve seen the warnings about using underscores in a name) and the dashboard still cannot find the node or resolve the name, but otherwise the node is working.

This is the error when trying to connect to view logs from the ESPHome dashboard:

INFO Starting log output from office_cabinet_lights.local using esphome API
WARNING Can't connect to ESPHome API for office_cabinet_lights.local: Error resolving IP address: [Errno -2] Name or service not known
INFO Trying to reconnect to office_cabinet_lights.local in the background

My lan has a dhcp server and tied dns server (pihole, which uses dnsmasq). All devices get a name ending .lan

I specify my domain in esphome to “.lan” and all is well.

I’ve never had to specify the domain in ESPHome before. It defaults to “.local” anyway according to the docs. My whole network is “.local” and everything else responds via ping and nslookup to its hostname.local. Just the ESPHome Dashboard can’t for some reason?

EDIT: adding domain: .local to my ESPHome code changed nothing. Dashboard still shows as offline and clicking the logs button just says it could not resolve .local and pinging the same from a computer works.

so after some very in-depth research, eero does not run its own DNS. it forwards any lookup requests to upstream DNS servers, either the ones handed out by my ISP, or any that I set manually. But upstream external servers cannot resolve any “.local” address. This means I must run my own DNS locally to handle these lookups. Enter PiHole, but really any DNS server package like on my Synology.

Hi - could you provide the steps you took to resolve please? I have a similar set-up, running ESPHome on docker in unraid and not getting online status despite being reachable for logs etc. I am also running a pi-hole but don’t have much experience of DNS stuff or using .local addresses.

Thanks for updating your thread that you had it resolved but some more detail about the steps to fix would be massively appreciated.

Hi,

I had a similair issue. All my noded were reachable via name e.g. desklamp.home.lan. after i set the domain to .home.lan . Esphome kept showing the devices as offline. It didnt seem capable of resolving the devices. This is how ended up on this forum post. after some googling i found the esphome faq docker references. there is enviromental variable to be set.

ESPHOME_DASHBOARD_USE_PING=true

In my case as i was running esphome from within home assistant. After a bit of searching in the new settings menu i found the setting needed.

go to: settings → addons → EspHome → configuration
then click on Show unused optional configuration options
Enable status_use_ping .
restart the esphome addon and the device now show as online.

Hope this helps somebody else

4 Likes

Thank you sooooooo much. I have wasted hours trying to fix this issue!!! All of my “older” ESP devices (9) worked perfectly, just when attempting to add a new device did I encounter this “OFFLINE” issue. All is now working perfectly.

wow, what a can of worms I just opened. did an update to home assistant this morning - home assistant os 8 and core 2022.5.4. after update, esphome shows no errors in logs, but all devices offline, and lights and everything is not working. I tried this use the ping setting above and after restarting devices show online for a couple seconds and start falling off one at a time.

restored backup from yesterday, and lights are working again, but still showing offline in esphome dashboard. tried ping enabled, disabled, restart ha, nothing.

now I’m not sure how long this issue has been happening, because I haven’t visited my esphome dashboard in weeks or more?

weird thing is even after restoring from yesterday, my ha os is still showing 8. will try to see if I can restore a backup from a week or so ago, since I don’t think I have anything else to lose as far as work I have done on my setup.

one more detail that may be relevant is I run pfsense as my firewall router, and it totally forbids the use of .local, so my local network domain is casanet set at pfsense router.

also discovered, the visit button in the esphome dashboard doesn’t work any more either, but if I go look up the ip address of a bulb on my router, I can pull the bulb up and it is fine, so, my guess about all this so far is…

IT’S DNS! IT’S ALWAYS DNS!, LOL

edit: just checked the logs on my bulb and it says can’t connect to lohas1.local, so definitely dns. not sure how to fix this, why it’s broke, or why it ever worked before.

when looking at logs for a bulb…

INFO Reading configuration /config/esphome/lohas1.yaml...
INFO Starting log output from lohas1.local using esphome API
WARNING Can't connect to ESPHome API for lohas1.local: Error resolving IP address: [Errno -5] No address associated with hostname
INFO Trying to reconnect to lohas1.local in the background

docs say…

  • domain (Optional, string): Set the domain of the node hostname used for uploading. For example, if it’s set to .local, all uploads will be sent to <HOSTNAME>.local. Defaults to .local.

but not still not sure what to do to fix this.

@MSe-5-14

Blockquote
go to: settings → addons → EspHome → configuration
then click on Show unused optional configuration options
Enable status_use_ping .
restart the esphome addon and the device now show as online.

this worked for me on ESPHome

Home Assistant Core 2022.5.5
Home Assistant Supervisor 2022.05.2
Home Assistant OS 8.1
Kernel version 5.15.32-v8
ESPHome Current version: 2022.3.1

1 Like

Worked for me. I’m busy migrating to Truenas Scale and this was the answer for my ESPHome devices.

Thank you!

The status_use_ping sort of worked for me in a similar situation. I think under the hood there are some IP/hostname issues with ESPHome+HA; but what I did find worked for some devices that were online in ESPHome but not HA, was to delete the integration (nb: this tripped me up the first time too, when you ‘delete the integration’ you’re really just deleting the one device – search in your integrations for the affected device so under the ESPHome card you only see the offender, then click the ellipsis and choose ‘delete’) and then immediately re-add it using it’s hostname (i.e. devicename.local). Then they work fine, and generally they’ll be assigned the same entity_id so all your automations/dashboards/scripts etc will work fine.

HTH!

Edit: actually, simply disabling (via the same ellipsis) and re-enabling the device seems to work. At least in my situation, it seems like HA/ESPHome is confusing devices together (maybe they had the same IP at one point? I did do some major network rework recently and my devices all got new IPs). So far I’m transitioning my devices to FQDNs as I run a MS AD – so after adjusting my DHCP server to enforce DNS name registration, I seem to be having OK luck setting up devices using [devicename].ad.mydomain.com. Will report back any further info.

thanks a lot. This worked like a charm.