- Platform information:
- Hardware: x64
- OS: Debian 11
- Java Runtime Environment:
- openHAB version: 3.1.0
- Issue of the topic: struggling to get temperture conversion to work using transformation pattern
I have a temperature sensor publishing data to a MQTT broker. The sensor measures in °C. I get the sensor data into OH using an MQTT binding and in my Thing/channel I set units of measurement as °C. I have changed my region to try both SI and Imperial but nothing changes.
The problem is that I would like to display my temperture on the site map as °F. I know how to do this with a JS sript (profiles) but I was under the impression that I could instead use a transformation pattern in my item. In the UI and editing my item, I add “stateDescription” metadata and in the pattern field “%.1f °F”. When I hit save, I will briefly (1 measurement) see my data get transformed to °F (correct number and format) but then the value goes back to the °C value (raw Celsius value, but correct number format).
Is it possible to do a temperature conversion at the item through stateDescription?
Can I do a temperature conversion at the channel using “Incoming Value Transformation”?