OpenHAB: How To Transform m/s into km/h

This how to helps you to transform wind values of m/s into km/h with OpenHAB. It provides an example of a rule as well as the maths behind. This might be helpful for any sort of mathematical transformation that you like to do with your weather and wind data.

OpenHAB: How To Transform m/s into km/h

OpenHAB: How To Transform m/s into km/h

Index Of OpenHAB: How To Transform m/s into km/h

Background of OpenHAB: How To Transform m/s into km/h

I have a weather station that measures the wind speed in meters per second (m/s). This however is very difficult to understand, as generally we are far more used to km/h. Therefore, I was wondering how this can be calculated into km/h. After some research in the internet, I found a way that works quite well for me. It might be useful for you too.

My Enviornement:

  • Raspberry Pi 4
  • OpenHAB 4
  • KNX
  • MDT Weather Station 

OpenHAB: How To Transform m/s into km/h

First of all we need to create the necessary items in the .items file. In my case the items looks like this:

Number Weatherstation_Wind_Speed                            "Current Wind [%.1f m/s]"                                <wind>                  (All, gWetter, gSQLAllChanges)          { channel="knx:device:bridge:MDT_1_1_3:MDT_1_1_3_Wind" }
Number Windspeed_kmh                                         "Current Wind [%.1f m/s]"                               <wind>                  (All, gWetter, gSQLAllChanges)

After I have done this, I have created a rule which basically calculates the wind in km/h. For this it is important to know that transforming from m/s into km/h there is the factor 3.6 to be used.

m/s multiplied by 3.6 = km/h 

This is the rule I have created and that works very well for me:

rule "Calculate Wind in km/h"
when
    Item Weatherstation_Wind_Speed changed
then
    logInfo("Weatherstation_kmh.rules", "Rule execution started. Reason: Changed Item to Value of Weatherstation_Wind_Speed {}", Weatherstation_Wind_Speed.state) 
    Windspeed_kmh.sendCommand((Weatherstation_Wind_Speed.state as Number) * 3.6)
end

Additional Information

OpenHAB is a fantastic free open source software framework that allows you to do amazing stuff with your home and beyond! To find out how to install OpenHAB (which is very simple) check out the How To Setup a New OpenHAB.

Transform Meter per Seconds (m/s) into Miles per Hour (mph)

There is an additional How to that helps you to transform from m/s into mph. Please check out this great how to: OpenHAB: How To Transform m/s into miles per hour (mph)

Find out more about the great OpenHAB project

To find out more about the great OpenHAB project, check out the official project Website.

Follow me

It would be amazing if you follow my myhowto.blog. To my blog is actually easy! You can leverage on

  • Click to follow me on Twitter
  • Bookmark this page and comeback from time to time

Help and Comments

I am really looking forward for you to contact me if for example you found a better option or other idea then in this how to. Also, please touch base if you found an error or anything not working or if you have something that you would love to be added to the myhowto.blog. Simply click this link to touch base with me.

Linking Or Recommending The How To Or The myhowto.blog

I would love to see you are recommending this how to or link it to your website. Also, I would love if you link or recommend the whole myhowto.blog. Please feel free to do so! In case you like to touch base regarding this topic with me, then simply click this link. I look forward!