Macbook Air - battery drains while sleeping (but not when shut down)

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)

Solution 1:

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!

Solution 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.