[SOLVED] Number Items do not update after MQTT topic publish

Hi Guys, I have got a Problem with my Number items not updating after the MQTT topic being updated.
I think I set up the MQTT binding correctly. The number items get the correct value from the mqtt topic they subscribed to when I save the item configuration file. If a new value is published to the topic where my number item is getting its value from, the item does not update inside openhab. Even in the log does not say anything about a changed value.

this is my thing definition:

Bridge mqtt:broker:mosquitto [
  host="192.168.0.46",
  secure=true,
  username="user",
  password="password"
] {
    Thing mqtt:topic:test {
Channels:
      Type number : beacon1        [ stateTopic="Test/beacon1"]
      Type number : beacon2     [ stateTopic="Test/beacon2"]
    }
} 

this is my item definition:

Number DstBeacon1_temp  "Distance Beacon 1" { channel="mqtt:topic:test:beacon1"}
Number DstBeacon2_temp  "Distance Beacon 2" { channel="mqtt:topic:test:beacon2"}

Am I missing something or does anybody know why my number items are not updating?
Thank you very much guys!

If you are running 2.4 stable you need to restart openHAB after modifying the things file.
This does not happen when using the paperUI to set up things which I strongly recommend.

Alos try adding mosquitto to the item channel like below.

Number DstBeacon1_temp  "Distance Beacon 1" { channel="mqtt:topic:mosquitto:test:beacon1"}
Number DstBeacon2_temp  "Distance Beacon 2" { channel="mqtt:topic:mosquitto:test:beacon2"}

Also in the Things file you can try like this.

Bridge mqtt:broker:mosquitto [
  host="192.168.0.46",
  secure=true,
  username="user",
  password="password"
] {
    Thing topic test "Test" @ "Test Site" {
Channels:
      Type number : beacon1        [ stateTopic="Test/beacon1"]
      Type number : beacon2     [ stateTopic="Test/beacon2"]
    }
} 

Not sure if the word “Test” should be in cap’s or not but I would think it should match what’s in the channel.

1 Like

editing the channels broke it unfortunately.
But thank you you anyways!