I have a problem and I cannot found solutions in old posts.
I have a sitemaps with humidity. After upgrade to Openhab 4 I had “Err” on display sitemaps and after that I’ve updated all items with Number:Dimensionless and Point: Humidity.
Your solution to @AnDuR’s problem is correct, but this part of the explanation isn’t quite right.
If set on the MQTT Channel, the unit is forwarded to the Item. However, if the unit metadata is not set on the Item, the system default unit is used for the Item’s state. And the system default for Number:Dimensionless is ONE, not %.
Therefore, if you’ve configured % in the MQTT Channel, that 27 % gets converted to 0.27 ONE as the Item’s state. The state description will convert that 0.27 ONE back to 27 % when it shows you the Item’s state in MainUI, but the Item’s state, and therefore what gets saved to persistence and charted, will still be 0.27.
Note that this is true for all units and all bindings. If the unit sent by the Channel doesn’t match the unit of the Item, the value gets converted to the unit of the Item. If there isn’t unit metadata explicitly set on the Item, the system default for that unit type is used.