WTH is it so hard to set icons for entity states

A lot of entities have a finite number of states (like “open/closed” for a window- or door-sensor) – but if you want to visualize the state (with fx icons for open/closed windows) it requires you manually do template-setup handling the states and changing the icons for each case – it seems like thing that could either be build-in for at least some entities, or handled using a predefined helper for matching state with icons and/or colors

See WTH is there no binary sensor custom Device Class?

I agree that there is a lot of overlap, but some entities have more than 2 states, and that is not covered by the “custom binary sensor” – but if that suggestion ends up being expanded to handle n states instead of just 2, it would solve this issue

  1. providing the icon based on the entities state is the responsibility of the integration.
    → I agree, that you should have the possibility to define a “custom” icon especially, since you can set an individual icon it would make sense to allow an icon for “active” / “inactive” states…

  2. it will be impossible for homeassistant to know, how many different states an entity might / can have.
    → option here could be: “unavailable” / “active” / “inactive”
    While you can do that with templates, I think it would be better to have it built in into the UI … else, you would need to create templates for each entitiy you want to customize… and that can be a mess.

So I would support the possibility to extend the “Symbol” setting in the Card-Editor UI

  • Add Icon-Option for State: Unavailable
  • Add Icon-Option for State: Active / On / true / 1
  • Add Icon-Option for State: Inactive / Off / false / 0

If it supported templates, like the old style template sensor then that would solve this.