How to change entity color in an Entity filter card?

Hi,
I have an Entity Filter card set to list some entities if they fail (ping/backup checks) and I would like to make them appear in red text/icon when they do, but have no idea if possible or how.

card:

type: entity-filter
show_empty: false
entities:
 ... list of entities here cut for brevity
state_filter:
  - 'off'
card:
  type: entities

example here, if the borgmatic entity was in red it’d be more visible.
image

So the card is usually invisible and if one of the switches goes off it appears, but it’s in normal theme colors and I wouuld like it to stand out more so I can see something’s up (well down :stuck_out_tongue:) at a glance.

Thanks for any suggestions!

Look at card-mod. You can use this to change the icon colour and text. There are loads of examples on their forum page.

1 Like

I was hoping for a different way, perhaps with a template (which I suck at). Whenever I use card-mod it’s sluggish specially on android.

Must’ve been some changes in either ha / ha android app or card_mod, but bottom line is I tried it again and it no longer lags my ui.

Glad it’s working, card_mod is great for a lot of things. Another to achieve what you wanted is just to put those theme settings you want to override in another theme and then select that theme in the entities card. It’s especially useful if you want to do the same thing in a number of places.

1 Like

So I added the card mod thing in my cards (according to the instructions for the cards without ha-card element), and assumed it’s just gonna work, but as I just noticed it still doesn’t. Am I using it right?

type: custom:mod-card
card:
  type: entity-filter
  show_empty: false
  entities:
    - binary_sensor.uptimekuma_homeassistant
    - etc etc
  state_filter:
    - 'off'
  card:
    type: entities
card_mod:
  style: |
    ha-card {
      color: red;
    }

Still comes up as white text.
image

I have reloaded/restarted HA, cleared browser cache, confirmed the card-mod line is in configuration.yaml frontend: section

The entity-filter card is providing a list of entities to the entities card. The entities card is displaying them. I’d try applying card-mod, as normal, to the entities card definition and dropping mod-card altogether.

2 Likes

that did it thanks!

type: entity-filter
show_empty: false
entities:
  - binary_sensor.uptimekuma_homeassistant
  - ...
state_filter:
  - 'off'
card:
  type: entities
  card_mod:
    style: |
      ha-card {
        color: red;
      }

1 Like