MacOS – Mac turns off the power supply when it sleeps

macbook promacospower-managementsleep-wake

I'm send my laptop to sleep ( -> Sleep) and when I open it later, it starts loading system from the beggining as if I powered off it. I lose progress in my work because of this.
I don't found where I may disable this behavior in settings.
This is started a few weeks ago (after system's update, I guess).

Is a way fix it?

macOS 10.13.4 (17E202)
MacBook Pro (15-inch, 2016)

EDIT

log show --style syslog --predicate 'eventMessage contains "shutdown cause"'
Filtering the log data using "eventMessage CONTAINS "shutdown cause""
Skipping info and debug messages, pass --info and/or --debug to include.
Timestamp                       (process)[PID]
2018-04-15 08:51:07.711622+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-15 21:10:28.630796+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-16 11:17:11.904271+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-16 22:55:42.824319+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-17 11:11:09.854747+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-23 22:13:08.794049+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-24 12:35:29.716396+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-24 23:28:13.687568+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-26 12:44:34.810162+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-28 23:35:48.521694+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-04-30 12:44:19.742698+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-04 09:12:50.828762+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-07 09:25:51.552046+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-08 09:34:15.499520+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-09 14:11:55.925660+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-09 22:51:10.543749+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-11 10:38:06.734522+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-12 12:20:26.007011+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-12 18:47:26.901257+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-13 10:35:58.837702+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-13 21:56:02.764590+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-14 11:15:37.522934+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2018-05-16 14:27:42.723753+0300  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5

EDIT 2

My actions after work day:
– unplugging power cable from laptop
– clicking to sleep ( -> Sleep)
– closing laptop's cover

Laptop go to power off not because low battery in sleeping mode, I'm checked it (after sleeping the battery always no less 80%).

EDIT 3

Battery Information:

  Model Information:
  Serial Number:    D867074D0YRHDWCAX
  Manufacturer: SMP
  Device Name:  bq20z451
  Pack Lot Code:    0
  PCB Lot Code: 0
  Firmware Version: 702
  Hardware Revision:    1
  Cell Revision:    3925
  Charge Information:
  Charge Remaining (mAh):   6345
  Fully Charged:    Yes
  Charging: No
  Full Charge Capacity (mAh):   6606
  Health Information:
  Cycle Count:  33
  Condition:    Normal
  Battery Installed:    Yes
  Amperage (mA):    0
  Voltage (mV): 12815

System Power Settings:

  AC Power:
  System Sleep Timer (Minutes): 0
  Disk Sleep Timer (Minutes):   10
  Display Sleep Timer (Minutes):    10
  Wake on AC Change:    No
  Wake on Clamshell Open:   Yes
  Wake on LAN:  Yes
  AutoPowerOff Delay:   28800
  AutoPowerOff Enabled: 1
  Current Power Source: Yes
  DarkWakeBackgroundTasks:  1
  Display Sleep Uses Dim:   Yes
  GPUSwitch:    2
  Hibernate Mode:   3
  PrioritizeNetworkReachabilityOverSleep:   0
  Standby Delay:    10800
  Standby Enabled:  1
  TCPKeepAlivePref: 1
  Battery Power:
  System Sleep Timer (Minutes): 1
  Disk Sleep Timer (Minutes):   10
  Display Sleep Timer (Minutes):    2
  Wake on AC Change:    No
  Wake on Clamshell Open:   Yes
  AutoPowerOff Delay:   28800
  AutoPowerOff Enabled: 1
  DarkWakeBackgroundTasks:  0
  Display Sleep Uses Dim:   Yes
  GPUSwitch:    2
  Hibernate Mode:   3
  Reduce Brightness:    Yes
  Standby Delay:    10800
  Standby Enabled:  1
  TCPKeepAlivePref: 1

Hardware Configuration:

  UPS Installed:    No

AC Charger Information:

  Connected:    Yes
  Wattage (W):  55
  Charging: No

Best Answer

The system is powering off because AutoPowerOff is enabled.

To disable it, issue the following command in Terminal:

sudo pmset -a autopoweroff 0

That command will set autopoweroff to "disabled" for all profiles (-a). This means it covers you when on battery and on A/C. If you just want autopoweroff disabled when on battery, use the following command:

sudo pmset -b autopoweroff 0
  • -b = battery
  • -c = (wall) charger
  • -u = UPS
  • -a = all profiles

See man pmset for more details.