Does anybody know how to change the color of an entity from an entities card based on the value of the entity?
I have like these entities:
- type: entities
entities:
- entity: binary_sensor.unraidsrv1_lan
- entity: binary_sensor.reverseproxysrv1_lan
and i want to color the text or icon based on the states (on, off).
This does not work:
- type: entities
entities:
- entity: binary_sensor.unraidsrv1_lan
style: >
:host {
color: {% if is_state('binary_sensor.unraidsrv1_lan', 'off') %}
red {% endif %};
}
Is the “if” statement correct? Is the state correct (the values come from a ping adapter and i want to see if the specific device is up)