WTH, why cant we add an on And off icon in the UI

instead of only being able to set a single icon in the UI, it would be really very nice to be able to set an ‘on’ and ‘off’ icon.

material design icons has a boatload of -off icons we could use, and, ofc besides a few device_classes these now are not used in core HA, nor Frontend.

So, please add the option to set 2 icons for a single entity in the UI, or backend yaml.

belastend: add on/off options for icon · Discussion #13700 · home-assistant/frontend · GitHub

Duplicate?

1 Like

I think the two are closely related but not exactly duplicates.

This issue is specifically about the ability to set custom icons on devices and entities. I’ve often wondered why I couldn’t do exactly this when I’ve overridden the icon of a particular entity and now the icon doesn’t transition to a different one when it’s in an alternate state where it would if I hadn’t overridden the icon.

no no duplicate, but I couldn’t find it to relate to it. Thx.
A ‘free’ device_class would be awesome, next to a core option to set 2 icons in the UI

Agreed, which is why I did not close it.

Marius is asking for customisable on and off state icons, where as my proposal also supplies on and off translated state words (if wanted).

2 Likes

Maybe this could be changed to allowing the icon to change based on state? Have a definition map of state → icon mapping that the user can define, so if they want any number of icons that could be done. An example that could be used easily is mdi:lightbulb-on-10 through mdi:lightbulb-on-90, there are 9 different values (not including on/off) that, if the user so wanted, they could define each state of percentage to one of those icons. That example shows just lighting but temperature, volume, etc could all use this in different cards.

well, that would be awesome, and please add it to this, or maybe even better, add a separate WTH for it.
I totally get what you say, but I wrote this up in terms of feasibility :wink:

a simple suggestion like this, would be a great start to develop into something bigger

Some sensor device classes do that already. Look at the battery sensor device class. The icon for the battery fills up as the battery charges. Don’t think that works for signal strength though.

and dont want to say out loud, but you can do that with custom-ui …(which I want to ditch as much as possible, hence my FR/WTH’s)

The custom cards do have some of that functionality, it just makes sense for the normal cards to have that functionality given how much of HA is UI based. At least an on/off type thing would be nice, it just wouldn’t be able to be used across all device types. How do you define on/off for a temperature or number value?

well, this WTH is about on/off.

If you want other states to be considered, you need something else. It can be done. Just need convincing the dev team.

:joy:

But this does not make sense for me. If one is doing a WTH for on and one for off and one for third state, than it is always in common, that it is the same topic and should be solved in a flexible way. If it will be hopefully solved eventually somewhen in the future.

I added in the similar request, that there are more than one case, where not only on/off is relevant, but e.g. closing/opening for covers, etc. as well. They have hard-coded icons in standard as well and it would be great to customize them too.

Already WTH’d. See above: WTH, why cant we add an on And off icon in the UI - #2 by tom_l

I know. Voted of course already.

1 Like