ESP devices on different subnet not visible

I noticed that after flashing my ESP devices, and set a different WiFi network, that the devices no longer show up as available in ESPHome.

My HA installation is on subnet 192.168.1.x and my ESP devices on 192.168.2.x. I can ping all devices from my HA instance. My 192.168.1.x subnet has full access to my 192.168.2.x subnet. So everything should basically be available.

However, in ESPHome in HA, I get the message that the devices are offline. Is there anything I can do about it, accept having to put them back on the same subnet as my HA installation?

This might help you? sounds like the same issue

They are discovered by mdns, which doesn’t cross subnets by default. Enable status_use_ping in esphome’s config.

Tried this, but no luck. I can add it manually as device to the integrations. But I want it to show up in ESPHome for updates and firmware changes.

Flipped the switch in ESPHome config, but the device is still marked as offline, while it’s actually online. :slight_smile:

And restarted the addon?

Yes. Even restarted HA.

So you can ping the device successful from within ha (console)?

Yes, see the opening post. I can ping all ESP32 devices in the different subnet from within HA console. I can also manually add them to HA as a device and control them. However, ESPHome does not detect it and says it’s offline.

Only when I update the firmware and set the IP to an address in the same subnet as HA, ESPHome will see it.

Notice this in the logs when I try to checkout the logs for the device:

WARNING Can’t connect to ESPHome API for doorbell.local: Error resolving IP address: [Errno -5] No address associated with hostname

Not sure where doorbell.local hostname comes from. I don’t use “local” anywhere and only use it’s ip address.

Found it: I guess I had to use “use_address” param in the wifi settings. I just found about it in this topic:

Setting the ip address as value for the use_address solved the problem. :slight_smile:

1 Like

.local is exclusive to mDNS but that doesn’t work across your (sub)networks

Yeah, I understand. I wasn’t aware about the .local domain until I put them in a different subnet. :smiley:

It’s the default in esphome:

  • 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 you a free to change it (makes sense if you rather want to work with hostnames instead of fiddling with IP’s)

1 Like

Completely missed that part. :smiley: Thanks.

can some one please post an example of how use_address is in yaml?

Really? WiFi Component — ESPHome

Use_adress didn’t fix it for me. I could update and see logs, but it still showed offline.
In ESPhome addon settings I enabled ping instead of mDNS to find devices

1 Like