How do you prevent your laptop battery from draining while sleeping?

My fiancee has a 2016 13" MacBook Pro. She doesn’t use it very often - every few weeks or even less.

She finds that when she picks it up the battery is usually very low, so she has to plug it in.

Is there anything I can do to stop this? I’ve already checked the usually things - Power Nap is turned off, it’s not plugged into any external devices, and so forth.

I seem to remember from long ago when using the pmset command that there used to be a mode where the Mac would write the memory image to disk rather than holding it in ram. Is that deep sleep mode still a thing? Is there a way to force the Mac into that mode quicker - say after 24 hours?

If she only uses it once every few weeks, completely shutting it down is probably your best option. She can set it to reopen the windows she had open, but a complete shutdown will make sure the Mac isn’t thinking it has software-ish stuff to do while it’s powered off.

6 Likes

It sounds like you’re talking about hibernation. From the pmset man page:

hibernatemode = 25 is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image. If you want “hibernation” - slower sleeps, slower wakes, and better battery life, you should use this setting.

However, as suggested by your next question, you might prefer something a little less drastic than always using hibernation:

It sounds like you’re looking to control the timing of the “standby” transition between sleep and hibernation. Going back to the pmset man page:

standby causes kernel power management to automatically hibernate a machine after it has slept for a specified time period. This saves power while asleep. This setting defaults to ON for supported hardware. The setting standby will be visible in pmset -g if the feature is supported on this machine.

standbydelayhigh and standbydelaylow specify the delay, in seconds, before writing the hibernation image to disk and powering off memory for Standby. standbydelayhigh is used when the remaining battery capacity is above highstandbythreshold , and standbydelaylow is used when the remaining battery capacity is below highstandbythreshold.

highstandbythreshold has a default value of 50 percent.

So, summarizing the above notes from the pmset man page:

If you always want to hibernate immediately rather than sleeping, you could set hibernatemode to 25:

sudo pmset -a hibernatemode 25

If you’d prefer to control the timing of the standby transition from sleep to hibernation, try adjusting the “standby delay” parameters. For example, this would use a 24-hour standby delay when power is above 50 percent, switching to a 15-minute delay when power is below 50 percent.

sudo pmset -a highstandbythreshold 50
sudo pmset -a standbydelayhigh 86400
sudo pmset -a standbydelaylow 900

Hope this helps!

5 Likes

What an amazing appearance @kcase. Didn’t know you are a member in this forum. Wish you all the best.

2 Likes

If Ken Case is in the building … we can all sit back and watch the show :laughing:

3 Likes

Omnipresence demonstrated

3 Likes