WTH easy change of color on a entity of a tile based on state

it would be great to have the option in GUI to define an entitys icon and color based on their state. for example a door lock:

locked = green; icon = door locked
unlocked, door closed = yellow; icon = door closed
unlocked, door open = red; icon = door open

Yeah it would be nice if the built in cards (especially the Tile card) were a lot more customisable.

The Mushroom Template Card does allow you to adjust the icon and colour based on state, for example:

{{
'red' if is_state(entity, 'on') else 'grey'
}}

but

  • Mushroom is third party and not built in
  • there are pros and cons to using Mushroom’s cards vs the new Tile card
  • it’s not always clear where you can use templating and where you can’t
  • it can be a little confusing knowing which card is best to use in different situations (should I use Tile? Should I use a Mushroom card?), especially now that Home Assistant’s built in Tile card seems to be based on the same design style

I’m sure there is a lot of history I wasn’t around for, but as someone fairly new to Home Assistant, it feels like Mushroom’s design style is being adopted as the “standard”, so I wonder if all of the Mushroom cards could be “absorbed” into Home Assistant so that you get the best of both out of the box.

It is already possible for some domains & device_classes to define colors as CSS variables in custom themes.

It’s already added as a request here: WTH we can't change color of entities based on state

and i 100% agree with you. Yes there are third party solutions and code we can do, but this seems like it should be part of a core

1 Like

It would be great if this became more native. Esp. the icons. I currently use Mushroom custom templates to manually do this for things like windows, doors, but also the battery state (so thats more then an open/close). I would like to suggest if this ever becomes more integrated that you do retain control over which icons and colors. Perhaps a default that people can change. Just like the main icon and name now.