Hi,
Denke du willst sowas ? (RGBA Farben gehen auch)
card_mod:
style: |
ha-card {
{% if states(config.entity) | float > 60 %}
--tile-color: green !important;
{% else %}
--tile-color: red !important;
{% endif %}
}
Weitere Kachel Style Codes
ich hoffe ich habe damit einige Fragen abgedeckt?
Shape Färben:
card_mod:
style:
.icon-container .icon$: |
.shape {
{% if is_state(config.entity, 'on') %}
background: rgba(0,255,0,0.15) !important;
{% else %}
background: rgba(255,0,0,0.15) !important;
{% endif %}
}
Icon Färben ON/OFF:
card_mod:
style: |
.icon {
{% if is_state(config.entity, 'on') %}
--tile-color: green !important;
{% else %}
--tile-color: grey !important;
{% endif %}
}
Icon Färben Numerisch:
card_mod:
style:
.icon-container .icon$: |
.shape {
{% if states(config.entity) | float > 60 %}
background: rgba(0,255,0,0.15) !important;
{% else %}
background: rgba(255,0,0,0.15) !important;
{% endif %}
}
Icon Färben Numerisch Nr.2 (Alles bis 60 Grün, alles bis 70 Gelb, darüber Rot (als Beispiel):
card_mod:
style: |
ha-card {
{% if states(config.entity) | float > 70 %}
--tile-color: red !important;
{% elif states(config.entity) | float > 60 %}
--tile-color: yellow !important;
{% else %}
--tile-color: green !important;
{% endif %}
}
Icon wechseln & Färben Numerisch:
card_mod:
style: |
ha-card {
{% if states(config.entity) | float > 60 %}
--card-mod-icon: mdi:sofa;
--tile-color: green !important;
{% else %}
--card-mod-icon: mdi:door;
--tile-color: red !important;
{% endif %}
}
Secondary mit 1x Entität:
card_mod:
style:
ha-tile-info$: |
.secondary {
visibility: hidden;
}
.secondary:before {
visibility: visible;
content: '{{ states('sensor.steckdose_power') | round(0) }} W'
}
Secondary mit 2x Entitäten:
card_mod:
style:
ha-tile-info$: |
.secondary {
visibility: hidden;
}
.secondary:before {
visibility: visible;
content: '{{ states('sensor.temperatur') | round(1) }} °C - {{ states('sensor.luftfeuchtigkeit') | round(0) }} %'
}