MBP 15" not sleeping when closing lid My MBP 15" (end 2016) on macOS Sierra 10.12.6 have a strange behaviour when I close the lid. It goes to sleep (I hear the fans becoming quiet) but after ~20 seconds it returns to work and then the cycle starts back.

In the future the behaviour I would like is to have the MBP to sleep for something like 10/20 mins (2/3h when on charger -c) and the go in hibernation mode (hibernatemode 25), but that's another story.

Those are the settings I currently have:

[ab:~]$ pmset -g assertions
2017-12-18 19:09:37 +0100
Assertion status system-wide:
   BackgroundTask                 0
   ApplePushServiceTask           0
   UserIsActive                   1
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             0
   ExternalMedia                  0
   PreventUserIdleSystemSleep     0
   NetworkClientActive            0
Listed by owning process:
   pid 116(hidd): [0x0000003e0009812e] 00:01:40 UserIsActive named: "com.apple.iohideventsystem.queue.tickle.4294968220.3"
    Timeout will fire in 296 secs Action=TimeoutActionRelease
Kernel Assertions: 0x1=CPU
   id=501  level=255 0x1=CPU mod=12/18/17, 7:24 PM description=IOThunderboltController owner=IOThunderboltController
Idle sleep preventers: IODisplayWrangler
[ab:~]$ pmset -g live
System-wide power settings:
Currently in use:
 standbydelay         0
 standby              1
 halfdim              1
 hibernatefile        /var/vm/sleepimage
 powernap             0
 gpuswitch            2
 disksleep            10
 sleep                5
 autopoweroffdelay    0
 hibernatemode        25
 autopoweroff         1
 ttyskeepawake        1
 displaysleep         5
 tcpkeepalive         1
 acwake               0
 lidwake              1
The culprit was a yubikey that was checking something every minute so it interrupted the sleep and the fans continued to work.