I am loading a device with ESPHome code that uses the Sharing ESPHome devices
template. After the device is connected to the network, Home Assistant discovers the new device, but ESPHome never discovers the new device. The code does have dashboard_import: set to a valid github url and specifies import_full_config: true
Does the ESPHome discovery process have any other requirements? Is it supported if Docker versions of Home Assistant and ESPHome are used?
I have no idea what this means. I just add a device, edit the YAML code, done.
Post your YAML file.
From my notes:
Go to the ESPHome panel, click on “Add Integration”. Search for “ESPHome”.
When you click on ESPHome, you are presented with the dialogue to enter the node IP address.
Enter the node IP address and click on “Submit”. The node is then added to the ESPHome integration.
The sharing process is documented at: Sharing ESPHome devices — ESPHome which has sample YAML. It is designed to add devices with ESPHome already loaded and to adopt that device into ESPHome.
Differences between an ESPHome instance and add-on may be in play. My ESPHome 2023.3.2 dashboard does not have an “Add Integration” option. It says: " Welcome to ESPHome It looks like you don’t yet have any devices." and the only thing I can select is “+ New Device” which does not seem to have the adopt functionality.
I just tried a scenario by loading ESPHome on Windows Docker. I compiled https://github.com/konnected-io/konnected-esphome/blob/9aff3b8d0fc4ad493d8f6af9219805c5d81d5a49/alarm-panel-pro-esp32.yaml and installed the binary via USB from https://web.esphome.io/
Home Assistant sees the ESPHome instance with details confirming it is the version I compiled today. ESPHome running on the same same docker device as HA does not see the device. Even stranger, the ESPHome Docker running on Windows shows “OFFLINE”, but if I click “VISIT”, it shows the state of the sensors and reports the IP address. This information is consistent with what is shown in HA.
The device is found via mDNS/ZeroConf:
dns-sd -Q alarm-panel-pro.local
Timestamp A/R Flags if Name T C Rdata
15:41:26.764 Add 2 18 alarm-panel-pro.local. 1 1 192.168.1.138
The solution was to remove the ESPHOME_DASHBOARD_USE_PING=true environmental parameter for ESPHome running on Docker. Then ESPHome was able to detect the ESPHome instance and ADOPT the device.
The misinformation about ESPHOME_DASHBOARD_USE_PING and mDNS are throughout Frequently Asked Questions — ESPHome ESPHOME_DASHBOARD_USE_PING disables mDNS which is not documented. ESPHome uses mDNS to show online/offline state.
Sorry but so close. I cant figure out how to create a select function that I could expose to hassio that would allow me to select a page from the ones I have created. Heres the code I have so far…
I ran into a similar problem. mDNS wasn’t working, but I do have Avahi setup as a reflector. I’ve been using HA this way for a few months and this was working fine. Or so I thought.
The way avahi in a docker container works, or at least for me worked, was that it was happily reflecting on existing interfaces. Since I decided to put esphome into my mix of containers, and avahi was already happily running, for some reason it was not connecting to the ‘existing’ network interfaces.
A simple restart of the avahi container was enough to make all discovery work just fine.
Normally, I would expect avahi to listen on 0.0.0.0 and if interfaces get added or removed; that this would just work ™. However, I think avahi scans interfaces and adds/removes ‘somehow’. That is something I haven’t figured out.
This should generally only be really a problem whenever a new docker network gets created, but ideally this should just work ™.