Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95397

Template sensor color

$
0
0

@buntix wrote:

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 :slight_smile:

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95397

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>