Hi. I have a temp sensor that broadcasts over MQTT. Using a dallas temp sensor with ESP8266 Wemos D1 mini.
I have the identical setup for several other units and they work perfectly. I can also see that the message is being relayed to the MQTT server when I check with MQTT-explorer. The other entities (wifi, led switches) work nicely with this config. it’s just the the temp sensor that HA doesn’t pick up for some strange reason.
If you enable MQTT and you do not use the “native API” for Home Assistant, you must remove the api: line from your ESPHome configuration, otherwise the ESP will reboot every 15 minutes because no client connected to the native API.
Blockquote
the second error is you topic_prefix, home assistant watches for the prefix homeassistant… unless you have defined otherwise.
to make this work you would have to manually go into MQTT in settings, and add r1/f_6 to “listen to a topic”
Thanks. I forgot to include the api line but I have set it to reboot:0, which prevents it from rebooting every 15 min.
# Enable Home Assistant API
api:
password: "123"
reboot_timeout: 0s
This actually works fine on my other sensors together with mqtt. I use the above as a template. And the rest of the sensors above work.
Regarding the topic, I’m not really sure why it doesn’t work. I use the same base topic for the rest of the sensors and I haven’t defined them manually and they pop up automatically. So for example, I have f_5 that works as intended.
I know this is an old topic, but I just found this one on a google search having the exact same issue. Just wanted to document my solution in case this happens to anyone else:
In my case I had the same situation as the OP: I have two slightly different sensor connected via MQTT and one (the one I added to HomeAssistant last) did only show some of the sensors in HomeAssistant. The correct update messages show up in the MQTT log, but are not represented as a sensor of the device. I figured out the missing sensors were those, which had the exact same name (not id) as the other sensor. So here is what I did:
made the names unique
cleaned and recompiled the esphome project
removed the device from HomeAssistant and restarted HomeAssistant (maybe unnecessary)
uploaded the new code to the esp
Voila, all values show up.