Sensor battery dynamic

Hi guys, I have a battery sensor that doesn’t change color, how do I create a dynamic color sensor? Thanks

Easiest way is to use this:

1 Like

Currently a sensor with device_class: battery has a dynamic color dependently on a battery_level.
These levels are like “30, 70” (if I remember it correctly) instead of standard “33, 66”, but it works out-of-box.

Custom cards like battery-state-card, battery-entity-row etc have their own thresholds (a user may change them).
Using these cards, you will get colors only in these cards.
The default colors (described above) work everywhere - even in more-info windows.

A possible alternative may be using Custom UI to define colors for particular sensor(s) with user-defined thresholds; these colors will be displayed everywhere (overriding default colors decribed above).

1 Like