Zucco1990
(Zucco1990)
1
What’s wrong with mi code in this card?
type: custom:button-card
entity: sensor.finestra_cucina
name: Cucina
show_state: true
template: null
style: |
:host {
-paper-item-icon-color:
{% if is_state(sensor.finestra_cucina, "OFF") %}
blue
{% endif %}
{% if is_state(sensor.finestra_cucina, "ON") %}
red
{% endif %}
{% if is_state(sensor.finestra_cucina, "vasistas") %}
green
{% endif %}
;
}
koying
(Chris B)
2
You don’t tell what are the symptoms.
It’s like asking your doctor: “What’s wrong with me”
1 Like
Zucco1990
(Zucco1990)
3
Sorry, you are right.
The icon remains white in any state
What am I doing wrong?
koying
(Chris B)
4
You actually do not need card-mod for the button card
See, e.g., Custom: button-card - change icon based on state - #20 by mmillner
If you want to follow the card-mod route, see the button card note regarding which variables are used for the icon color.