I am relatively new to ESPHome and HA, but I have recently been trying to setup my system.
I went for MQTT way, i.e. my ESP8266s do not have API tag in their config. I managed to setup ESP8266 and MQTT explorer shows the device and messages coming in. I also see retained configuration messages of homeassistant with its prefix topic. This is my device config.
One problem I saw right away is that no entities were created in homeassistant although retained config messages are seen in MQTT explorer.
Do I need additional setup for HA to see this device and somehow to autodetect it and add entities? Do I have to modify configuration.yaml to do that only? What is the typical workflow for MQTT ESPHome devices/entities to appear? I have reviewed manual several times, but it is really hard to read and understand sometimes, because it mostly works as a reference only…
Moreover, I recently reinstalled homeassistant machine and thus all of my devices are gone now. But I do not understand, how can I readd my devices to ESPHome dashboard that are based on MQTT integration only? They do not have API integration. At the moment, HA does not add them via devices section (with an IP) and states that “it does not have API tag”. Also, there is no option to readd on ESPHome section. I am simply lost, I do not want to reflash all my devices incase I reinstall homeassistant OS…
I do not know, why I missed that, but yes, I found that there is that MQTT autodiscovery option that I should have enabled. For some reason I was not aware of this… Thanks, now it seems that entities are created, appreciate that.
But still, the second problem exists. I do not know how to readd that device to ESPHome dashboard in order to enable OTA upgrades. Adding device through HA simply requires API, but… in this case, it is not preset.
I have addon installed. I added ESPHome device, configured it successfully, I was able to install firmware OTA, but then I deleted the device. And I am no longer able to add it back. It does not have API enabled, only MQTT works for data transfer, so I am not really sure how to get it back to ESP Dashboard (if that is possible at all) without actually reflashing from scratch.
I would like to ask you guys for some explanation as I am getting slightly lost with the ESP & mqtt and please do excuse my basic question - if I get an ESP device into HA is it automatically discovered by mqtt and broadcasted? Example - I have an ESP32 with BMP and INA sensors with few entities. No mqtt configured in ESP yaml code. The device is visible in the Explorer and I have access to the sensors’ entities also in my Homey that gets mqtt communication. I can not however see these sensors entities under mqtt integration…
Your kind clarification for a noob would be highly appreciated…
Then it won’t be using MQTT, nor will the sensors appear on your MQTT broker.
The only way (mostly) for an ESPHome device to connect to a broker is if you define the MQTT broker in the YAML, and turn off the api for good measure.
I was thinking same way, but - it appears in the MQTT Explorer (?) and as I wrote - I can get it from HA to my Homey, which do communicate with each other using matt… I have intentionally deleted the mqtt config in yaml as I had duplicated sensors when I have added device to HA, now I only have single entities but still mqtt explorer sees it… I can not understand that…
If retain was set to true then the broker will cache that forever. Delete the topic in Explorer and see if it comes back. Click on the top level of the topic - then top right of Explorer in the Topic pane there is a little bin symbol to remove it.
I guess there was no retain setting but I think it defaults to true. After deleting this topic from explorer it is not coming back. Thank you for helping me understand. Best. JU.