SystemKit
SystemKit copied to clipboard
Not showing correct battery charge
I don't know if this is a bug or just me. But using the Battery method charge() doesn't seem to return the correct charge. It's about 5-6 percents lower than what it should be.
![]()
Hello @pkrll!
Sorry about the late response on this!
Few possibilities:
- System menu bar doesn't poll as often, so it's not up to date?
- System menu bar calls a different underlying API/computes the value slightly differently?
- Rounding error in SystemKit
Could cross check with Apple's own tool via, pmset -g batt
2 years later and can confirm this on macOS Mojave

EDIT : This seems to be an issue with the IOKit library
pmset -g batt returns the battery percentage displayed on the menubar but when I convert the output from ioreg -w0 -l | grep Capacity command, which I think uses the IOKit library, the battery percentage is off by 3-6%
EDIT 2 :
Ok this is interesting, pmset -g rawlog shows incorrect battery percentage too, but pmset -g batt does not, I don't even know which one is incorrect anymore lol