Get Dark Sky to display km/h for wind speed?

Hello all! Pretty new here and to Home Assistant in general. Recently, I have been interested in getting the weather integrated into my HA setup. I am using the Dark Sky plugin, and so far it seems good. I did have one problem though. I want to change the default unit of measurement from m/s to km/h. I see no documentation of this, and I tried to change it in the “customization” section of HA, but to no avail. Any suggestions would be appreciated.

Thanks!

You might want to create a template sensor and change the value for the conversion. Something like

    value_template: {{ states.sensor.dark_sky_daily_wind_speed.state | float * 0.0010) | round(2) }}
1 Like

Thanks! That really helped. I am still having one problem however. This is what I got:

- platform: template
sensors:
  darksky_wind_speed_km_h:
    friendly_name: "Wind Speed km/h"
    unit_of_measurement: 'km/h'
    value_template: '{{ states.sensor.dark_sky_wind_speed.state | float * 18 / 5 | round(2) }}'

Basically I want the number rounded to 2 decimal places. However, the rounding part is not working at all. Any ideas?

Thanks!

Try this (multiple by 100, make an integer, then divide by 100)

'{{ ((states.sensor.dark_sky_wind_speed.state | float) * 100 | int ) * 18 / 5 / 100 }}'

1 Like

Nope. Still shows the speed currently as 7.812. :frowning:

@PolarHacker This should work… first do your calculations in brackets then round afterwards.

'{{ ((states.sensor.dark_sky_wind_speed.state | float) * 18 / 5 | int) | round(2) }}'

1 Like

Hmmm. Still doesn’t work. Not too sure why :face_with_raised_eyebrow:

I got this to work

{{ (2.77 | float * 18 / 5 * 100 ) | int / 100 }}

1 Like

Success! It worked! Thank you so very much! :slight_smile:

value_template: '{{ (states.sensor.dark_sky_wind_speed.state | float * 18 / 5 * 100 )  | int / 100 }}'

You can use the Option Units:ca

  • platform: darksky
    api_key: xxx
    update_interval: 1800
    units: ca
    monitored_conditions:
4 Likes

This totally worked for me. Fast and easy! Thanks!