Change of entity icon color in heading card

Hello,

Does anybody know how to adapt this code so that the color of the icon changes? (See picture)

type: heading
heading_style: title
icon: mdi:stairs
badges:
  - type: entity
    entity: sensor.ikea_bewegungsmelder_illuminance
heading: Flur
card_mod:
  style: |
    :host {
     {% if states(config.entity) | int > 10 %}
      --card-mod-icon-color: rgb(233, 176, 6);  /* Dunkelgelb (DarkGoldenRod) */
     {% else %}
      --card-mod-icon-color: rgb(136, 136, 136);
     {% endif %}
    }

main card-mod thread → 1st post → “fantastic” link at the bottom → heading

Many thanks, great!

Uhm, cant find this link now, any hints?

No worries, I figured it out!

card_mod:
  style: 
    hui-entity-heading-badge $: |
      ha-state-icon {
        --mdc-icon-size: 32px;
      }

If you simply use search with a sort of most viewed, it’s the second thread listed.

Card Mod Main Thread

cross posted reply

1 Like