Battery Tile Color Change By %

Hello,

Is there a way to have the battery tile colors turn to red when below 20%?

Thank You

You'd have to create 100 CSS entries (or at least entries for 0-20) in the general format of:

.battery-999 {background-color:red}

where 999 is the battery%

1 Like

Thanks, I am surprised there is not a "less than" command that can be used.

Also, how can I get the tile text to be over the tile color and have the tile color fill the entire tile?

Screenshot 2024-07-30 125855

Now you're rapidly approaching the limit of my CSS expertise. :sunglasses: Let's see if @sburke781 is around (you may also want to take a look at a cool app he wrote: [RELEASE] Simple CSS Editor).

1 Like

I feel like I have seen it done before, but will need to go hunting. Might be later today or tomorrow before I can though.

Thankfully the time difference makes it look like I made that comment only 1 day ago :slight_smile:

Hmmm.... I would probably need to spend a little more time searching to give you a more considered response (I feel like I'm at work :slight_smile: ). The point being there are complicated options, but whether they are worth recommending, I'm not sure. If you are interested you can lookup some of the CSS that people came up with during the incarnation of the Smartly solution by searching for "smartly humidity color".

I may consider something along these lines myself, but no promises....

I am surprised there isn't a native option to change tile color based on a condition with a < or > option.

Thanks
Matt

From what I understand, and this is not a "it can't be done....", It would likely require something in the driver, which would include every driver that implements the humidity (and temperature, etc) driver... So not a super convenient option for all implementations of the capability.

I'd also add, some of the limitation (maybe most of it) in providing a "convenient" solution comes from limitations in CSS, noting to do with HE.

If the tiles currently show battery levels, then it would just be a dashboard display issue correct?

Thanks
Matt

I've probably confused matters with some of my earlier comments. I agree it would be nice if there could be a built-in ability to produce coloring of the tile based on a range. I could try to add something to my editor, but I can't guarantee when. Conceptually it would not be hard to do....

1 Like