Device 'offline' but wireless logs work (OpenWrt)

I have a number of devices that I have connected to a separate OpenWrt router, on a different subnet.

The ESPHome page in HA says they are offline but the data is coming through and I can connect to the logs wirelessly.

I have been able to update these ‘offline’ devices remotely and both the devices and the addon are at the latest version.

Other devices on the main network are fine.

Any suggestions why this might be?

[edit]
I think there must be a setting within OpenWrt that is blocking the discovery as I have the same problem with Tasmota and TDM where it is not ‘finding’ the devices.

Does anyone know what the network requirements are for a device to be ‘found’ automatically by ESPHome/Tasmota? I’m thinking they may use the same mechanism.

The solution was to ensure the mDNS traffic was sent out to the second network.

Following this guide solved it for me Resolving mDNS across VLANs with Avahi on OpenWRT – Just another Linux geek

2 Likes

The work’a’round is written in the FAQ (disable mDNS and use ping instead):

ESPHOME_DASHBOARD_USE_PING=true

Note

By default ESPHome uses mDNS to show online/offline state in the dashboard view. So for that feature to work you need to enable host networking mode

On MacOS the networking mode (“-net=host” option) doesn’t work as expected. You have to use another way to launch the dashboard with a port mapping option and use alternative to mDNS to have the online/offline stat (see below)

mDNS might not work if your Home Assistant server and your ESPHome nodes are on different subnets. If your router supports Avahi, you are able to get mDNS working over different subnets.

Just follow the next steps:

  1. Enable Avahi on both subnets.
  2. Enable UDP traffic from ESPHome node’s subnet to 224.0.0.251/32 on port 5353.

Alternatively, you can make esphome use ICMP pings to check the status of the device with the Home Assistant add-on "status_use_ping": true, option or with Docker -e ESPHOME_DASHBOARD_USE_PING=true. See also Dashboard status light not working across subnets/zones · Issue #641 · esphome/issues · GitHub.

Notes on disabling mDNS

Some of ESPHome’s functionalities rely on mDNS, so naturally disabling it will cause these features to stop working. Generally speaking, disabling mDNS without setting a static IP address (or a static DHCP lease) is bound to cause problems. This is due to the fact that mDNS is used to find the IP address of each ESPHome nodes.

  • You will not be able to use the node’s hostname to ping, find it’s IP address or connect to it.
  • Automatic discovery in Home Assistant when using native API relies on mDNS broadcast messages to detect presence of new ESPHome nodes. If you need to use the native API with mDNS disabled, then you will have to use a static IP address and manually add the ESPHome integration with the fixed IP address.
  • Online status detection in ESPHome’s dashboard by default uses mDNS, so disabling mDNS will cause the ESPHome dashboard to show the status of the nodes created without mDNS support to be always offline. Currently, this does not affect any functionality, however if you want to see the online/offline status you could configure ESPHome to ping each node instead. See the notes in the Docker Reference section for more information.

Source: Frequently Asked Questions — ESPHome

Thank’s @baz123 for leaving the solution (not a work’a’round) here which should be valid for all routers running openwrt :muscle:

1 Like

Ah, RTFM :crying_cat_face:

My pleasure. Perhaps it needs adding to the FAQ!

1 Like