Trying to use data from a Number:Temperature item and nothing get’s displayed in HabPanel…
yet when I remove the :Temperature from the item type I do get a value but it’s displayed in the wrong unit (Celsius not Fahrenheit)
Is there a way to use the item type of Number:Temperature in HabPanel or do I just use number and use a transform to convert to Fahrenheit?
Okay, so the data comes from a web service and you get what you’re given.
That’s fine, the darksky binding supports UoM and you should use the suggested Number:Temperature type.
If you want to format the state of your Item for display, you can do that by adding a state format section [ ] to your Item label.
“My temperature [%.1f °F]”
would format and auto convert a Number:Temperature state to degrees F, even if it is stored in C or K.
In a sitemap based UI, that is.
In a HABpanel widget, you can choose between displaying raw Item state or using server supplied format - that’s the [ ] stuff.
openHAB deals with the UoM. HABpanel doesn’t need to do anything just for display.
Ask for server formatted data and display it - it’s a non-numeric string, because of course it has units symbol included.
How and where should conversion between units be specified in that scenario? According to this merged issue, there is no support for conversion. An excerpt from that thread:
HABPanel can’t do unit conversions, they’re done by the ESH framework - that’s why the sitemaps will do them, because they can leverage the framework while HABPanel only has access to the state reported by the API. If you want e.g. your temperatures in °F instead of °C by default you have to change the locale in openHAB (with Paper UI) to US English (see Units Of Measurement | openHAB); alternatively you specify the unit you want in an item’s state description (Units Of Measurement | openHAB).
This last option doesn’t seem to work according to @KidSquid.
In the Item’s label [state format] section.
(no use in a sitemap line, obviously)
It is necessary both to ask for the server formatted version in HABpanel and to understand that it is a string.
So far as I can see, they’ve not tried all the needed elements at the same time.