My question is whether it is possible to apply Units of Measurement to the min, max and step parameters of state. So for example for a thermostat target temperature one might define it as follows…
Hi @rossgb many thanks for the response. I guess the answer “no” is clear. However I wonder if it should be added to the “to-do” list, perhaps for OH v3?
It’s not a definitive “no”. I don’t have a deep knowledge of the openHAB core, I just did a quick search of the code. There may be another mechanism that you can use to set bounds on a channel-type.
When it comes to UoM it’s probably easiest to just leave the min,max,step stuff to the sitemap/HABPanel level and either do sanity checks in your ThingHandler or let the device/service you are binding do the validation.
@rossgb yup, that’s what I (my users) have to do now; but it certainly would be good (IMHO) if the developer could provide default values (e.g. min/max/step values in Celsius, and also in Fahrenheit) so the user does not have to think too much about it…
There is an older issue in ESH repository where a brief discussion was going on about this feature. It tells you something about the issues implementing it and a draft of how it may be designed. I think adding this to the OH3 roadmap is a good idea. It is a nice feature.