WeatherUnderground Binding: Getting wind speed as m/s instead of km/h

Dear fellow openHABers,

Here in Sweden we don’t use km/h or even mph for measuring wind speed. We simply use meters per second. Weather Underground only supports km/h alternatively miles/h.

Can this be solved easy?

This is my things file

Number Wu_WindSpeed "Wind Speed [JS(kmh2mps.js):%.1f]" <wind> (G_CurCond, G_Wind) {channel="weatherunderground:weather:local:current#windSpeed"}
Number Wu_WindGust "Wind Gust [JS(kmh2mps.js):%.1f]" <wind> (G_CurCond, G_Wind) {channel="weatherunderground:weather:local:current#windGust"}

And here is my transform script kmh2mps.js

    function round(value, precision) {
        var multiplier = Math.pow(10, precision || 0);
        return Math.round(value * multiplier) / multiplier;
    return round(kmh/3.6, 1);

Now, in the label, I would like to add “m/s” after the float but then “m/s” will be sent to the function as well so it returns “NaN”. I don’t know how to do that.

This is what I tried:

Number Wu_WindSpeed "Wind Speed [JS(kmh2mps.js):%.1f m/s]" <wind> (G_CurCond, G_Wind) {channel="weatherunderground:weather:local:current#windSpeed"}
Number Wu_WindGust "Wind Gust [JS(kmh2mps.js):%.1f m/s]" <wind> (G_CurCond, G_Wind) {channel="weatherunderground:weather:local:current#windGust"}

Actually, most of all I would like to store the wind speed in Wu_WindSpeed expressed as meters per second so I can do calculations later in my rules. That would be better than just recalculate for display purposes.

If someone could help me a bit I’d be really happy. Cheers!

There is a new general feature in development since several months that should let the user choose the display unit for a channel supporting this feature. When this feature will be available, I imagine you should be able to get what you expect.

Thanks @Lolodomo

I’ll wait for that!

Happy new year by the way :grinning: :rocket: :rocket: :rocket:

Hello! Same here in Norway - did you find any solution for showind wind in meter per second?

I’m just waiting for stable version 2.3. Meanwhile I just have a rule that converts the wind speed for me to m/s whenever there is an update and stores that value in an additional item.