MQTT sensor not updating state after payload sent!

My mqtt sensor states update suddenly stopped working so I installed HIVEMQ to replace the other MQTT broker addon so I would have access to the logs and from there I can see the payload is sent and received as expected !

However, the binary sensor which uses this state topic is not updating at all each time I send a payload to my MQTT broker !

Can anyone please help on how to debug this ? I have absolutely no clue on how to fix something like this considering nothing seems to be wrong on mqtt side .

Thanks !

When you did that, did you reconfigure Home Assistant to connect to the HiveMQ Broker?

You can confirm the connection is working properly by going to Developer Tools > MQTT and publishing a payload to a topic (of your choice). HiveMQ’s log should report the published payload. If the log fails to report it then the connection may be faulty.

Yes I did reconfigure HA to connect to the HiveMQ Broker, didn’t really have to do anything except changing password .

The connection is working as can be seen in the screenshot, I can publish the messages to the topic by using either HiveMQ web interface or mosquitto from an external server .

I can see the payload is received by the broker in the messages section from HiveMQ but the problem is it’s not changing the state of any of my binary sensors using the topics I send the payloads to …

What Taras is asking, can you publish from HA - Developer Tools - MQTT ? That is important to know.

@francisp yes I think it’s publishing …

It’s like although it gets published to the topic there is no connection to the sensor state afterwards … and I am 100% sure the sensor is setup with the right topic :neutral_face:

Already tried to reinstall both HiveMQ and MQTT broker addons but the issue still persists

Message published is messages received, so this seems OK. Can you post the configuration of your sensor ?

binary_sensor:
  - platform: mqtt
    name: "fdc"
    state_topic: "cameras/StudioCam/motion"
    device_class: motion
  - platform: mqtt
    name: "fde"
    state_topic: "cameras/OfficeCam/motion"
    device_class: motion
  - platform: mqtt
    name: fdcperson
    state_topic: "cameras/Alarm/motion"
    device_class: motion

It’s the same config I was using before, it was working properly ever since I created it, just stopped out of nowhere …

Did you get this figured out? I’m in the same boat right now

1 Like