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.
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.
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
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.
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?
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.