#Tile card background colour

1 messages · Page 1 of 1 (latest)

trim schooner
#

I'd really like to make the tie card for my fridge temperature have a red background if the temp is > 4 degrees. I suspect it's not possible without some hacking?
I would even consider having a card that ALWAYS has a red background and I'll just conditionally show the card?

idle fern
#

I think any way you go is going to involve some "hacking." (Almost) any time someone wants to deviate from what the Devs have already programmed, using something like card_mod or a custom card is used. Card_mod is certainly an option: ```yaml
type: tile
entity: sensor.refrigerator_temperature
name: Refrigerator
vertical: true
card_mod:
style: |
ha-card {
--card-mod-icon-color: white;
{% if states("sensor.refrigerator_temperature") | int >= 40 -%}
background-color: red;
border-color: white;
{% else %}
background-color: blue;
{%- endif %}
}