AndrewFG
(Andrew Fiddian-Green)
October 26, 2024, 6:12pm
1
In Thing / Channel description XML there is a state element which has min and max attributes. And AFAIK the values (decimal) do not (cannot) have a UOM. So if a channel is of type (say) Number:Temperature then how does one specify if min/max mean values in Celsius, Fahrenheit, or Kelvin?
<state min="decimal" max="decimal" step="decimal" pattern="String" readOnly="{true|false}">
boehan
(Hans Böhm)
October 26, 2024, 7:09pm
2
For reference, this was also partially discussed here:
openhab:main
← ccutrer:convert-bounds-in-state-descriptions
If I understand this correctly, bounds (and step) use the unit of the state patt… ern if set. However, this would probably have no effect, if the pattern is set to `%unit%`. Thus, binding developers would have to predefine to be able to set correct bounds, which does not allow the default state description to follow system default units (I assume bounds always use unit of pattern set by the binding).
Wouldn't it be clearer, if bounds (and step) could be set with appropriate unit (which could even differ from the one set in the pattern)? And potentially use the approach proposed here as a fallback if no dedicated unit is set?
1 Like