zigbee2mqtt-frontend icon indicating copy to clipboard operation
zigbee2mqtt-frontend copied to clipboard

[Bug]: Battery symbol shows full while % is very low

Open bverkron opened this issue 1 year ago • 6 comments

What happened?

Several devices currently have a very low battery (all < 20%) and are flashing but most of them still show the battery full icon which contradicts it status.

This screenshot was taken mid-blink (so they icons show slightly transparent) with the column shorted by battery %. So the one with the tool tip at the top is the highest of all of them. The rest below are 15% or lower, going all the way down to last one which is 11%. That is the only one that shows a low / empty battery symbol

image

You can also see that one entry that actually shows a low battery symbol is at 21% while another that's at 16% shows a full battery icon. Screen Shot 2022-08-01 at 10 56 57 AM Screen Shot 2022-08-01 at 10 57 02 AM

HA Addon version

1.26.0-1

Edit: Just upgraded to 1.27.0-1 and same issue. Also switched to edge version (this is the commit I'm on, I think) because of another issue and battery icons are still doing the same thing.

Platform

Version | core-2022.7.7 Host Operating System | Home Assistant OS 8.4 Supervisor Version | supervisor-2022.07.0

Logs of the issue (if applicable)

n/a

What browsers are you seeing the problem on?

Chrome, Safari

Relevant stacktrace

No response

Did you download state.json.zip?

I will attach state.json.zip

bverkron avatar Aug 01 '22 18:08 bverkron

state.json with personal info redacted (******) state-redacted.json.zip

bverkron avatar Aug 01 '22 18:08 bverkron

Hi, can you share screenshot from Raw tab?

nurikk avatar Aug 02 '22 08:08 nurikk

Hi, can you share screenshot from Raw tab?

raw.txt (redacted personal info)

bverkron avatar Aug 02 '22 17:08 bverkron

Is this not because the sensors with the green battery also have a battery_low property an as long as that is not asserted to true it shows as green 100% full ? I remember it at least being the case since the very beginning.

sjorge avatar Aug 05 '22 17:08 sjorge

in this case we have following state:

"battery": 16,
"battery_low": false,

this is why it's green with 16%

nurikk avatar Aug 09 '22 09:08 nurikk

There's a contradiction here then. It seems like the % is considered low by the frontend (not sure what the "low" threshold is) thus the icon is blinking (I assume blinking indicates a low battery), but because the battery_low state is false it shows a full battery? Seems like the frontend is using it's own definition of "low" that's different than what the devices is reporting via battery_low.

Additionally just because a battery isn't low as defined by "battery_low" doesn't mean it should be show at 100%.

Seems logical to set the battery icon based on the % (battery attribute) and the blink based on the batter_low if present or % if not present.

bverkron avatar Aug 11 '22 01:08 bverkron

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 12 '22 10:10 stale[bot]

Unstale.

Impact123 avatar Oct 12 '22 13:10 Impact123

@nurikk, @sjorge looks like this got auto-closed (despite the recent comment 9 days ago to keep it open). Looks like the issue is still there in the latest release. The bot added wontfix but not sure what the official decision on this is. Seems like a consistency issue to me based on my comment above

image

Also interesting that the actual percentage is show once it drops below 10% (I think).

bverkron avatar Oct 21 '22 17:10 bverkron