There might be something not quite right with the mDNS implementation in esphome anyway.
I have two devices, ‘SlimmeLezer eth’ and a DOIT ESP32. Both have near identical configurations, except the ethernet part. The ethernet device shows up in esphome, the wifi one does not.
In home assistant however, both are working just fine, get discovered (through mDNS!!)
I’ve spend half the day to figure out why this is. First I thought it could have been an esp-idf vs arduino platform thing. Then I thought this is somehow related to avahi. But as I said, hass works fine.
One thing I ran into, is that the (neither) container could resolve the .local
hostname. This could be the root cause maybe, and I’m working on integrating avahi2dns to inject these records into my DNS server, then I know for certain. It seems that home-assistant gets the information from avahi (through dbus), and then uses the IP onwards; but esphome somehow relies on mDNS resolution, which (especially in containers) is tricky at best.
Edit: I flashed a different firmware on the same device (using the same similar yaml file) and I can even get the ‘adopt’ button … I’ll adopt it, copy/paste my yaml into it and then see how it goes … hmm, after copy pasting the yaml or at least the ‘name’ part (for some reason the adoption removed 10% of the upstream yaml, but the ‘package’ node with the yaml url was still there) i now had 2 functional/online nodes. The pre-compiled binary variant and my own yaml (not supprising as they share the same IP/Mac/other config parameters), which is supprising as my node is now online, and even after putting in my yaml, stays online. Can’t view logs remotly stil; but that’s due to the .local
resolving not working. Speaking of, my hostname is a dynamic one, name+mac, which is translated by esphome to just the name, so that’ll never work anyway.
Smells like a few bugs exist in this bit still.
Just upgraded to 2024.7.0 and things seem a lot better already. Could be something unrelated of course as well; but reading wireless logs now also works.
One note, I’m comparing to devices that have name_add_mac_suffix: false
right now, so could be that this is also a huge part of the problem, because I saw in a lot of places that esphome uses name.local
instead of name-mac.local
…