Does UniFi's mDNS relay carry ESPHome? Not on the published Auto list. Home Assistant finds ESPHome devices through the service type _esphomelib._tcp, and Ubiquiti's published Auto list covers AirPlay, Chromecast, HomeKit, Sonos, printers and the Matter Network types without it. Custom mode can add the type by name, All mode forwards everything, and keeping Home Assistant on the same VLAN removes the question.
Home Assistant's ESPHome integration declares three discovery methods in its manifest: Zeroconf on _esphomelib._tcp.local., DHCP discovery of devices it has already registered, and an MQTT topic. The MQTT one only concerns nodes running the MQTT component instead of the native API. The first finds new devices, and the second recognizes a device Home Assistant already knows when it asks for an address.
The first two are link-local. The IoT VLAN guide explains why mDNS stops at a VLAN boundary and why Ubiquiti built a relay, and the relay's published list is the part that matters here.
Ubiquiti's switch settings reference lists the service types it says Auto mode commonly includes. It carries Apple, Google, Sonos, Roku, Bose, Philips Hue, Aqara, printers, scanners, file sharing and the Matter Network types. There is no entry for ESPHome, nor, as the IoT VLAN guide found, for Home Assistant's own announcement.
Three layouts handle that, in order of how little they ask of the gateway:
- Home Assistant on the IoT VLAN. Announcements arrive directly, nothing is relayed, and the gateway's relay limit of two networks on an Express or UXG Lite is never spent. This is the layout the VLAN guide recommends.
- Custom mode with the type added. Ubiquiti's mDNS proxy article says new services can be added in the form
_service._protocol.local, so _esphomelib._tcp.local between the IoT and trusted networks is a one-line change.
- All mode. The switch reference says all mDNS traffic is forwarded by default, which works and relays everything else too, at the airtime cost the broadcast article describes.
Without any of those, ESPHome's FAQ spells out the fallback. Disable mDNS only with a static address in place, add the device to Home Assistant manually by that address, and expect the hostname to stop resolving unless regular DNS serves it.
The ESPHome Device Builder, in fact, behaves slightly better: its FAQ says status detection uses mDNS where available and a periodic ping sweep for every node regardless. A device whose address resolves another way, through use_address or a hostname regular DNS serves, therefore still shows online across a VLAN. Running the builder in Docker needs host networking for the same reason.
Be aware that two SSID settings also interfere, and both are on Ubiquiti's IoT list as Off. Multicast and Broadcast Control restricts multicast to approved clients and blocks cross-access-point discovery, while Client Device Isolation stops clients on one access point from reaching each other.