Make "icon" attribute accessible for all entities

Originally raised here; may be there were some other similar threads.

Why we cannot access icons in all cases?
Here an icon is not accessible for “sun.sun”:

Seems that we may only access an icon if:
– the icon is customized;
– the icon is defined explicitly - only for template sensors;
– … probably some other cases.

And seems that the icon is not accessible for sensors with “device_class”, for some domains (if not customized).
BTW, here is an exception - Mobile App integration creates sensors with accessible icons:

Huh, that is pretty annoying.
It would be nice if returned icons would fallback to the “Default” since those are hard-coded in.

1 Like