18

My macbook air (13-inch, mid 2011) battery drains from ~100% to ~85% over night. The problem only started a few months ago. I'm currently running yosemite, but the problem started while on mavericks. My battery cycle count is ~130.

I tried completely discharging the battery and then re-charging, but that seems to have had no effect. I've also read through apple's battery documentation, but I can't find anything there either. Unfortunately, most of the forum posts I've found are about batteries going from 100% to 1% overnight -- I'm having trouble finding anything about losing ~15% overnight.

Results of pmset -g

Active Profiles:
Battery Power       1
AC Power        2*
Currently in use:
 standbydelay         4200
 standby              1
 womp                 1
 halfdim              1
 hibernatefile        /var/vm/sleepimage
 darkwakes            1
 networkoversleep     0
 disksleep            10
 sleep                10
 hibernatemode        3
 ttyskeepawake        1
 displaysleep         10
 acwake               0
 lidwake              1

Here are the results of syslog | grep -i "Wake reason" for the last 24 hours. I put my computer to sleep yesterday around 6pm and woke it this morning at 9:56am. Over that period, the battery went from 100% to 85%.

Nov 18 09:51:00 prime kernel[0] <Notice>: Wake reason: EC.LidOpen (User)
Nov 19 09:56:57 prime kernel[0] <Notice>: Wake reason: EC.LidOpen EHC2 (User)

10 Answers10

8

I have had the same problem occur to me after a completely new battery was installed in a MacBook Air from late 2011. From 100% I woke up the next day to find the battery at 28%.

So I dug up some research I had done and it comes to this command:

sudo pmset -a hibernatemode 25

From examining your setting I see yours is not 25 but 3, if you have not found a solution for your problem, this could be it.

Here is some additional read on this from the Apple Discussion Forums: https://discussions.apple.com/thread/4729695?start=0&tstart=0

You can see some pros and cons of doing this. I quote the documented differences:

hibernatemode = 3 by default on supported portables. The system will store a copy of memory to persistent storage (the disk), and will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from disk image.

hibernatemode = 25 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.

If I notice better results I shall do well to post them here as backing evidence. Good luck!

LAK
  • 191
  • Thanks! I'll give this a shot. I ended up completely reformatting my machine to see if the issue would resolve itself -- unfortunately, the same thing continues to happen. – jerhinesmith Jan 12 '15 at 19:47
  • Hello again, I think I am due for a short update; with mine, now almost 7 months in, I am still enjoying the benefit of the sudo pmset -a hibernatemode 25. So I can testify it works and now I can happily travel and not run out of battery power between meetings. – LAK Jul 29 '15 at 12:13
  • 1
    To be honest the only option that fixed this problem for me was resetting the SMC. Of course I also disabled bluetooth, networking and notifications during sleep first. – andreszs Jan 07 '19 at 23:02
2

To better understand what is it doing during the sleep and what is consuming your battery:

Your system is set to absolute sleep (no activity at all) for 4200 seconds (that is standard)

You have the "womp - wake on ethernet magic packet" enabled.

Unless you need that, you can disable it with sudo pmset womp 0

You can look up the reason for wake by using the following in Terminal

syslog | grep -i "Wake reason"

More details are in the Console log.

Look for activity that happens after you initiated the sleep and it starts about 4 hours after sleep begins with message like:

kernel[0]: Wake reason: EC.SleepTimer (SleepTimer)

Now look what is it doing after that line.

Ruskes
  • 48,129
  • Posted the output from syslog -- doesn't look like anything incriminating, however. Could it just be a bad battery? My (naive) guess ruled that out due to the battery maintaining full charge if I do a full shut-down vs. closing the lid. – jerhinesmith Nov 17 '14 at 18:58
  • It is a combination of Battery, but also the reasons it wakes up that consume battery. As you can see you have the "Wake reason: RTC (Alarm)" going about every 2 hours. That will add to battery drain. – Ruskes Nov 17 '14 at 19:35
  • RTC (Alarm) doesn't seem to happen when it's on battery-power, though. Is it possible for the battery to drain 15% overnight without waking from sleep? – jerhinesmith Nov 17 '14 at 19:39
  • Nope, if nothing is going on a good battery should not drain more than 5%. I am confused, are your logs from battery or from power or mixed? – Ruskes Nov 17 '14 at 19:43
  • We need to redo the test, this time on battery only overnight. Then look in the log (now you know how to) for the lines after you put it to sleep. – Ruskes Nov 17 '14 at 19:49
  • OK, it'll be on battery all night tonight, so I'll take a look tomorrow. For the results above, I had it plugged in over the weekend, so any results from the 16th and 17th would have been on power. – jerhinesmith Nov 17 '14 at 19:54
  • Great, please unplug any USB device you have to eliminate the Wake reason: EHC1 – Ruskes Nov 17 '14 at 20:01
  • Will do -- I always unplug everything at night anyway (monitor, keyboard, etc.) – jerhinesmith Nov 17 '14 at 20:43
  • OK, updated the output from syslog for the last 24 hours. I closed the lid last night around 6pm and opened it this morning to a 15% battery drain. – jerhinesmith Nov 19 '14 at 18:01
  • Where is the log file so to see what is it doing between those times? it should not be very long, so please post it. – Ruskes Nov 19 '14 at 18:06
  • You mean just the contents of syslog in between those two times? – jerhinesmith Nov 19 '14 at 18:11
  • Yes please, from the time of closing the lid til you open it again. – Ruskes Nov 19 '14 at 18:13
  • Here it is -- I'm pretty sure I shut down right around 17:40, which would mean there isn't much (if anything) between closing and re-opening, but I included the previous 8 minutes since I'm not sure exactly when I closed the lid: https://gist.github.com/jerhinesmith/da5f98b79bba4ab46b30 – jerhinesmith Nov 19 '14 at 18:18
  • 3
    NOTE: Most system logs have moved to a new logging system. See log(1) for more information. – Django Reinhardt Jan 19 '17 at 23:57
  • A newer command could be: pmset -g log|grep -e " Sleep " -e " Wake " – Xr. Oct 14 '21 at 17:33
0

I had the same problem with my MacBook Air. Tried different settings etc, didnt work. Then I noticed one pattern - If I had Chrome running, then this happens, but if I had quit chrome before closing the lid, then battery remains. So, thats what I am doing now. Making sure Chrome is not running when I close the lid.

sree
  • 1
  • very strange behaviour .. when you close the lid, the MBA should just keep memory alive. Having Chrome or any other tool should not change the battery drain. Or maybe it uses less energy if less RAM is used ? – Fredv Jun 17 '16 at 19:15
0

When any computer is asleep it still uses power to keep the ram fresh. Another thing that macs do is to occasionally check for new emails and notifications even while asleep. This feature is called power nap. To turn that off, visit https://support.apple.com/en-us/HT204032 for information.

Leslie's advice will help even more with using hibernate instead of sleep.

0

I had this issue with my new MacBook Pro once. I found that I had NoSleep enabled (even with the app closed). If you have NoSleep installed make sure you turn it off.

iProgram
  • 4,630
0

I had this problem with my MBP and iMac 5K (wake up in sleep mode automatically. It was actually the Google Drive app's fault; after I removed it, the problem was solved.

Munesawagi
  • 2,123
LOMLAM
  • 1
0

I had same issue, culprit was flux app. I disabled flux app and all os back to normal for me.

gnuyoga
  • 11
0

I add another important reason: macbook Pro will not hibernate if SSD start up disk is installed in the optibay (in those models that used to have one).

The "symptoms": MacBook just didn't hibernate, did not turn off automatically after autopoweroff minutes in pmset, nor turned off if scheduled. The consequence of this, a very important battery drain overnight (around 5% per hour) that I just wasn't able to solve applying any pmset setting combination / SMC reset / PRAM reset / macOS clean installation / previous macOS versions. I also spent several hours trying to determine if any startup process prevented deep sleep / hibernation... nothing seemed to work, so I almost gave up and attributed this to a hardware malfunction.

But... the culprit was a start up SSD disk installed in a case replacing the superdrive, that is to say, installed in the optic bay.

I simply changed the disks places, with the start up SSD connected to the native disk bay, and the issue was solved!

Hope it helps!!

0

I had the same problem with MacBook Pro 13in 2017 model. But the battery drain and laptop being warm happened only when the laptop was sleep and the charger was connected but turned off. I didn't observe the problem when the laptop was disconnected from the charger during sleep.

So, I guess it must be an electrical issue(earthing).

0

Basically, there are a number of apps, processes, settings etc that can prevent your mac from sleeping. I wrote a little function that I have added to batch_profile and run manually to sleep my computer. If sleep is being prevented the function will produce an audio alert.

(note, it automatically closes apps that I know always prevent sleep and it also turns off bluetooth which is also often a problem).

function slx {
  echo "...stopping any backups, closing any programmes known to cause issues"
  tmutil stopbackup
  pkill -x qemu-system-i386
  pkill -x qemu-system-x86_64
  pkill -x Music
  pkill -x VLC

echo "...turning off bluetooth & ejecting external drive" blueutil --power 0

diskutil eject /Volumes/SanDisk512TimeMachine

retry_count=0 max_retries=4 while true; do canSleep=$(isPreventingSleep) if [ $canSleep -eq 1 ]; then echo "success" break else retry_count=$(($retry_count+1)) if [ $retry_count -eq $max_retries ]; then pmset -g assertions blueutil --power 1 say "cannot sleep" echo "cannot sleep"

    break
  fi
  echo &quot;...trying again&quot;
  sleep 4
fi

done }

extractpmset() { pmset -g assertions | awk 'NR>=3&&NR<=10' | grep -v "UserIsActive" | grep -v "ExternalMedia" #pmset -g assertions | awk 'NR>=3&&NR<=10&&!/UserIsActive/' }

isPreventingSleep() { output=$(extractpmset) if [[ $output == "1" ]]; then echo "1" else echo "0"d fi }

https://gist.github.com/atreeon/c2d280576b2e95877d1d123efacd8066

You can also read man pmset and run pmset -g to check all your settings. I went through every single one, changed a few and it seemed to do the job.

Also you can run pmset -g assertions to check if anything is preventing sleep. On my machine ExternalMedia says it prevents sleep but in actual fact I don't think it does so I've excluded that from the list of things that could be preventing sleep.

IMO, the function is what the mac should do automatically when you select sleep.

atreeon
  • 476