Is your MacBook battery draining at night? This is probably due to a piece of software on your Mac that is misbehaving and waking it while it should be sleeping. There are several ways to figure out which could be the culprit. You can use various tools to compile a list of suspects and then quit those before putting your MacBook to sleep to test them. You can also try things like reseting parts of the system and trying safe mode. You may be able to figure out the problem on your own, or you may need to take it to an expert.
You can also watch this video at YouTube (but with ads).
Here are the Terminal commands I show in the video:
pmset -g assertions
pmset -g log | grep -e " Sleep " -e " Wake " | tail -n 50
log show -last 4h --style syslog | fgrep -e " Wake " -e " Sleep "
Here is a link to that Apple support page:
If your Mac doesn’t sleep or wake when expected
Hi Gary,
I will definitely do these tests, because I noticed lately that my MacBook Pro is losing charge quicker than it used to. I bought it in 2014. Is it possible that the battery is nearing the end of it's useful life?
Jean-Claude: Depends on how much you have used it. Go to Apple Menu, About This Mac, then System Report, then Power. Look at the number of Cycle Count and also the Condition.
Thank you for this. I semi-retired my macbook and use it to drive the TV for things I don't want to view on my mini using headphones. It more often than it used to, wakes up after I have put it to sleep even in the daytime. It puzzled me so this video is timely. I only have one program that loads(Jing) on startup and to my knowledge, nothing to wake it other than me. I have rarely used the macbook on battery, it is normally plugged in, so now the challenge begins.
Great video. I followed the suggested steps and saw that Photos Agent wakes my MacBook Pro at night. I do use Apple Photos, and I guess Photos Agent is doing some house-keeping at night. Is there any way I tell Photos to NOT do house-keeping when my MacBook Pro lid is closed?
PJ: How is it waking your MacBook if the lid is closed? The process may be doing some housekeeping at night, but it won't wake the MacBook if the lid is closed. And if it is plugged in, then it won't drain the battery either.