I moved my ESPHome devices to a different subnet and they no longer report - but I can flash them or see the logs

I have two ESPHome devices. One is a sps30 particle sensor and one is a custom window opener. Both have been happily working for quite a while.
Recently, I created a dedicated WiFi network (different subnet) for all my IoT stuff and am slowly moving all the devices there. Today it was turn for ESPHome stuff.

I edited the configuration of both sensors to make them connect to the new WiFi and uploaded the new firmware. The upload went fine, but I could not see the usual log output after flashing, as HA was trying to connect to the old IP address. Not a problem, I edited the configuration again and added a manual_ip block. This made it possible to view the log output from both devices.
But, both were showing as “offline” and both were showing as unavailable in my dashboard.
The next step was a change in ESPHome configuration to enable “Use ping for status”. This made both devices show as “online.” (And yes, I can ping them just fine.) But the dashboard still shows both as “unavailable”.

And now I am kind of lost. I am running recent versions of everything:

Add-on version: 2023.12.5
You are running the latest version of this add-on.
System: Home Assistant OS 11.2 (amd64 / qemux86-64)
Home Assistant Core: 2024.1.2
Home Assistant Supervisor: 2023.12.0

The ESPHome logs do not tell me much either:

2024-01-09 22:50:42,137 INFO 304 GET /devices (0.0.0.0) 1.74ms
2024-01-09 22:50:47,088 INFO 304 GET /devices (0.0.0.0) 1.16ms
2024-01-09 22:50:52,095 INFO 304 GET /devices (0.0.0.0) 1.08ms
2024-01-09 22:50:57,107 INFO 304 GET /devices (0.0.0.0) 1.02ms
2024-01-09 22:51:02,114 INFO 304 GET /devices (0.0.0.0) 1.06ms
2024-01-09 22:51:07,120 INFO 304 GET /devices (0.0.0.0) 1.38ms
2024-01-09 22:51:12,130 INFO 304 GET /devices (0.0.0.0) 1.20ms
2024-01-09 22:51:17,139 INFO 304 GET /devices (0.0.0.0) 1.10ms
2024-01-09 22:51:22,147 INFO 304 GET /devices (0.0.0.0) 1.06ms
2024-01-09 22:51:27,155 INFO 304 GET /devices (0.0.0.0) 1.43ms
2024-01-09 22:51:32,164 INFO 304 GET /devices (0.0.0.0) 1.72ms
2024-01-09 22:51:37,169 INFO 304 GET /devices (0.0.0.0) 1.39ms
2024-01-09 22:51:42,177 INFO 304 GET /devices (0.0.0.0) 1.36ms

Any ideas? Thanks!

Are you referring to the sensor like this?
image

HA uses mDNS to connect to devices - this doesn’t work across subnets.

Have a read of the 2 links below and try disabling mDNS as per the instructions, update the device and see if that makes a difference.

You also may need to remove the device from the ESPHome integration and re-add it.

1 Like

It can be configured to work across subnets/vlan.

So @bartekk might just to fix his network configuration without messing with esphome/ha at all!

Hm… what do you mean by “doesn’t work across subnets”? I have subnet /22 in my network and all my esphome devices work in HA , but i didn’t change anything in HA… all i have is set “Use ping for status” in esphome’s addon.
HA is in x.y.0.x, while modules are in x.y.3.x .
However, i have all static IP’s and i always add my devices with IP, never with mDNS name (but HA itself is already offer me a new device based on it’s local IP).

And i don’t have disabled mDNS part in esphome…

Yeah - I think the difference is he set them up in the original subnet then moved them.

I was referring mDNS - which uses a broadcast protocol (Bonjour and other names) which doesn’t cross subnet boundaries.

Probably just removing them from the integration and re-adding them so HA knows they are static IPs may fix it. Then it may not attempt to use mDNS.

1 Like

But can configured to do so (reflector)

Weird - because AFAIK the auto discovery of esphome nodes in HA is based on mDNS…

Yeah…well, i could be wrong here… i meant, when HA finds it by itself indeed it does show my node name (not IP), but does find it, and if i’d manually enter IP it would find it also… so, it could be that it still finds it via mDNS… but the main thing is that i didn’t change anything (not in HA not in esphome), but obviously still works…

So, the problem kind of solved itself. Today it was the turn of Home Assistant to move to the IoT vlan. Now I can see the data from my devices again.

Before the move I tried disabling mDNS - this, sadly, did not help.

Thanks for looking into this, everyone!