Wind speed. km/h to m/s

How to change the wind speed display from km/h to m/s.
I use the card on the home screen.
I use OpenWeatherMap

1 Like

Will need a little more information pls @Kllraz - what card / weather information source are you using? Some have ability to select via config, others you can create sensors to help you translate.

@Markus99, I use OpenWeatherMap

Hmm, haven’t used that before. I personally use DarkSky, which does allow you to specify units of measurement. https://www.home-assistant.io/integrations/weather.darksky/

If you want / need to stick w/ OpenWeatherMap and want to convert, here’s an example I use from my Volvo integration. It defaults to metric units and I (being in the US), prefer imperial.

I created a few sensors to translate from KM to MILES, here’s one that grabs the integration created sensor.xc90_odometer and converts from KM to MILES - perhaps you could use as a template for your needs

    xc90_odometer_mil:
      unit_of_measurement: mi
      friendly_name: "XC90 Odometer"
      icon_template: mdi:speedometer
      value_template: >
        {{ (states('sensor.xc90_odometer')|float/1.60934)|round(0) }}

Using this in Developer Tools -> Template:

Original KM: {{ states('sensor.xc90_odometer') }}
Converted to Miles: {{ (states('sensor.xc90_odometer')|float/1.60934)|round(0) }}

Gives me this result:
image

@Markus99, I installed Dark Sky. But I still can’t set the units for wind, like m/s, and for pressure, like mmHg

Unfortunately I’m not overly familiar with the intricacies of that integration. Honestly best to read thru this link (https://www.home-assistant.io/integrations/weather.darksky/) for how to set it up and then Google / search this forum for more specifics…

Hi Mark,

I’m trying to do something similar with the range remaining on my ID3. Your code makes perfect sense, but as a Home Assistant newbie, I have no idea where to put it? Can you tell me where to add this please?

Many thanks
Barry

Template sensor: Template - Home Assistant

Thank you, all sorted. :slight_smile:

1 Like