Number:dimensionless (Percentage)

I have several devices reporting Humidity and BatteryPercent in range 0…100. If I try to define items as number:dimensionless OH seems to assume that values should be in range 0…1. As a consequence I have to use item type number because number:dimensionless displays percentages multiplied by 100.

Shoudn’t number:dimensionless assume range 0…100 instead ?

Have a look at UoM issue after upgrade to OH 4.0.0 M3 with Number:Dimensionless item

1 Like

I did, but I’m still confused: Let me give some examples of my own:

  1. I have one Ecowit gateway and several sensors. I’m using the Fine Offset binding
  • The Gateway has an humidity sensor. If I link it to a number item it produces values in the range 0…100. If I link it to a number:dimensionless item it produces values in the range 0…1. Furthermore, if I define % as state description it is honored. For me this is the correct behaviour
  • The soil moisture sensors also report humidity, but in this case with a slightly different behaviour: the % in state description is never honored, but the values get divided by 100 in number:dimensionless. So I end-up with values in the correct (0…1) range but without % unit
  1. I have several tasmotized devices managed with MQTT. By default Tasmota reports BatteryPercentage and Humidity in the range 0…100. In such cases, if I link the channel to a number:dimensionless item OH presents the percentages multiplied by 100

Looks like the same binding can have different behaviours (Fine Offset) and in the case of Tasmota, how do I divide all values by 100 ? Is there a Tasmota (or OH) parameter to do it automatically ?

The problem is not so much the display of the value. The problem is the use in rules (comparison and calculations).

Even though fractional numbers can be displayed as percentages, percentages are a unit by its own. For example KM is 1000x meters, so percentages are 100x the ratio between two numbers

I really think that number:percentage should be a UoM by its own

I’d suggest looking in Github to see if that was discussed. I’d be surprised if it wasn’t. If not, you could submit a feature request for 4.1.

Done #3661

Edit: It was a configuration error on my side. Now everything is ok.