I have a weather station with inputs N,E,S,W, and windspeed, when the speed = 0 I want below sensor in configuration.yaml to display NO-WIND and display other options if there is.
What am I doing wrong in the code ? line {% if (‘sensor.velocita_del_vento’) == 0 %}
Below is the pulse_counter for the windspeed
Thank you found a solution to my code, now when wind is low there is no point to wind direction as its unstable at low or no wind and not true in direction.
sensor:
- platform: template
sensors:
direzione_vento:
friendly_name: Wind direction
value_template: >-
{% if is_state('sensor.velocita_del_vento','0.00') %}
LOW-WIND
{% elif states('binary_sensor.vento_direzione_ovest') == 'on' and states('binary_sensor.vento_direzione_nord') == 'on' %}
NORTH-WEST
{% elif states('binary_sensor.vento_direzione_est') == 'on' and states('binary_sensor.vento_direzione_nord') == 'on' %}
NORTH-EAST
{% elif states('binary_sensor.vento_direzione_ovest') == 'on' and states('binary_sensor.vento_direzione_sud') == 'on' %}
SOUTH-WEST
{% elif states('binary_sensor.vento_direzione_est') == 'on' and states('binary_sensor.vento_direzione_sud') == 'on' %}
SOUTH-EAST
{% elif states('binary_sensor.vento_direzione_nord') == 'on' %}
NORTH
{% elif states('binary_sensor.vento_direzione_est') == 'on' %}
EAST
{% elif states('binary_sensor.vento_direzione_sud') == 'on' %}
SOUTH
{% elif states('binary_sensor.vento_direzione_ovest') == 'on' %}
WEST
{% endif %}