MQTT Debugging


perhaps someone has a better eye than myself. My MQTT temp sensor do not work.

This is my thing (other things in this broker work!):

Thing topic MQTT_Temp1 {
        Type number : temperature "Temperatur" [ stateTopic ="tele/tempsensor1/SENSOR" , transformationPattern="JSONPATH:$.AM2301.Temperature" ]

This is my item:

Number DG_BR_Temperature "Temperatur" <temperature> (DG_BedRoom, gInsideTemperature) { channel="mqtt:topic:brokerhome:MQTT_Temp1:Temperature" }

This is what MQTT.fx shows me on the broker:
Message: tele/tempsensor1/SENSOR

What did I miss?


Try to complete your item’s label with “[%s]” “Temperatur” -> “Temperatur [%s]”

Sadly without change. The MQTT messages do not arrive at openHAB.

Delete the space after stateTopic in the definition of the temperature channel. Change
stateTopic ="tele/tempsensor1/SENSOR" to stateTopic="tele/tempsensor1/SENSOR"

Important questions, do you use openhab 2.4 stable? Did you add this item for last? Did you see on frontail log this channel went to online after you saved the new configuration? I’ve experienced that, sometimes the mqtt went wrong somehow, when I modified something. There was not any syntax error, just couldn’t parse the mqtt binding correctly. After the openhab restart, everything started working fine… As far as I remember, I’ve read somewhere it’s a known bug, but unfortunately I don’t remember, where…

In your channel definition you have set the Broker and Thing, but not the channel! Your channel is “temperature” (LOWER CASE)!
You could use PaperUI in order to copy the correct channel Syntax!

lower case was the issue. Thanks for the hint!

Great. In this case please mark this thread as resolved.