New
#11
use powercfg -requestsoverride option
I had the same problem with both Windows 7 and 10. I found out what was causing it--it was my wireless keyboard. I unplugged the keyboard from my computer, and my computer went to sleep automatically after the set amount of time.
To fix the problem, I plugged my keyboard back into my computer. I opened the Device Manager and selected the keyboard. I double clicked on it and selected Power Management. I changed the setting so that it was not able to wake the computer. It works normally now, and I am still able to wake the computer using either the mouse or the power button. What a relief! I hated having to put the computer to sleep manually!!