Humidity display issue in Locations card

Hi all. I have a fresh install of 4.1 and I’ve decided to create everything from scratch. I have this weird issue with inconsistent displaying of Humidity measurement.

Humidty value comes from mqtt as integer. When I configure it as a Dimensionless (one) point (with added % to State Description Pattern, I get the results as presented below: value in the bottom part is presented correctly, while the derived value for the location shows 0. Interestingly, at the same time logs show 15:23:09.883 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'iLWYWSSalonHumi' changed from 0.45 to 0.46, with the value off by factor of 100.

When I recreate the point but I select empty dimension, the location tab header gets proper humidity value, but the value for the sensor is then shown without %.

Is that a bug/inconsistency, or expected behavior?

Small update: it started raining, the humidity increased over 50% and now the badge shows 1%. So it reads the value allright, just the internal representation of dimensionless value reduced by factor of 100 seems to be the issue.

You need to set the unit metadata on the Number:Dimensionless Item to %.

The default unit for Dimensionless is ONE which is a simple ratio.

.5 ONE == 50 %

There was an extensive section discussing this in the breaking changes section of the release notes for OH 4.0 for further details.

Solved elsewhere: UoM: number:percentage · Issue #3661 · openhab/openhab-core · GitHub