Closed langestefan closed 7 months ago
Probably you should add data_period
option:
data_period:
hours_to_show: 24
It is not marked in Docs as required (which seems to be an error):
I will investigate and fix. Thanks.
Hi @langestefan. If you create a new card, you'll get the default template.
Just add your wind_speed_entity
and your wind_direction_entity
. Make sure the values are state values, not attributes. Check that under Developer Tools -> States in Home Assistant. You'll need to create a template sensor if the ones you already have use attributes (see below).
Then make sure your direction_unit
is ok (letters
or degrees
). Also check cardinal_direction_letters
if you use letters.
type: custom:windrose-card
title: Wind direction
data_period:
hours_to_show: 4
max_width: 400
refresh_interval: 300
windspeed_bar_location: bottom
windspeed_bar_full: true
wind_direction_entity:
entity: 'sensor.wind_direction'
direction_unit: degrees
use_statistics: false
direction_compensation: 0
windspeed_entities:
- entity: 'sensor.wind_speed'
name: ''
speed_unit: auto
use_statistics: false
output_speed_unit: mps
speed_range_beaufort: true
windrose_draw_north_offset: 0
cardinal_direction_letters: NESW
matching_strategy: direction-first
center_calm_percentage: true
You should then at least get a basic windrose.
To create a template sensor for a sensor using attributes, add the following in you configuration.yaml file.
Under
template:
- sensor:
Add the wind speed sensor (modify it to fit your setup)
- name: Wind Speed
device_class: wind_speed
state_class: measurement
unit_of_measurement: "km/h"
state: >
{% if state_attr("sensor.weather_station", "wind_speed_last") != None %}
{{ state_attr("sensor.weather_station", "wind_speed_last")|float }}
{% else %} {% endif %}
availability: '{{ state_attr("sensor.weather_station", "wind_speed_last")|is_number }}'
icon: mdi:tailwind
Then add either one of these two for the wind direction sensor :
- name: Wind Direction
state: >
{% if state_attr("sensor.weather_station", "wind_dir_last") != None %}
{{ state_attr("sensor.weather_station", "wind_dir_last") }}
{% else %} {% endif %}
availability: '{{ state_attr("sensor.weather_station", "wind_dir_last")|is_number }}'
icon: mdi:compass-rose
- name: Wind Direction
state: >
{% if state_attr("sensor.weather_station", "wind_dir_last") != None %}
{% set direction = ['N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW','N'] %}
{% set degree = state_attr("sensor.weather_station", "wind_dir_last")|float %}
{{ direction[((degree+11.25)/22.5)|int] }}
{% else %} {% endif %}
availability: '{{ state_attr("sensor.weather_station", "wind_dir_last")|is_number }}'
icon: mdi:compass-rose
You should also and a unique_id:
to each one.
Probably you should add
data_period
option:data_period: hours_to_show: 24
It is not marked in Docs as required (which seems to be an error):
yes correct, that was the problem. It's also not in the examples.
Hi @langestefan. If you create a new card, you'll get the default template.
Yes, I know. I'm just talking about the examples in the docs specifically.
none of this seems to be working. i keep getting Error: Unknown speed unit: auto
. why isnt there a basic example config?
@ljmerza Then post a code made from an example from the Repo which is not working. Just add this as it was suggested above.
Hi. I fixed the readme. The examples should work now.
Sorry for the slow response.
Hello, can you please provide a complete, working example on how to configure this card in YAML? None of the examples in the docs currently work out of the box.