Hi, I am trying something that at first would seem very simple which is in a picture element in which I have a state-icon to change the color depending on the state. This value is a text string. I have tried multiple options (color, --paper-item-icon-color’, ‘–paper-item-icon-active-color’…) but I can’t find the code that works. My last attempt has been this one but nothing.
- type: state-icon
entity: sensor.itag_area
icon: mdi:clock
style:
top: 67%
left: 75%
"--mdc-icon-size": 30px
"--paper-item-icon-color": |-
{% if is_state("sensor.itag_area", "Salon") %}
green
{% else %}
red
{% endif %}
"--paper-item-icon-active": |-
{% if is_state("sensor.itag_area", "Salon") %}
red
{% else %}
green
{% endif %}
How would I have to code it so that in function of the value of the state of an entity the color of the state-icon changes?
Regards