All MQTT Entities Not Being Detected

HA NooB

I have successfully setup a EMQX MQTT broker and have an Arduino board connecting and publishing data to the broker. I have verified this by using MQTT Explorer and all topics are shown.

I have installed the MQTT integration and configured.

I have the following sensors configured in configuration.yaml

sensor:
name: “THP-3C722F Location”
unique_id: THP-3C722F-Location
state_topic: “THP-3C722F/Location”

name: "THP-3C722F Tavg"
unique_id: THP-3C722F-Tavg
state_topic: "THP-3C722F/Tavg"

What is interesting is that ONLY THE LAST sensor entity is being picked up by the MQTT integration.

I’m not sure what I’m doing wrong. Any help would be greatly appreciated.

John

I can’t really tell what’s going on there as spacing has been butchered in your post. Please follow these directions to format your code correctly so it is readable.

Sorry about that…

image

Here is the display from MQTT Explorer connected to EMQX broker showing all the topics…

image

Still haven’t got it right - please read the page Mike linked again. You should not post code in images, please copy the code and paste it inside Preformatted Text tags. They look like </> on the posting toolbar.

Meanwhile - you don’t have a mqtt: definition. This is what one of my mqtt sensors look like:

mqtt:
   sensor:
     - name: "Front Verandah Lux"
       state_topic: "lux_sensor/sensor/bh1750_illuminance/state"
       device_class: illuminance
       unit_of_measurement: "lx"
       expire_after: 900

Note the mqtt: line at the beginning and the correct indentation.

Also try prefixing each name: line with a dash like the example above. It probably thinks you have defined only one sensor.

Thanks @zoogara, adding the dash was the trick. I had already had the mqtt: definition just didn’t have it in the screen shot. Thanks for feedback on how to post properly.