I have configured the openweathermap add-on to get the current wind speed. As a result I get a value which seems to be in m/s. I’d prefer to get in km/h but I cannot find any way of doing that.
Question 1:
Is there a configuration to retrieve the speed as km/h?
Question 2:
I found a very similar issue in OH1 :
Should the default value not be in km/h also in OH2 openweathermap add-on?
As I want to reuse the existing “WindSpeed_LYO” item (previously used with the Weather binding) I’m not interested in any solution that only change the displayed value.
You are already using a Unit of Measure by defining the Item as Number:Speed. So you just need to put the units in your label to display it properly. In your Rule you need to just supply the units you want.
val kmh = WindSpeed_LYO.state|km/h
You might need to cast it to a QuantityType first.
val kmh = (WindSpeed_LYO.state as QuantityType<Speed>)|km/h
If you need to actually have the Item state be km/h without using Units of Measure to convert between units, you need to create a proxy Item and a Rule to post the km/h value to the Proxy Item.