Alert card

Hey folks, looking for one possibly two lovelace cards. Creating a server dashboard containing critical information that I can reference at a glance, and know what needs attention without digging.

  • An entities style card that can change the icon color, or card background based on a configurable value of the state. For instance, if the state is ‘normal’ set the icon color to green, otherwise set the icon color to red.
  • Also an entity style card that can compare 2 entity states, if they match set the icon color to green, otherwise set the color to red. Think of a docker stack, if you’re expecting 10, but 9 are running, I’d like an easy way to tell, visually.

I’ve been using the lovelace mushroom cards and really like the style of them, and the mushroom entity card has the ability to set the icon color, but changing the color based on state doesn’t seem to be configurable. I’m aware that I can do this with an automation, and a binary sensor, I’d rather not take this route if possible due to the number of entities I’d like to monitor.

I’m also aware I could do this with card-mod, though I’m not entirely sure how, or if that would just become a headache.

Any advice would be appreciated! Thanks.

Perhaps mushroom template card can help you? You can configure everything based on multiple criteria.

this is a bit of an old thread, but in case the op hasn’t figured it out or someone else runs across this question, it can be done pretty easily with card-mod. here’s an example for the entities card:

type: entities
entities:
  - input_boolean.testbool2
card_mod:
  style: |
    ha-card {
      {% if (states('input_boolean.testbool2') == 'off') %}
        color: red;
        --card-mod-icon-color: red
      {% else %}
        color: green;
        --card-mod-icon-color: green
      {% endif %}
    }

As @armedad pointed out, this thread is a bit old and the entity card can also return css styles based on multiple criteria via card-mod.

Mushroom template is a bit easier, but I have found most cards can be manipulated.