Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong battery value on MacOS #301

Open
b1nhack opened this issue Jan 12, 2024 · 9 comments
Open

Wrong battery value on MacOS #301

b1nhack opened this issue Jan 12, 2024 · 9 comments
Labels
area/fetching Has something to do with the fetched information. platform/macos

Comments

@b1nhack
Copy link

b1nhack commented Jan 12, 2024

The macchina battery percentage value doesn't match the MacOS system's (about 3 less)

@grtcdr
Copy link
Member

grtcdr commented Jan 13, 2024

It would help if you provided your macOS, macchina and libmacchina versions.

@b1nhack
Copy link
Author

b1nhack commented Jan 14, 2024

MacOS Sonoma 14.2.1
macchina 6.1.8
libmacchina 6.3.5

@grtcdr grtcdr added area/fetching Has something to do with the fetched information. platform/macos labels Feb 1, 2024
@grtcdr
Copy link
Member

grtcdr commented Feb 1, 2024

Can anyone with Apple hardware confirm this? If so, please let us know by contributing to the conversation.

@mikemadden42
Copy link

I see this issue with the battery too. Let me know if I can help debug the issue.

# native macOS tool
$ pmset -g batt
Now drawing from 'Battery Power'
 -InternalBattery-0 (id=33816675)	93%; discharging; 16:46 remaining present: true
# macchina
Battery     -  88% & Discharging

@grtcdr
Copy link
Member

grtcdr commented May 4, 2024

Third-party battery replacements have caused issues, though way more sinister than this, in the past 1. Are these miscalculations occuring on machines with an authentic battery?

Footnotes

  1. https://github.com/Macchina-CLI/macchina/issues/73

@b1nhack
Copy link
Author

b1nhack commented May 4, 2024

Yes! My machine is brand new, from the Apple store.

@mikemadden42
Copy link

My MacBook also has the factory installed battery. Utils like pmset -g batt seem accurate while the calculation with macchina seem off.

@grtcdr
Copy link
Member

grtcdr commented May 4, 2024

I'll defer this to @123marvin123 as he knows more about the macOS side of things than I do.

@123marvin123
Copy link
Member

I'm not sure what could be the reason for these larger differences between the "pmset -g batt" command and macchinas readout. For macchina, the values are coming directly from IOKit. Only minor floating point -> int conversion are expected.

This is what I get on my MacBook Air M1 with original battery:

pmset -g batt
Now drawing from 'Battery Power'
 -InternalBattery-0 (id=22282339)	71%; discharging; 4:17 remaining present: true
Battery     -  70% & Discharging

@grtcdr grtcdr changed the title [BUG]Wrong battery value on MacOS Wrong battery value on MacOS May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/fetching Has something to do with the fetched information. platform/macos
Development

No branches or pull requests

4 participants