fnu
(Frank)
July 25, 2023, 5:59pm
1
Found a another little issue after being updated to OH4 with the output of humidity of openweathermap:
Output is rounded to 1, as the raw value given in that channel is actually “0,84” and unit is “one”, not “%”.
Within OH3 I would have seen 84 % in paperui, channel definition remained the same:
Number:Dimensionless localCurrentHumidity "Aktuelle Luftfeuchtigkeit [%d %unit%]" { channel="openweathermap:onecall:api:local:current#humidity" }
Following description in bindings documentation:
So, pretty obvious something changed, but what?
I can modify output and unit, but is that wanted?
Lolodomo
(Lolodomo)
July 25, 2023, 6:15pm
2
Yes, you have to update your item definition to set unit=%.
Please read UoM stuff associated with the release notes.
1 Like
Lolodomo
(Lolodomo)
July 25, 2023, 6:21pm
3
You can even find an example for Number:Dimensionless!
fnu
(Frank)
July 25, 2023, 6:39pm
4
Ok, understand, so basically add unit definition to channel:
Number:Dimensionless localCurrentHumidity "Aktuelle Luftfeuchtigkeit [%d %unit%]" { unit="%", channel="openweathermap:onecall:api:local:current#humidity" }
Just for my understanding, why didn’t it change on temperatur?
This is the temperatur channel of above given screenshot, w/o unit definition:
Number:Temperature localCurrentTemperature "Aktuelle Temperatur [%.1f %unit%]" { channel="openweathermap:onecall:api:local:current#temperature" }
Lolodomo
(Lolodomo)
July 25, 2023, 6:49pm
5
Default unit for Number:Temperature is °C in metrics measure system which is certainly matching your need.
fnu
(Frank)
July 26, 2023, 9:26am
6
Ok, so here comes the new option in runtime.cfg in function?
org.openhab.i18n:measurementSystem=[SI|US]
If set to “US” temperature will become “°F” automatically?
And if I would like to see “°F” instead of “°C”, even generic defined to “SI=metric”, I could define “unit=F” in temperature channels?
Lolodomo
(Lolodomo)
July 26, 2023, 10:37am
7
That’s why it is preferable (but not mandatory) to define the (internal) unit, to be sure it will be “blocked” whatever could happen.
I did not do it myself when the default unit matches my need. But that is not the recommendation.