Files
zorruno-homeassistant/packages/weather_additional.yaml
2023-10-20 13:27:48 +13:00

9 lines
353 B
YAML

sensor:
- platform: template
sensors:
weewx_wind_bearing_template:
value_template: >
{% set direction = ['N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW','N'] %}
{% set degree = states('sensor.weewx_wind_direction')|float %}
{{ direction[((degree+11.25)/22.5)|int] }}