I finally fixed my issue and now both the screensaver and sleep functions are working again. I was scouring the web and the solution that worked for me was to:
- Press Win + R to open the Run dialog.
- Type cmd in the box and press Ctrl + Shift + Enter to launch Command Prompt with admin rights.
- Input the following command and press Enter. powercfg -lastwake.
Then I looked at the list of devices and went into DEVICE MANAGER (type Device Manager into the command prompt) and went to each item on the -lastwake list. I then right clicked on each thing, clicked PROPERTIES then clicked on the right tab POWER MANAGEMENT and unticked ALLOW THIS DEVICE TO WAKE THE COMPUTER. I had about 15 things on the list. I did the above for everything but the keyboard. So to wake the computer I just whack the space bar.
I'm not sure which item was causing the problem as I turned them all off at the same time but it had got to a point where I'd activate SLEEP and the PC would wake itself up again in seconds.
I did the above in June and now at the very end of August I'm still all good so for me this was a permanent fix.
I hope it helps someone else.
My wake history count is 0, so this isn't the source of the problem for me.