zigbee2mqtt-frontend
zigbee2mqtt-frontend copied to clipboard
[Bug]: Battery symbol shows full while % is very low
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
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.
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
state.json with personal info redacted (******) state-redacted.json.zip
Hi, can you share screenshot from Raw tab?
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.
in this case we have following state:
"battery": 16,
"battery_low": false,
this is why it's green with 16%
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.
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.
Unstale.
@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
Also interesting that the actual percentage is show once it drops below 10% (I think).