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

sleep battery drain #20

Closed
jonas0b1011001 opened this issue Oct 22, 2024 · 4 comments
Closed

sleep battery drain #20

jonas0b1011001 opened this issue Oct 22, 2024 · 4 comments

Comments

@jonas0b1011001
Copy link

Ever since installing batt my macbook looses about 2%/h while in sleep unplugged.

Did i misconfigure?

Bildschirmfoto 2024-10-22 um 07 34 05
@charlie0129
Copy link
Owner

Can you confirm that your MacBook is actually sleeping during that time?

You can check this by reading /tmp/batt.log. If adjacent logs are more than 20 seconds apart, then your mac is sleeping.

For example:

Sleeping:

time="2024-10-22 02:01:28.723" level=debug msg="batteryCharge=60, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 02:01:48.725" level=debug msg="batteryCharge=60, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 03:05:18.259" level=debug msg="batteryCharge=60, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 03:05:38.270" level=debug msg="batteryCharge=60, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 04:09:28.449" level=debug msg="batteryCharge=60, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 04:09:48.453" level=debug msg="batteryCharge=60, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 04:10:08.456" level=debug msg="batteryCharge=60, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"

Awake:

time="2024-10-22 13:20:47.215" level=debug msg="batteryCharge=59, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 13:21:07.217" level=debug msg="batteryCharge=59, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 13:21:27.220" level=debug msg="batteryCharge=59, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 13:21:47.222" level=debug msg="batteryCharge=59, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"
time="2024-10-22 13:22:07.226" level=debug msg="batteryCharge=59, lower=58, upper=60, chargingEnabled=false, isPluggedIn=true, maintainedChargingInProgress=false"

@jonas0b1011001
Copy link
Author

Logs are roughly 20s apart.

Can batt be preventing sleep or do i need to look somewhere else?

@charlie0129
Copy link
Owner

charlie0129 commented Oct 22, 2024

batt will not prevent sleeping. (Technically, it can, but only when you are actively charging. Once charging is finished, it will not. In your case, you are not in active charging.)

You can debug macOS sleep behavior by pmset -g assertions. Just be sure to open the same apps so you can see which one is preventing sleeping.

@jonas0b1011001
Copy link
Author

I will take a deeper look at that.

Thank you very much for the tool and your quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants