i have a Problem with the JS Transformation. I like to show my windspeed in km/h in my basic UI. I get it to show the value, but if i add km/h in the definition, it shows “NaN”.
Thing Definition
Type number : Windspeed "Windgeschwindigkeit" [ga="9.005:<6/1/149"]
Item Definition
Number Windgeschwindigkeit "Windgeschwindigkeit [%.2f m/s]" <wind> (Weather) {channel="knx:device:bridge:wetterstation:Windspeed", autoupdate="false" }
A state transformation used in a label always returns a string.
You cannot format a string with %.2f even if it looks like "2.35’, it is not a float.
Try [JS(windspeed.js):%s km/h]