MQTT device discovery (config) - Can't find my device

I have a lot of devices that I built over the years with lots of ESP32 code. I want to move the reporting of the data from these devices to Home Assistant using MQTT.
To get started, I created some test code for a single device with just one sensor. I studied a lot on the current MQTT device discovery method and tried to implement it. My Home Assistant instance runs under Proxmox and I have a an MQTT broker on the same Proxmox server. I pointed my Home Assistant MQTT to the address of the MQTT broker and can see the data coming into it through MQTT Explorer on HA. Now, how do I find the entity that is my new sensor???

Here in MQTT Explorer, you can see the discovery package (in the green outline) that I am sending from the device and the first data message “9596”,( in the blue outline). Both are under the root topic of homeassistant (in purple outline) on the MQTT server at 192.168.1.217 which is where I pointed the MQQT device on HA when I configured it (and double checked that using “reconfigure”

Do you see anything wrong with the discovery message format?

When I go to settings/devices/entities and search, I can’t find the new entity which I would think would contain “lp” or “tank”.

What basic thing am I doing wrong here? (three days into trying to figure this out)

THANK YOU

In MQTT Explorer, if the JSON format is syntax correct, the text will be in color. Otherwise it will be mono colored. That’s a helpful hint I found by accident.
image
Also I have a blueprint that I make several MQTT discoverys in. Here’s the code f it will help you.

@Sir_Goodenough That hint regarding the color-coding in MQTT Discovery is golden (though my colors are subtle). It turns out I was missing the ‘/’ after “device” and the ‘[’ ‘]’. Fixed those things and its working great
Thanks!

1 Like

If this suggestion solves your problem, please consider clicking the solution button to close the thread.