I’m running openhab2.4 on a raspberry PI and am gradually migrating from openhab1. I’ve just added the MQTT 2.4 binding and I’m getting a very strange formatting error.
I have an MQTT sensor that is reporting humidity as a floating point number. The MQTT messages are being sent correctly and are being received by the openhab2.4 MQTT binding. The event log indicates that the humidity item is being correctly updated and the chart of the item looks good.
The one niggling thing that is wrong is that in the classic UI, the basic UI and the android app the value is being multiplied by 100, so for example an RH value of 57.375 % is being reported on screen as 5737.5 %. I’m using a formatting string of [%.1f %%] in the item description. It’s exactly the same formatting string as I’m using for another (one-wire) sensor item, which is displaying correctly.
I emphasise that the value is correct, it’s just being displayed wrongly. The item is defined as a dimensionless number of type Humidity and has been set up using paperUI.
This is probably something really silly, but I can’t work out what.
2019-01-11 11:22:22.713 [vent.ItemStateChangedEvent] - LoftHumidity changed from 63.3125 to 63.0
2019-01-11 11:22:53.309 [vent.ItemStateChangedEvent] - LoftHumidity changed from 63.0 to 63.3125
2019-01-11 11:23:54.345 [vent.ItemStateChangedEvent] - LoftHumidity changed from 63.3125 to 63.625
That’s a good question. It might be possible to fetch the Item via REST and compare details. It’s possible PaperUI is messing with % symbols or something.
I was having this same issue with OpenHAB 2.5. I found that if I leave the Dimension value blank in the Item properties the formatting works correctly in the sitemap when using the traditional syntax.
Text item=NWSCurrentRelativeHumidity label=“NWS Humidity [%.1f %%]”