Topic name components, magic?

I have two sensors, B0004 and 8900012 and I get the data from topics

  - platform: mqtt
    name: "8900012"
    state_topic: "sensor/8900012/status"
    unit_of_measurement: 'C'
    value_template: "{{ value_json.value  }}"
  - platform: mqtt
    name: "B0004"
    state_topic: "sensor/B0004/status"
    unit_of_measurement: 'C'
    value_template: "{{ value_json.value  }}"

The json structure is similar for the topics.

I can see messages coming in in the mqtt listener/debugger.

However, I can not get the data into logic from the sensor B0004 unlike from the other one.

As I am a newbie both in MQTT and in HA, Iā€™m running out of ideas here.

Only possiblity I can see is that there is some magic, maybe interpreting B0* as a binary number or something funny like that.

Any ideas? I can not change the topics in the sending system.

I browsed through the MQTT protocol specification but could not see any restrictions related to a problem like this.

My HA is of version 0.103.5

Use node red
Mqtt listen node linked to a debug node
Set the debug to full msg output.
Check the debug window

Thanks.
Before receiving your message I guess I got it.
Even though a debugger shows the messages, it does not receive them.
This, related to qos-setting (0) hints that someone is eating my messages, and ā€¦ I think this is the issue here.

It could be that the json is malformed for the second sensor. What is the actual message sent to the topic?

MQTT Explorer is a great tool for debugging mqtt. Recommend you install it on a local pc.

Well change the sensor state topic to something else make it up
Create a node listen with the original topic and node publish to the new topic you set on the sensor
I did that for my door sensor as i was getting errors in the logs that all the other payload it was looking at werent valid values.
Unsubscribe in HA on the original topic

MQTT Explorer is installed and used. Good software.
Wireshark seems also to be able to decode MQTT.

There was some structural issues in my configuration.yaml.
Now I have truckload of sensors understood by HA, working just fine.
Next step will be the relays.

1 Like