Good morning,
I’m sorry but I’m a noob in coding and so, obviously, I have a big problem in yaml syntax.
I’m trying to create a sensor in configuration.yaml with if-then but I don’t find the way for right code; this is my last version and Home Assistant tells that is wrong :
template:
- sensor:
- name: "Vel VMC cucina nonna def"
unique_id: b7bbe7fe-a39f-4e7e-ae0f-015a12a4d5dd
state: >
{% if is_state('binary_sensor.clima_cucina_nonna_a4s_input1', 'on') %}
0
{% else %}
{% if is_state('binary_sensor.clima_cucina_nonna_a4s_input2', 'on') %}
0
{% else %}
{{ states('sensor.vel_vmc_cucina_nonna) | int }}
{% endif %}
{% endif}
Can someone help me in this my stupid lack ?
Thanks in advance for your reply
3 posts - 3 participants