Hello,
have an ‘issue’ with template sensor, i’d like to make my sensor colorized like a switch power on
i’d like to have my sensor ‘on’ on 2 day only : Lundi & Jeudi
- platform: template
sensors:
jour_poubelles:
friendly_name: "jour_poubelles"
value_template: " {{ is_state('sensor.current_day', 'Jeudi') or is_state('sensor.current_day', 'Jeudi') }} "
icon_template: >-
{% if is_state("sensor.current_day", "Lundi") %}
mdi:delete
{% elif is_state("sensor.current_day", "Jeudi") %}
mdi:recycle
{% else %}
mdi:delete-off-outline
{% endif %}
my current_day sensor is :
- platform: template
sensors:
current_day:
value_template: " {{ ['Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi','Dimanche'] [now().weekday()] }} "
friendly_name: "current_day"
someone can help me ? thanks