I’m trying to have a battery indicator change colour at a certain percentage of charge, but I’ve tried it a couple of ways and both seem to be buggy.
If I use…
$#BLN#<=20?“less”:“more”$
It returns “more” when BLN is 0.
1-100 is correct.
If I use…
$#BLP#<=20%?“less”:“more”$
It’s all over the place -
0-2% returns “less” (correct)
3-9% returns “more”
10-20% returns “less” (correct)
21-99% returns “more” (correct)
100% returns “less”
Whichever way I do it, it doesn’t get it right, all the time.
Can anyone shed any light on what’s going on here? I could expand my expression to account for the error or errors, but that seems a bit silly. I’m guessing someone must have come across this before…
1 Like
Here is what i have used: $#BLN#>0?100:0$
change = > 0 accordingly
2 Likes
For all the battery expressions you want to use #BLN# or #PBN# which returns a number. If you use #BLP# or #PBP# it returns a percentage (%) and will drive expressions crazy. If I was doing your example I would use $#BLN#<=20?less:more$ for my expression. It should give you what you expect to get.
2 Likes
It also suddenly dawned on me this morning as I woke up, that it was stupid worrying about what it looks like when the battery level is zero, because if the battery level is at zero, a, you have bigger problems, and b, you probably can’t see what the output is, because the screen will be blank.
Nice to know I’m now thinking about Facer in my sleep.
Thanks anyway for the advice about using BLN instead of BLP. That makes sense.
2 Likes
The zero battery level only shows on the watch battery from 11:52 pm (23:52) until midnight on Facer previews. BUT, my being somewhat OCD I put in backups into every watch face I make to show a battery of some kind during that time. If you put any Opacity codes in that include the #BLN# tag, Facer will show nothing in that spot for a little over 9 minutes. I use a red number to show low battery percent (<16%) and will hide it under another one of a different color. I will not use an opacity expression on the red one but the one above it I’ll use opacity $#BLN#>=15?100:0$ to turn off the top one and leave the red bottom one running. During the Facer “glitch time” the red one will display --% to show that a battery reading “would” be there.
1 Like
I have OCD also in this, i have been using this $#BLN#>0?100:0$ to blank it out when at 0
1 Like
Ha Ha . I thought I came up with that . Here I am reinventing the wheel . That response got you a new Follower.