MacBook Pro continually wakes while in sleep mode [duplicate]

I've a 15" MacBook Pro (mid-2015) OS X 10.11.1, and I noticed that my MacBook loses 20% power while in sleep mode for 12 hours.

This is a small part of my log file when my MacBook Pro was in "sleep" mode:

28/11/15 12:09:54,000 kernel[0]: AirPort: Link Down on awdl0. Reason 1 (Unspecified).
28/11/15 12:09:54,000 kernel[0]: ARPT: 41841.442659: wl0: wl_update_tcpkeep_seq: Original Seq: 2389288299, Ack: 2044772261, Win size: 4096
28/11/15 12:09:54,000 kernel[0]: ARPT: 41841.442696: wl0: wl_update_tcpkeep_seq: Updated seq/ack/win from UserClient Seq 2389288299, Ack 2044772261, Win size 176
28/11/15 12:09:54,000 kernel[0]: ARPT: 41841.442740: wl0: leaveModulePoweredForOffloads: Wi-Fi will stay on.
28/11/15 12:09:55,000 kernel[0]: ARPT: 41841.469349: AirPort_Brcm43xx::platformWoWEnable: WWEN[enable]
28/11/15 12:09:55,000 kernel[0]: ARPT: 41841.470191: AirPort_Brcm43xx::syncPowerState: WWEN[enabled]
28/11/15 12:09:55,000 kernel[0]: in6_unlink_ifa: IPv6 address 0xb1c284aa41ebb6c1 has no prefix
28/11/15 12:09:55,000 kernel[0]: IOThunderboltSwitch<0>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 11 unplug = 0
28/11/15 12:09:55,000 kernel[0]: IOThunderboltSwitch<0>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 12 unplug = 0
28/11/15 12:09:55,522 symptomsd[208]: -[NetworkAnalyticsEngine _writeJournalRecord:fromCellFingerprint:key:atLOI:ofKind:lqm:isFaulty:] Hashing of the primary key failed. Dropping the journal record.
28/11/15 12:09:55,000 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
28/11/15 12:09:55,000 kernel[0]: AppleThunderboltNHIType2::waitForOk2Go2Sx - intel_rp = 1 dlla_reporting_supported = 0
28/11/15 12:09:56,000 kernel[0]: AppleThunderboltNHIType2::waitForOk2Go2Sx - retries = 2
28/11/15 12:14:22,000 kernel[0]: Wake reason: ?
28/11/15 12:14:22,000 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
28/11/15 12:14:22,000 kernel[0]: AppleCamIn::wakeEventHandlerThread
28/11/15 12:14:22,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
28/11/15 12:14:22,000 kernel[0]: Previous sleep cause: 5
28/11/15 12:14:22,000 kernel[0]: AppleThunderboltNHIType2::prePCIWake - power up complete - took 1 us
28/11/15 12:14:22,000 kernel[0]: AppleThunderboltGenericHAL::earlyWake - complete - took 1 milliseconds
28/11/15 12:14:22,000 kernel[0]: IOThunderboltSwitch<0>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 11 unplug = 0
28/11/15 12:14:22,000 kernel[0]: IOThunderboltSwitch<0>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 12 unplug = 0
28/11/15 12:14:22,000 kernel[0]: TBT W (2): 0x0040 [x]
28/11/15 12:14:22,000 kernel[0]: AirPort: Link Down on en0. Reason 8 (Disassociated because station leaving).
28/11/15 12:14:22,000 kernel[0]: en0: channel changed to 1
28/11/15 12:14:22,000 kernel[0]: en0::IO80211Interface::postMessage bssid changed
28/11/15 12:14:22,000 kernel[0]: en0: 802.11d country code set to 'X3'.
28/11/15 12:14:22,000 kernel[0]: en0: Supported channels 1 2 3 4 5 6 7 8 9 10 11 12 13 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 144 149 153 157 161
28/11/15 12:14:22,000 kernel[0]: en0: channel changed to 1
28/11/15 12:14:22,000 kernel[0]: ARPT: 41843.166036: ARPT: Wake Reason: Wake on Scan offload; Disconnect reason: Class 2 frame received from nonauthenticated STA
28/11/15 12:14:22,000 kernel[0]: Setting BTCoex Config: enable_2G:1, profile_2g:0, enable_5G:1, profile_5G:0
28/11/15 12:14:22,000 kernel[0]: AirPort: Link Up on awdl0
28/11/15 12:14:22,440 configd[51]: network changed: v4(en0-:192.168.1.136) v6(en0:2a02:1810:340b:9d00:aebc:32ff:fea0:6293) DNS! Proxy SMB
28/11/15 12:14:22,000 kernel[0]: USBMSC Identifier (non-unique): 000000000820 0x5ac 0x8406 0x820, 3
28/11/15 12:14:22,000 kernel[0]: ARPT: 41843.436625: AirPort_Brcm43xx::powerChange: System Wake - Full Wake/ Dark Wake / Maintenance wake
28/11/15 12:14:22,000 kernel[0]: ARPT: 41843.436645: IOPMPowerSource Information: onWake,  SleepType: Normal Sleep,  'ExternalConnected': No, 'TimeRemaining': 1177, 
28/11/15 12:14:22,000 kernel[0]: ARPT: 41843.436669: ARPT: Wake Reason: Wake on Scan offload
28/11/15 12:14:22,000 kernel[0]: ARPT: 41843.436710: AirPort_Brcm43xx::platformWoWEnable: WWEN[disable]
28/11/15 12:14:22,000 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
28/11/15 12:14:22,000 kernel[0]: AppleCamIn::wakeEventHandlerThread
28/11/15 12:14:22,000 kernel[0]: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
28/11/15 12:14:22,000 kernel[0]: in6_unlink_ifa: IPv6 address 0xb1c284aa41ebaee1 has no prefix
28/11/15 12:14:22,717 UserEventAgent[42]: Captive: CNPluginHandler en0: Inactive
28/11/15 12:14:22,967 cdpd[422]: Saw change in network reachability (isReachable=0)
28/11/15 12:14:22,969 Google Drive[368]: mod_SCNetworkReachabilityCallBack
28/11/15 12:14:22,969 Google Drive[368]: mod_SCNetworkReachabilityCallBack
28/11/15 12:14:22,970 symptomsd[208]: __73-[NetworkAnalyticsEngine observeValueForKeyPath:ofObject:change:context:]_block_invoke unexpected switch value 2
28/11/15 12:14:22,970 netbiosd[27521]: network_reachability_changed : network is not reachable, netbiosd is shutting down
28/11/15 12:14:23,155 configd[51]: network changed: v6(en0-:2a02:1810:340b:9d00:aebc:32ff:fea0:6293) DNS- Proxy-
28/11/15 12:14:23,000 kernel[0]: IO80211AWDLPeerManager::setAwdlOperatingMode Setting the AWDL operation mode from AUTO to SUSPENDED
28/11/15 12:14:23,000 kernel[0]: IO80211AWDLPeerManager::setAwdlSuspendedMode() Suspending AWDL, enterQuietMode(true)
28/11/15 12:14:23,233 networkd[157]: -[NETClientConnection effectiveBundleID] using process name apsd as bundle ID (this is expected for daemons without bundle ID
28/11/15 12:14:23,235 networkd[157]: -[NETClientConnection effectiveBundleID] using process name apsd as bundle ID (this is expected for daemons without bundle ID
28/11/15 12:14:23,000 kernel[0]: AirPort: Link Up on en0
28/11/15 12:14:23,000 kernel[0]: en0: BSSID changed to 00:22:b0:85:97:5e
28/11/15 12:14:23,000 kernel[0]: en0: channel changed to 1
28/11/15 12:14:23,000 kernel[0]: en0::IO80211Interface::postMessage bssid changed
28/11/15 12:14:23,282 symptomsd[208]: -[NetworkAnalyticsEngine _writeJournalRecord:fromCellFingerprint:key:atLOI:ofKind:lqm:isFaulty:] Hashing of the primary key failed. Dropping the journal record.
28/11/15 12:14:23,000 kernel[0]: en0: 802.11d country code set to 'DE'.
28/11/15 12:14:23,000 kernel[0]: en0: Supported channels 1 2 3 4 5 6 7 8 9 10 11 12 13 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 149 153 157 161
28/11/15 12:14:23,000 kernel[0]: Unexpected payload found for message 9, dataLen 0
28/11/15 12:14:23,000 kernel[0]: AirPort: RSN handshake complete on en0
28/11/15 12:14:23,000 kernel[0]: Setting BTCoex Config: enable_2G:1, profile_2g:0, enable_5G:1, profile_5G:0
28/11/15 12:14:23,988 com.apple.xpc.launchd[1]: (com.apple.xpc.launchd.oneshot.0x10000030.BetterTouchTool[30954]) Service exited due to signal: Terminated: 15
28/11/15 12:14:24,211 lsd[260]: LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist
28/11/15 12:14:24,296 BetterTouchTool[30978]: leap support enabled
28/11/15 12:14:24,310 com.apple.xpc.launchd[1]: (com.hegenberg.BTTRelaunch.84192[30955]) Service exited due to signal: Terminated: 15
28/11/15 12:14:24,000 kernel[0]: IO80211AWDLPeerManager::setAwdlOperatingMode Setting the AWDL operation mode from SUSPENDED to AUTO
28/11/15 12:14:24,000 kernel[0]: IO80211AWDLPeerManager::setAwdlAutoMode Resuming AWDL
28/11/15 12:14:24,411 UserEventAgent[42]: Captive: [CNInfoNetworkActive:1748] en0: SSID 'kevin' making interface primary (cache indicates network not captive)
28/11/15 12:14:24,411 UserEventAgent[42]: Captive: CNPluginHandler en0: Evaluating
28/11/15 12:14:24,412 configd[51]: network changed: DNS* Proxy
28/11/15 12:14:24,412 UserEventAgent[42]: Captive: en0: Not probing 'kevin' (cache indicates not captive)
28/11/15 12:14:24,412 UserEventAgent[42]: Captive: CNPluginHandler en0: Authenticated
28/11/15 12:14:24,416 configd[51]: network changed: v4(en0!:192.168.1.136) DNS+ Proxy+ SMB
28/11/15 12:14:25,005 cdpd[422]: Saw change in network reachability (isReachable=2)
28/11/15 12:14:25,006 Google Drive[368]: mod_SCNetworkReachabilityCallBack
28/11/15 12:14:25,008 symptomsd[208]: __73-[NetworkAnalyticsEngine observeValueForKeyPath:ofObject:change:context:]_block_invoke unexpected switch value 2
28/11/15 12:14:25,036 Google Drive[368]: mod_SCNetworkReachabilityCallBack
28/11/15 12:14:26,396 ntpd[30540]: wake time set +1.146968 s
28/11/15 12:14:26,991 mDNSResponder[89]: mDNS_Execute: SendResponses didn't send all its responses; will try again in one second
28/11/15 12:14:27,096 mDNSResponder[89]: mDNS_Execute: SendResponses didn't send all its responses; will try again in one second
28/11/15 12:14:27,281 mDNSResponder[89]: mDNS_Execute: SendResponses didn't send all its responses; will try again in one second
28/11/15 12:14:28,045 configd[51]: network changed: v4(en0:192.168.1.136) v6(en0+:2a02:1810:340b:9d00:aebc:32ff:fea0:6293) DNS* Proxy SMB
28/11/15 12:14:28,000 kernel[0]: AppleCamIn::handleWakeEvent_gated
28/11/15 12:14:28,687 configd[51]: network changed: v4(en0:192.168.1.136) v6(en0:2a02:1810:340b:9d00:aebc:32ff:fea0:6293) DNS! Proxy SMB
28/11/15 12:14:28,715 Google Drive[368]: mod_SCNetworkReachabilityCallBack
28/11/15 12:14:28,715 Google Drive[368]: mod_SCNetworkReachabilityCallBack
28/11/15 12:14:28,000 kernel[0]: AppleCamIn::handleWakeEvent_gated
28/11/15 12:14:30,997 com.apple.xpc.launchd[1]: (com.apple.xpc.launchd.oneshot.0x10000031.BetterTouchTool[30978]) Service exited due to signal: Terminated: 15
28/11/15 12:14:31,217 lsd[260]: LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist
28/11/15 12:14:31,302 BetterTouchTool[30984]: leap support enabled
28/11/15 12:14:31,315 com.apple.xpc.launchd[1]: (com.hegenberg.BTTRelaunch.84192[30979]) Service exited due to signal: Terminated: 15
28/11/15 12:14:34,005 com.apple.CDScheduler[246]: Thermal pressure state: 1 Memory pressure state: 0
28/11/15 12:14:34,007 com.apple.CDScheduler[42]: Thermal pressure state: 1 Memory pressure state: 0
28/11/15 12:14:44,244 com.apple.CDScheduler[246]: Thermal pressure state: 0 Memory pressure state: 0
28/11/15 12:14:44,244 com.apple.CDScheduler[42]: Thermal pressure state: 0 Memory pressure state: 0
28/11/15 12:14:48,000 kernel[0]: IO80211AWDLPeerManager::setAwdlOperatingMode Setting the AWDL operation mode from AUTO to SUSPENDED
28/11/15 12:14:48,000 kernel[0]: IO80211AWDLPeerManager::setAwdlSuspendedMode() Suspending AWDL, enterQuietMode(true)
28/11/15 12:14:52,000 kernel[0]: IO80211AWDLPeerManager::setAwdlOperatingMode Setting the AWDL operation mode from SUSPENDED to AUTO
28/11/15 12:14:52,000 kernel[0]: IO80211AWDLPeerManager::setAwdlAutoMode Resuming AWDL
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.524961: wl0: setup_keepalive: interval 900, retry_interval 30, retry_count 10
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.524972: wl0: setup_keepalive: Local IP: 192.168.1.136
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.524976: wl0: setup_keepalive: Remote IP: 17.110.229.212
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.524980: wl0: setup_keepalive: Local port: 53437, Remote port: 5223
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.524985: wl0: setup_keepalive: Seq: 3416633147, Ack: 3719134279, Win size: 4096
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.525001: wl0: MDNS: IPV4 Addr: 192.168.1.136
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.525006: wl0: MDNS: IPV6 Addr: fe80:0:0:0:aebc:32ff:fea0:6293
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.525011: wl0: MDNS: IPV6 Addr: 2a02:1810:340b:9d00:aebc:32ff:fea0:6293
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.525016: wl0: MDNS: IPV6 Addr: 2a02:1810:340b:9d00:78e1:6da:2544:6637
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.525019: wl0: MDNS: 0 SRV Recs, 0 TXT Recs
28/11/15 12:14:53,000 kernel[0]: ARPT: 41873.525023: wl0: MDNS: 1 TCP ports:  64538 
28/11/15 12:14:55,000 kernel[0]: PM response took 2006 ms (52, powerd)
28/11/15 12:14:55,000 kernel[0]: ARPT: 41875.523840: AirPort_Brcm43xx::powerChange: System Sleep 
28/11/15 12:14:55,000 kernel[0]: ARPT: 41875.523868: IOPMPowerSource Information: onSleep,  SleepType: Normal Sleep,  'ExternalConnected': No, 'TimeRemaining': 1177, 
28/11/15 12:14:55,000 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
28/11/15 12:14:56,000 kernel[0]: en0: BSSID changed to 00:22:b0:85:97:5e
28/11/15 12:14:56,000 kernel[0]: en0: channel changed to 1
28/11/15 12:14:56,000 kernel[0]: AppleThunderboltNHIType2::prePCIWake - power up complete - took 4 us
28/11/15 12:14:56,000 kernel[0]: AppleThunderboltGenericHAL::earlyWake - complete - took 0 milliseconds
28/11/15 12:14:56,000 kernel[0]: AirPort: Link Down on awdl0. Reason 1 (Unspecified).
28/11/15 12:14:56,000 kernel[0]: ARPT: 41875.988466: wl0: wl_update_tcpkeep_seq: Original Seq: 3416633147, Ack: 3719134279, Win size: 4096
28/11/15 12:14:56,000 kernel[0]: ARPT: 41875.988503: wl0: wl_update_tcpkeep_seq: Updated seq/ack/win from UserClient Seq 3416633147, Ack 3719134279, Win size 166
28/11/15 12:14:56,000 kernel[0]: ARPT: 41875.988545: wl0: leaveModulePoweredForOffloads: Wi-Fi will stay on.
28/11/15 12:14:56,000 kernel[0]: ARPT: 41876.014940: AirPort_Brcm43xx::platformWoWEnable: WWEN[enable]
28/11/15 12:14:56,000 kernel[0]: ARPT: 41876.015800: AirPort_Brcm43xx::syncPowerState: WWEN[enabled]
28/11/15 12:14:56,000 kernel[0]: in6_unlink_ifa: IPv6 address 0xb1c284aa235552d1 has no prefix
28/11/15 12:14:56,000 kernel[0]: IOThunderboltSwitch<0>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 11 unplug = 0
28/11/15 12:14:56,875 symptomsd[208]: -[NetworkAnalyticsEngine _writeJournalRecord:fromCellFingerprint:key:atLOI:ofKind:lqm:isFaulty:] Hashing of the primary key failed. Dropping the journal record.
28/11/15 12:14:57,000 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
28/11/15 12:14:57,000 kernel[0]: AppleThunderboltNHIType2::waitForOk2Go2Sx - intel_rp = 1 dlla_reporting_supported = 0
28/11/15 12:14:57,000 kernel[0]: AppleThunderboltNHIType2::waitForOk2Go2Sx - retries = 2
28/11/15 12:16:38,000 kernel[0]: Wake reason: ?
28/11/15 12:16:38,000 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
28/11/15 12:16:38,000 kernel[0]: AppleCamIn::wakeEventHandlerThread
28/11/15 12:16:38,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
28/11/15 12:16:38,000 kernel[0]: Previous sleep cause: 5
28/11/15 12:16:38,000 kernel[0]: AppleThunderboltNHIType2::prePCIWake - power up complete - took 1 us
28/11/15 12:16:38,000 kernel[0]: AppleThunderboltGenericHAL::earlyWake - complete - took 1 milliseconds
28/11/15 12:16:38,000 kernel[0]: IOThunderboltSwitch<0>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 11 unplug = 0
28/11/15 12:16:38,000 kernel[0]: IOThunderboltSwitch<0>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 12 unplug = 0
28/11/15 12:16:38,000 kernel[0]: TBT W (2): 0x0040 [x]
28/11/15 12:16:38,000 kernel[0]: AirPort: Link Down on en0. Reason 8 (Disassociated because station leaving).
28/11/15 12:16:38,000 kernel[0]: en0: channel changed to 1
28/11/15 12:16:38,000 kernel[0]: en0::IO80211Interface::postMessage bssid changed
28/11/15 12:16:38,000 kernel[0]: en0: 802.11d country code set to 'X3'.
28/11/15 12:16:38,000 kernel[0]: en0: Supported channels 1 2 3 4 5 6 7 8 9 10 11 12 13 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 144 149 153 157 161
28/11/15 12:16:38,000 kernel[0]: en0: channel changed to 1
28/11/15 12:16:38,000 kernel[0]: ARPT: 41877.747390: ARPT: Wake Reason: Wake on Scan offload; Disconnect reason: Class 2 frame received from nonauthenticated STA
28/11/15 12:16:38,000 kernel[0]: Setting BTCoex Config: enable_2G:1, profile_2g:0, enable_5G:1, profile_5G:0
28/11/15 12:16:38,428 configd[51]: network changed: v4(en0-:192.168.1.136) v6(en0:2a02:1810:340b:9d00:aebc:32ff:fea0:6293) DNS! Proxy SMB
28/11/15 12:16:38,000 kernel[0]: AirPort: Link Up on awdl0
28/11/15 12:16:38,000 kernel[0]: USBMSC Identifier (non-unique): 000000000820 0x5ac 0x8406 0x820, 3
28/11/15 12:16:38,000 kernel[0]: in6_unlink_ifa: IPv6 address 0xb1c284aa23554af1 has no prefix
28/11/15 12:16:38,648 UserEventAgent[42]: Captive: CNPluginHandler en0: Inactive
28/11/15 12:16:39,054 cdpd[422]: Saw change in network reachability (isReachable=0)
28/11/15 12:16:39,055 Google Drive[368]: mod_SCNetworkReachabilityCallBack
28/11/15 12:16:39,056 Google Drive[368]: mod_SCNetworkReachabilityCallBack

As you can see, some parts repeat themselves (eg Airport).

When I first noticed the problem, and I issued the following command:

syslog | grep -i "Wake reason"

It gave this as a result:

Nov 27 03:08:12 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17412.146502: ARPT: Wake Reason: Wake on Scan offload; Disconnect reason: Class 2 frame received from nonauthenticated STA
Nov 27 03:08:12 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17412.385579: ARPT: Wake Reason: Wake on Scan offload
Nov 27 03:08:12 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 27 03:15:33 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: ?
Nov 27 03:15:33 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17446.620656: ARPT: Wake Reason: Wake on Scan offload; Disconnect reason: Deauthentication beacuse sending STA is leaving (or has left) IBSS or ESS
Nov 27 03:15:34 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17447.435151: ARPT: Wake Reason: Wake on Scan offload
Nov 27 03:15:34 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 27 03:20:18 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: ?
Nov 27 03:20:18 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17481.602419: ARPT: Wake Reason: Wake on Scan offload; Disconnect reason: Class 2 frame received from nonauthenticated STA
Nov 27 03:20:18 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17481.869208: ARPT: Wake Reason: Wake on Scan offload
Nov 27 03:20:18 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 27 03:22:50 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: ?
Nov 27 03:22:50 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17515.977131: ARPT: Wake Reason: Wake on Scan offload; Disconnect reason: Class 2 frame received from nonauthenticated STA
Nov 27 03:22:51 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17516.843416: ARPT: Wake Reason: Wake on Scan offload
Nov 27 03:22:51 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 27 03:27:53 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: ?
Nov 27 03:27:53 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17550.959664: ARPT: Wake Reason: Wake on Scan offload; Disconnect reason: Class 2 frame received from nonauthenticated STA
Nov 27 03:27:53 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17551.199358: ARPT: Wake Reason: Wake on Scan offload
Nov 27 03:27:53 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 27 03:30:41 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: ?
Nov 27 03:30:41 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17584.863751: ARPT: Wake Reason: Wake on Scan offload; Disconnect reason: Class 2 frame received from nonauthenticated STA
Nov 27 03:30:42 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17585.721650: ARPT: Wake Reason: Wake on Scan offload
Nov 27 03:30:42 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 27 03:36:32 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: ?
Nov 27 03:36:32 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17619.944847: ARPT: Wake Reason: Wake on Scan offload; Disconnect reason: Class 2 frame received from nonauthenticated STA
Nov 27 03:36:33 Kevins-MacBook-Pro kernel[0] <Notice>: ARPT: 17620.820368: ARPT: Wake Reason: Wake on Scan offload
Nov 27 03:36:33 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 27 03:44:22 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: ?

Last night, I've switched off my wifi on my Mac before I've put the Mac in sleep mode. This resolved the problem of fast battery drain (only 2% during 10h of sleep mode).

The log file was still pretty messy, with a lot of activity. But the command (syslog |grep -i "Wake reason") gave this:

Nov 28 03:51:06 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: EC.SleepTimer (SleepTimer)
Nov 28 03:51:07 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 28 05:51:29 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: RTC (Alarm)
Nov 28 05:51:29 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 28 05:51:29 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 28 07:52:39 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: RTC (Alarm)
Nov 28 07:52:39 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 28 07:52:39 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 28 09:52:46 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: RTC (Alarm)
Nov 28 09:52:46 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 28 09:52:46 Kevins-MacBook-Pro kernel[0] <Notice>: [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)
Nov 28 10:57:19 Kevins-MacBook-Pro kernel[0] <Notice>: Wake reason: EC.LidOpen (User)

An RTC (alarm) every 2 hours.

Please note that I've no wake-up schedule, wake from network is unchecked, and powernap is also unchecked. I've also disabled any sharing service.

How can I resolve this problem? I want to use sleep mode without disabling wifi and without losing 20% of battery overnight…

UPDATE: It seems that Apple has fixed the battery drain (in sleep mode) in macOS Sierra (10.12). But the macOS Sierra update didn’t fix the problem for me. It just introduced a new problem to my solution (posted below). Now with Sierra, The SleepWatcher program doesn't always execute the wake-scripts when waking up, resulting in a delayed enabling of the Wi-Fi (sometimes up to 45 seconds after a wake).


Solution 1:

I found a fix. Seems that 2015 and 2016 MBPs are affected. This required disabling SIP and changing a system setting. I reported the bug to Apple so hopefully they'll fix it sometime soon. Please report it to them as well since any changes you make will be probably reverted with a system update.

From here: MacBook Pro 13 with Retina display consumes 10% battery overnight with the lid closed, is this normal?

and more details about it here https://discussions.apple.com/message/30869802#30869802

You have to turn SIP off, then do

ioreg -l | grep board-id

to get your board ID and then look for a file in the following directory that has your board ID as the filename (*.plist file)

/System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/X86PlatformPlugin.kext/Contents/Resources

Right click on the file > get info, and change permission for 'Everyone' to read and write (or edit this using sudo chmod a+rw *.plist). Then change these key values with a text editor so that they match these settings:

<key>TCPKeepAliveDuringSleep</key>
<false/>
...
<key>NotificationWake</key>
<false/>
<key>DNDWhileDisplaySleeps</key>
<true/>

Finally, turn SIP back on and reboot.

Solution 2:

I didn't found the exact cause of the problem, but I did found a solution which will avoid massive battery drains in sleep mode. The solution was to disable Airport (WiFi) when the Macbook was sleeping.

I used SleepWatcher v2.2 (http://www.bernhard-baehr.de) to run 2 scripts at wake and sleep interrupts. When the macbook goes to sleep, I execute the following command to disable WiFi:

/usr/sbin/networksetup setairportpower en0 off

When the Macbook wakes up again, I enable WiFi again:

/usr/sbin/networksetup setairportpower en0 on

You can download a script that installs SleepWatcher and the scripts at a blog post of mine (No ads located on the page).

Please note that in the original question of mine I said that I didn't want to disable WiFi constantly when putting the Mac to sleep. This solution does the same, but automatically, which makes it a good solution for the battery drain.


The sleep script:

#!/bin/bash

status=$(networksetup getairportpower en0 | grep -Ei "On$")

if [ -f /tmp/wifi.on ]; then
    rm /tmp/wifi.on
fi

if [ "" !=  "$status" ]; then
    echo "`date` -- WiFi is On ... storing statement" >> /tmp/sleep.log

    touch /tmp/wifi.on
    networksetup setairportpower en0 off
fi

The wake script:

#!/bin/bash

if [ -f /tmp/wifi.on ]; then
    echo "`date` -- Enablig WiFi" >> /tmp/sleep.log
    sleep 3
    networksetup setairportpower en0 on
fi 

Solution 3:

The problem is the macOS continues to check for updates (including email, software, news, etc.) while your MacBook Pro is asleep (this feature is called "Power Nap"). This means it's very quick to get up and running when you open your MacBook, but it also means your battery goes down while it's asleep.

The problem some people have is that even with "Power Nap" disabled, their battery still goes down as MacOS continues to check for updates (it's possibly other software checking online for things).

To fix this, you can tell you MacBook Pro to disconnect from the Internet while it's asleep, preventing online checks.

To do this, you need to set the tcpkeepalive setting to 0.

Open up Terminal and type:

sudo pmset -b tcpkeepalive 0

After you enter your password for sudo it gives you a warning saying some features may not work properly. This is fine, it simply disables Internet access during sleep.

You can check it is set correctly by running:

pmset -g

Which should show "tcpkeepalive 0"

And you can, of course, reverse it at any time by running:

sudo pmset -b tcpkeepalive 1

Simple!

Note: You can also force your Mac not to connect to the Internet when it's asleep even when connected to a power supply, if you like: sudo pmset -a tcpkeepalive 0. (Personally I don't mind as long as it's not using my battery, so -b is fine for me.)

Also note: The results from pmset -g will vary depending on if your MacBook Pro is connected to power or not when you run the command. It will reflect the current tcpkeepalive setting, depending on its current power situation.