I would like to make a change, it is to be able to put the icon of the door in green when it is closed and put in red when the door is open. I can’t add in my sensor configure in > sensor.yaml <
Can you help me?
platform: template
sensors:
porte_salle_a_manger:
friendly_name: Porte Salle à Manger
value_template: >
{% if is_state(‘sensor.aeotec_zwave_porte_salle_a_manger_access_control’, ‘23’) %}
Off
{% elif is_state(‘sensor.aeotec_zwave_porte_salle_a_manger_access_control’, ‘22’) %}
On
{% else %}
Off
{% endif %}
icon_template: >
{% if is_state(‘sensor.aeotec_zwave_porte_salon_access_control’, ‘23’) %}
mdi:door
{% elif is_state(‘sensor.aeotec_zwave_porte_salon_access_control’, ‘22’) %}
mdi:door-open
{% else %}
mdi:door
{% endif %}