Hello,
I have the meter values in the overview and would like to change the color as well as the icon at the state: sensor.evu_current_power depending on the current power consumption.
The coloring of the text works so far. However, the icon does not change and only the eye is displayed.
What am I doing wrong here?
Thanks a lot
@Ildar_Gabdullin
Thanks for the help.
This is how it works now. At the same time I have also colored the icon.
Is there a way to bundle options here? Currently with this solution I have to do the same query for each option.
Thanks a lot
Also, instead of using css variables “-color” you may explicitly change particular css properties for particular Dom elements. Go to huge card mod thread → 1st post for details.
Also, about changing an icon. If you need to change an icon for this entity EVERYWHRE (not in some particular card) - consider either a templated icon (if this is a template sensor) or a Custom UI (for other entities).
tbh, a power sensor should really just get device_class: power and probably a state_class: measurement if you want Long term stats (LTS) on it.
it will auto set the correct power icon because of the device_class.
no required custom (card_mod/custom-ui) settings at all for that. core does it all on those.
if you really want the templates to change them, then yes, you the template also on the icon:
which is really easy when using a core template entity, but this apparently isnt.
your next options are templating dashboard cards (also custom, because core does not support that)
or use custom-ui which is very powerful, I’d be glad to help you out, but need you to be sure you want it, I am reluctant to advise you to use custom-ui. its great, but can break upon each and every update of core. We just had an update to fix the Dom path in more-info… so no promises made