Auto-Entities Card: color icon based on state

Hi.
Lovelace Auto Entities seems to provide an option to color icons based on entity state.

state_color: true

In my case, potential states are: too_high, perfect, too_low

How do I define colors for each state? Anyone knows the syntax? I can`t find anything about it in the documentation.

type: custom:auto-entities
card:
  type: entities
  title: Plant Humidity
  show_header_toggle: true
  state_color: true
filter:
  include:
    - entity_id: sensor.*planthumidity
  exclude: []

Options under entity_id.

type: custom:auto-entities
card:
  type: entities
  title: Plant Humidity
  show_header_toggle: true
filter:
  include:
    - entity_id: sensor.*planthumidity
      options:
        state_color: true
  exclude: []

The “state_color” option can be defined either on a card or a row level.
But this option will not work here in both cases since these entities are of a “sensor” domain, and only some sensor’s device_classes (battery) has a supported icon color functionality.
To OP - suggest you to find out first how to style a row in a normal Entities card (w/o auto-entities).
Hint: card-mod.
Besides, there is a dedicated auto-entities thread, no need to create a new one. And ofc there is a dedicated thread for card-mod as well.

2 Likes