this is broken in 2025.1.0b Home Assistant card (replacing former bar-card config) - #2 by Mariusthvdb as is this battery card
so the mod is this, and it doesn’t color the background anymore.
- entity: sensor.processor_use
name: Cpu
card_mod: &perc
style: |
hui-generic-entity-row {
background:
{% set perc = states(config.entity)|float(0) %}
/*{% set rest = 100 - perc %}*/
{% if perc >= 59 %} {% set bar = '255,0,0' %}
{% elif perc >= 44 %} {% set bar = '128,0 0' %}
{% elif perc >= 24 %} {% set bar = '255,165,0' %}
{% elif perc >= 9 %} {% set bar = '0,100,0' %}
{% else %} {% set bar = '0,128,0' %}
{% endif %}
/*linear-gradient(to left,ivory {{rest}}%, {{bar}} {{perc}}%);*/
linear-gradient(to right, rgb({{bar}},0.9) 0%, rgb({{bar}},0.6) {{perc}}%,
rgba({{bar}},0.3){{perc}}%, rgba({{bar}},0.1) 100%);
}
setting it in the Inspector works as before…
need to check if this causes the change Update hui-generic-entity-row.ts · home-assistant/frontend@85bd643 · GitHub