Today I added a illuminance sensor that publishes its values using mqtt.
The values are positive integers without any dot or comma.
The message size for a single digit value is 2 bytes (value + null termination).
The topic is “flur/illuminance”.
I used copy & paste to make sure openHAB has the correct topic.
This is working and verified using mqtt-spy.
However the item in openHAB does not get updated although the mqtt topic receives new messages, its state is always “null”.
This is my Item:
Number Flur_Illuminance "Flur Beleuchtungsstärke [%.2f Lux]" <illuminance> { mqtt="<[mqttBroker:flur/illuminance:state:default]" }
I have other items configured using mqtt which are working fine, like these:
Number Wohnzimmer_Temperature "Wohnzimmer Temperatur [%.2f °C]" <temperature> (Wohnzimmer_Heizung) [ "CurrentTemperature" ] { mqtt="<[mqttBroker:wohnzimmer/temperature:state:default]" }
Switch Flur_Presence "Flur Präsenzmelder" {mqtt="<[mqttBroker:flur/presence:state:default]"}
Odd, I don’t see anything wrong if your item definition.
Try copying and pasting a working mqtt item, change the name to testItem and change the topic to flur/illuminance
Save the item file
Send a value on that topic from mqttfx, what happens?