Good day Everyone,
I’ve been searching if some one had done this before, and it does look like it, but I can get it work.
I change an icon based on what app is running on my TV, but I would like to change the color with it, but can’t get it to work.
Below is my template currently working, not sure how to proceed to add the Icon color aswell
‘’’
- platform: template
sensors:
tv_state:
friendly_name: TV State
value_template: >-
{{ states(‘sensor.tv_state_app’) }}
icon_template: >-
{% if is_state(‘sensor.tv_state’,‘netflix’) %}
{{ ‘mdi:netflix’ }}
{% elif is_state(‘sensor.tv_state’,‘plex’) %}
{{ ‘mdi:plex’ }}
{% elif is_state(‘sensor.tv_state’,‘youtube’) %}
{{ ‘mdi:youtube’ }}
{% elif is_state(‘sensor.tv_state’,‘amazon’) %}
{{ ‘mdi:emoticon-devil-outline’ }}
{% elif is_state(‘sensor.tv_state’,‘bbciplayer’) %}
{{ ‘mdi:alpha-b-circle-outline’ }}
{% else %}
{{ ‘mdi:television-classic-off’ }}
{% endif %}
‘’’
When I add a new temple it would only use one,either color or the icon,
‘’’
value_template: >-
{{ states(‘sensor.tv_state_app’) }}
icon_color: >-
{% if is_state(‘sensor.tv_state’,‘netflix’) %}
‘red’
{% elif is_state(‘sensor.tv_state’,‘plex’) %}
‘yellow’
{% elif is_state(‘sensor.tv_state’,‘youtube’) %}
‘red’
{% elif is_state(‘sensor.tv_state’,‘amazon’) %}
‘blue’
{% else %}
‘grey’
{% endif %}
‘’’
any guidance would be great.