ESPHome Integration won't adopt

I recently rebuilt my network and setup a few VLANs to separate my IoT devices from other clients and start building a more secure environment. Everything is working as it should except my ESPHome integration. All my ESPHome devices show and work perfectly under devices but I am unable to integrate them back into the integration panel. They all show up as offline. I tried re-installing the integration, deleting everything inside the esphome folder and re-uploading the YAML files for my devices. Have tried finding other posts here from people that have had the same problem but cannot find a solution. Any help would be greatly appreciated. Does having my network re-assign IP addresses to new ones be the problem.

If your esp devices are on a different VLAN than HA, that’s expected, as ESPHome try to reach them via their mDNS names, and mDNS does not cross vlans.

@koying Thank you. Will try to fix this afternoon. Much appreciated.

either use static IP or define your local domain (and configure your dns (router?) accordingly)

Is there a way to change how ESPHome communicates with the devices?
AFAIK, it always uses <device_name>.local…

@koying No, there is another way (which i am using)…

esphome:
  name: device
wifi:
  ssid: my-wifi-network
  password: my-wifi-password
  domain: my-domain.net

so my device is reachable at
device.my-domain.net

But ofc, my-domain.net must be registered as your domain name in your dns (in my case, in my router)
Did it like that as mDNS is not very reliable at my network :thinking:

I’m sure, but the OP questions is regarding the fact that ESPHome itself (the dashboard) cannot reach the devices.
Can it with your way?

Also the use of ‘use ping for status’ may help.

It is in the addon configuration settings.

Hello all. Apologies for the quick response. HA and all my IoT devices are in the same network now. I have Multicast DNS enabled. HA is using a static IP address. Still not working. Have deleted all my YAML files from esphome folder (backed them up first). All my devices are still showing up as devices but cannot adopt them into the ESPHome instance. Will continue trying tomorrow. Thank you all for your time!!!

Yes…it works for add-on…

with mDNS is occasionally had some devices that stayed offline, never with normal DNS.

And when device is off line when trying to reflash, it complains device.my-domain.net cannot be reached :wink:

1 Like

There are requirements for adoption.

Note

The Project information above is required for adoption to work in the Dashboard.

Sharing ESPHome devices — ESPHome

@nickrout Thank you. This helped. I added:

use_address: "10.0.20.XXX"

to my WiFi settings and everything seems to be adopted.

Thank you all

great…
but I already told you to use static in my 1st post… :wink:

1 Like

@aceindy Yes, the address had been static on the router side from the beginning. What changed things for me was adding the use_address line in the YAML file. Any idea why this made a difference?

They do if your router can do mDNS reflection. For example pfsense provides this within the Avahi package. Opnsense provides this within the “mDNS Repeater” package.

I do exactly this and it works fine. My esphome devices are all on an isolated VLAN with no WAN or LAN access except to my HA instance and my desktop computer. With Avahi reflection enabled on the router, absolutely everything works exactly as normal, both within the esphome console and Home Assistant.

Yeah, yeah.
At the end of the day, few using DIYer’s router OS like xxxsense or xxxwrt will even consider relying on mDNS for their name resolution, so that’s a bit fwiw, isn’t it? :wink:

That is not static, it is a IP reservation on your DHCP server based on MAC Address, but DHCP nevertheless

and that also explains it…

Understand. Thank you!.

I don’t understand what you’re insinuating. I’m literally answering the precise question posed by the OP, who expressed difficulty with mDNS resolution across VLANs. This isn’t an uncommon scenario, or some rare configuration. There are many guides online which encourage you to separate your home automation devices using VLANs. It’s good advice.

Enabling mDNS reflection is the answer for most people. It’s almost certainly relevant to the OP since most routers capable of managing VLANs are capable of doing mDNS reflection. This includes all the open source options, but also most enthusiast favourites like Ubiquiti Unifi and EdgeRouter.

Telling people to abandon good security practices because you’re not aware of mDNS reflection isn’t a good answer.

Why would “DIY” people using software routers not rely on mDNS for esphome name resolution? It works perfectly fine. What would they be relying on instead?

Cool down. mDNS is not “a good security practice”, it’s unrelated to security.
@aceindy provided the proper solution of using an actual DNS, rather than using a multicast protocol, to do name resolution across VLAN’s.

Using mDNS reflection is just a workaround to the inherent limitation of the mDNS protocol. It’s a fancy name to “let’s broadcast multicast packets across VLAN’s while multicasts are not meant to go across VLAN’s per specification”.