Hi!
Ich hab hier eine Picture Elements Karte mit einigen Labels und Icons drauf.
Das funktioniert bestens, allerdings gelingt es mir nicht, die Iconfarbe anhand eines Entitätszustands einzufärben.
Sollte zB grün sein, wenn der betreffende Status den Wert “0” hat und weiß, wenn nicht.
- type: icon
title: Automatisch
icon: mdi:refresh-auto
entity: button.automower_auto
tap_action:
action: perform-action
confirmation:
text: Automatik Modus starten?
perform_action: button.press
target:
entity_id: button.automower_auto
data: {}
style:
left: 0px
bottom: 0
padding: 10px
font-size: 20px
line-height: 20px
color: |
{% if is_state("sensor.automower_mower_mode", "0") %}
green
{% else %}
white
{% endif %}
transform: translate(0%,0%)
Wenn ich bei “color” einen Wert als string eintrage, zB “orange”, dann passt das auch, aber abhängig von einem Status mag er nicht.
Kann diese Karte das nicht oder ist mein Code grundsätzlich falsch?
Vielen Dank!
