Solving My Macbook Battery Problem

In the past few months I’ve been frustrated by my Macbook Air, which is less than a year old, constantly draining the battery when I leave it unplugged and on sleep.  I often have work to do in the middle of the night or early morning so I’ll bring the fully charged laptop to bed, put it on sleep and set the alarm for 4am - then when I wake up and go to do work I discover the battery is almost completely drained.

I found a thread on the apple support forums from late last year where people were complaining of something similar but that seemed to be entirely related to the Avast software which I don’t have.  I also saw a few comments about using a keyboard cover preventing the screen closing properly which worried me as I didn’t want to give up on my mophie cover but on testing (putting it to sleep manually rather than just closing the cover) I discovered the drain still happened.

My solution was finding the command

pmset -g assertions

running that in a terminal window gave me this

Assertion status system-wide:
BackgroundTask 0
PreventDiskIdle 0
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 0
InteractivePushServiceTask 0
PreventSystemSleep 1
ExternalMedia 0
PreventUserIdleSystemSleep 0
NetworkClientActive 0
Listed by owning process:
pid 69(hidd): [0x0000000a00002102] 02:04:08 UserIsActive named: “”
Timeout will fire in 596 secs Action=TimeoutActionRelease
pid 67(InternetSharing): [0x000000080000215f] 02:02:51 DenySystemSleep named: “”
No kernel assertions.

See that last one?  I have internet sharing on because once when at a conference where only I could connect, Tim and I shared my wifi connection. That option was stopping my laptop from ever properly going into sleep.  I disabled it in system preferences , shut my laptop lid and found it still 100% charged 5 hrs later.

Oh and the first time I ran the pmset command it didn’t show me that, instead it showed me this

PreventUserIdleSystemSleep named: “”

Yes iTunes was preventing idle sleep, but more importantly until I shut down iTunes it didn’t show me the bigger problem of Internet Sharing preventing it.

Problem solved.