Oh, wait! You’re overriding the icon the device_class
would automatically select by specifing a static icon. Try removing the icon attribute.
Aha! Yes, that makes perfect sense… except these sensors are created by ESPHome so I can’t!!
I don’t know pretty much anything about ESPHome, but isn’t that supposed to be a customizable platform? Can’t you change it, so that it sets the device_class
attribute for this entity instead of the icon
attribute? Or can you at least open an issue to have that done?
I’m not sure on either of those options but yes, I’ll look into it.
Thanks for spotting the root cause!
Interestingly, the docs imply that it should work…
yes, and, I always try to be as straightforward as possible, wasting fewest resources possible… Adding the ‘hack’ as I did it made me doubt already. Though I’ve seen other people use it.
Setting a fixed icon would be purest. Because of that I still feel the direct icon:
option would be even better, and Phil, the reason I suggested that is that I have always experienced the template sensor to be an extension of the regular sensor. As such, it also allows both the friendly_name
And friendly_name_template
. Why not offer icon:
too.
No 1st world problem. I’ll customize happily
It probably shouldn’t. That’s from days gone by and has been overlooked. Add it to the long, long list…