I love the new "built-in" maintenance dashboard showing all the battery levels. However, the icons turn yellow (warning) below 60%. Many of my devices stay below 60% for most of their battery life, so the color is not helpful as a warning. Is there a parameter that modifies this level? Or is it hard-coded and cannot be changed?
I would love to get the answer to this one as well…![]()
FWIW, the real warning comes into play below 25%, when the icon turns Red. I’m not sure I’d change how it plays out now, but it would be nice to have a say.
I believe it’s below 25%, because I only have one battery showing at 24% (that trigger could be a bit higher for all I know).
Hardcoded
but you can probably override with uix and do stuff like
# battery_color:
style: |
:host {
--icon-primary-color:
{% set state = states(config.entity)|float(-5) %}
{% if state > 75 %} var(--success-color)
{% elif state > 50 %} gold
{% elif state > 25 %} orange
{% elif state > 10 %} brown
{% else %} var(--alert-color)
{% endif %};
}
or, adjust your theme colors…
# --state-sensor-battery-high-color: var(--green-color);
# --state-sensor-battery-low-color: var(--red-color);
# --state-sensor-battery-medium-color: var(--orange-color);
I’ve long ago filed a FR to have it use more granularity, but seems not looked at or dismissed. maybe has to do with relevant battery icons?
maybe Ill paste the linked FR into the new place for FR’s… and renew the discussion for it
here it is Add more granularity to device_class: battery colors · home-assistant · Discussion #4480 · GitHub
And thanks to your suggestion @Mariusthvdb there will soon be a way to do this across all of Frontend with UIX with a few macros and including the top level macro in theme in the places you wish to color icons (lovelace (root), config panels, more-info, history, logbook etc.)
The discussion is about temp sensor icons, but the same principle can be used for any icon, matching it but whatever entity list you can template.
man, UIX is the ultimate tool.
its powers are limitless.
Thanks for hearing me out on that one, and squashing my requests to become manageable features for all!
