Like said…
This Item
Number:Time bsP1Age "Alter" ["Duration"] {channel="mqtt:topic:mymqtt:bs444:age", unit="y"}
leads to this warning:
[WARN ] [penhab.core.library.items.NumberItem] - Unit 'y' could not be parsed to a known unit. Keeping old unit 's' for item 'bsP1Age'.
all other time units are accepted (s, min, d and week).
The corresponding channel doesn’t complain about the ‘y’ unit.
This issue existed since openHAB3 (always forgot to complain about…)
rlkoshak
(Rich Koshak)
December 25, 2023, 8:52pm
3
This might need an issue. The docs clearly state ‘y’ for years. Maybe try ‘Y’? one way or the other an issue will need to be filed, either because the docs are wrong or g the unit isn’t working.
I suspect it’s not often that anyone has a need to react time in years in a home automation context so you might be the first to try to use this unit.
1 Like
Done
opened 09:31PM - 25 Dec 23 UTC
bug
## Expected Behavior
If setting up an Item of type `Number:Time`, it should be … possible to use `y` as unit.
```
Number:Time bsP1Age "Alter" (gScale) ["Duration"] {channel="mqtt:topic:mosquitto:bs444:age", unit="y"}
```
should result in an Item state with years and fractions of years, e.g. `50 y` or `50.83 y`
## Current Behavior
when defining the Item as above, this results in a warning:
```
[WARN ] [penhab.core.library.items.NumberItem] - Unit 'y' could not be parsed to a known unit. Keeping old unit 's' for item 'bsP1Age'.
```
## Environment
* Version used: openHAB4.1.0 (but also true for older versions)
* Operating System and version: debian bookworm (amd64 in proxmox lxc)
Interestingly, the corresponding channel is also of type number with unit `y` and openHAB does not complain about (but the value isn't calculated correctly from `y` to `s`)
```
Type number : age "Alter" [ stateTopic="bs444/udo/", transformationPattern="JSONPATH:$.age", unit="y" ]
```
All other units (`s`, `min`, `d`, `h`, `week`) seem to work as intended.
And yes, I did test with Y
, y
and year
1 Like