I use the “new” MQTT2 binding with the latest openHAB release 2.5 (official Docker image).
I have an item with the unit of measurement “Temperature”, linked to an MQTT stateTopic and commandTopic. The input from the stateTopic is working perfectly, but sending a new value through the commandTopic sends the old value instead, not the new, changed value.
If I remove the unit from the item definition the update works as expected.
This is my (stripped down) things definition:
Thing topic DevoloThermostat03 "Devolo Home Control Radiator Thermostat (Wohnzimmer)" @ "Wohnzimmer" {
Channels:
Type number: setpoint "Zieltemperatur"[stateTopic="zwave/DevoloThermostat03/thermostat_setpoint/heating_1",
transformationPattern="JSONPATH:$.value",
commandTopic="zwave/DevoloThermostat03/thermostat_setpoint/heating_1/set",
min=10, max=28, step=1]
}
And the corresponding item with the Temperature unit.
Number:Temperature
thermostat03_setpoint "Zieltemperatur [%.1f %unit%]"
<temperatur>
{channel="mqtt:topic:mosquitto:DevoloThermostat03:setpoint"}
The event log after changing the item on my sitemap looks good:
2020-02-20 13:17:04.442 [ome.event.ItemCommandEvent] - Item 'thermostat03_setpoint' received command 24 °C
2020-02-20 13:17:04.446 [nt.ItemStatePredictedEvent] - thermostat03_setpoint predicted to become 24 °C
2020-02-20 13:17:04.455 [vent.ItemStateChangedEvent] - thermostat03_setpoint changed from 25.0 °C to 24 °C
However, this topic was really send (captured with MQTT.fx):
Is this a bug in the binding or is my configuration wrong?