MQTT item with UoM does sends old value to topic?

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" {
    Type number: setpoint "Zieltemperatur"[stateTopic="zwave/DevoloThermostat03/thermostat_setpoint/heating_1",
                                           min=10, max=28, step=1]

And the corresponding item with the Temperature unit.

            thermostat03_setpoint   "Zieltemperatur [%.1f %unit%]"

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):
2020-02-20 13_20_12-MQTT.fx - 1.7.1

Is this a bug in the binding or is my configuration wrong?

The MQTT binding doesn’t support UoM. As you’ve seen, it seems to work OH for subscriptions. But it won’t work for publishing, though I’ve never seen it publish the old value. Usually I just get an error. I think there is an issue open to add this support, but it apparently isn’t a simple add.

You’ll either need to remove the UoM and use a proxy Item if you need an Item with UoM.