Thanks trevoz.
I had a read through the thread, and seen the advice about running the below Terminal command.
log show --style syslog | fgrep -i sleep | fgrep -v mDNS
I ran it, and here's some information off of it from yesterday and today till I manually woke my iMac (I will point out that when I went to wake my iMac this morning, it was already awake, and its display had turned off, which it is set to do after 10 minutes of no use. So it must have awoken from sleep after I put it to sleep last night and had remained awake).
One thing I haven't tried, is disconnection all the USB devices from my iMac and see if the problem still happens, which I will do later on today.
Here's some information from Terminal, its a bit long, but there was quite a lot of entries in for yesterday and I thought if I could provide a lot of information from yesterday and today, it might help better show the cause.
Here's the information from Terminal:
2016-10-02 00:03:51.816833+0100 localhost AirPlayUIAgent[877]: (CoreUtils) [AirPlayUIAgent.AirPlayUIAgentServer] 2016-10-02 12:03:52.656297 AM BecomingInactive: NSWorkspaceWillSleepNotification
2016-10-02 00:03:52.869292+0100 localhost sharingd[297]: [com.apple.sharing.Daemon] Device will sleep
2016-10-02 00:03:52.872224+0100 localhost sharingd[297]: [com.apple.sharing.Handoff] Stopping for user 501 on sleep
2016-10-02 00:03:51.828523+0100 localhost LaterAgent[945]: (StoreFoundation) [com.apple.commerce.CKLegacy] LAPowerEventObserver: System will sleep
2016-10-02 01:14:46.839666+0100 localhost kernel[0]: PMRD: prevent idle sleep list: IODisplayWrangler+ (1)
2016-10-02 01:14:46.839667+0100 localhost kernel[0]: prevent idle sleep list: IODisplayWrangler+ (1)
2016-10-02 01:24:45.845398+0100 localhost kernel[0]: PMRD: prevent idle sleep list: IODisplayWrangler- (0)
2016-10-02 01:24:45.845400+0100 localhost kernel[0]: prevent idle sleep list: IODisplayWrangler- (0)
2016-10-02 07:27:33.520706+0100 localhost kernel[0]: PMRD: prevent idle sleep list: IODisplayWrangler+ (1)
2016-10-02 07:27:33.520709+0100 localhost kernel[0]: prevent idle sleep list: IODisplayWrangler+ (1)
2016-10-02 07:27:33.581961+0100 localhost loginwindow[110]: FaceTimeNotificationCenter | kLWDBLogScreenLockAndPower | __RegisterSleepWakeCallback_block_invoke | IOPMScheduleUserActiveChangedNotification received:1
2016-10-02 07:27:33.583692+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | -[LWScreenLock lowerShieldWindow] | calling CGSSessionIDSetSleepWindowID with shieldID and authWindowID set to kCGNullWindowID
2016-10-02 07:28:11.647788+0100 localhost kernel[0]: PMRD: prevent idle sleep list: IODisplayWrangler- (0)
2016-10-02 07:28:11.647790+0100 localhost kernel[0]: prevent idle sleep list: IODisplayWrangler- (0)
2016-10-02 07:28:12.597144+0100 localhost loginwindow[110]: FaceTimeNotificationCenter | kLWDBLogScreenLockAndPower | __RegisterSleepWakeCallback_block_invoke | IOPMScheduleUserActiveChangedNotification received:0
2016-10-02 07:28:13.598670+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | LWDisplayWillSleepCallback | entered. isMainThread:1, gPerformSleepWakeActions = 1
2016-10-02 07:28:13.598819+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | -[LWScreenLock enqueueScreenLockAction:requestedBy:] | calling screen lock directly for lock from display sleep
2016-10-02 07:28:13.600357+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | -[LWScreenLock raiseShieldWindowWithFade:] | calling CGSSessionIDSetSleepWindowID with just shieldWindowID: 2575
2016-10-02 07:28:12.701412+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | LWDisplayWillSleepCallback | exit
2016-10-02 07:40:34.008726+0100 localhost kernel[0]: PMRD: prevent idle sleep list: IODisplayWrangler+ (1)
2016-10-02 07:40:34.008728+0100 localhost kernel[0]: prevent idle sleep list: IODisplayWrangler+ (1)
2016-10-02 07:40:34.026179+0100 localhost loginwindow[110]: FaceTimeNotificationCenter | kLWDBLogScreenLockAndPower | __RegisterSleepWakeCallback_block_invoke | IOPMScheduleUserActiveChangedNotification received:1
2016-10-02 07:40:34.027491+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | -[LWScreenLock lowerShieldWindow] | calling CGSSessionIDSetSleepWindowID with shieldID and authWindowID set to kCGNullWindowID
1 libc++.1.dylib 0x00007fffc2ca465b std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 80
2 JavaScriptCore 0x00007fffb1e643df void std::__1::this_thread::sleep_for<long long, std::__1::ratio<1l, 1000l> >(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> > const&) + 63
1 libc++.1.dylib 0x00007fffc2ca465b std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 80
2 JavaScriptCore 0x00007fffb1e643df void std::__1::this_thread::sleep_for<long long, std::__1::ratio<1l, 1000l> >(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> > const&) + 63
1 libc++.1.dylib 0x00007fffc2ca465b std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 80
2 JavaScriptCore 0x00007fffb1e643df void std::__1::this_thread::sleep_for<long long, std::__1::ratio<1l, 1000l> >(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> > const&) + 63
1 libc++.1.dylib 0x00007fffc2ca465b std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 80
1 libc++.1.dylib 0x00007fffc2ca465b std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 80
2 JavaScriptCore 0x00007fffb1e643df void std::__1::this_thread::sleep_for<long long, std::__1::ratio<1l, 1000l> >(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> > const&) + 63
1 libc++.1.dylib 0x00007fffc2ca465b std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 80
2 JavaScriptCore 0x00007fffb1e643df void std::__1::this_thread::sleep_for<long long, std::__1::ratio<1l, 1000l> >(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> > const&) + 63
1 libc++.1.dylib 0x00007fffc2ca465b std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 80
2 JavaScriptCore 0x00007fffb1e643df void std::__1::this_thread::sleep_for<long long, std::__1::ratio<1l, 1000l> >(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> > const&) + 6
2016-10-02 19:39:17.958266+0100 localhost kernel[0]: (AppleSMC) Previous sleep cause: 5
2016-10-02 19:39:20.305000+0100 localhost kernel[0]: (AirPortBrcm4360) ARPT: 63292.504636: IOPMPowerSource Information: onWake, SleepType: Normal Sleep,
2016-10-02 19:39:20.307900+0100 localhost apsd[93]: (CoreDaemon) APSPowerAssertion: Sleep was not reverted
2016-10-02 19:39:23.914882+0100 localhost symptomsd[215]: (SymptomEvaluator) [com.apple.symptomsd.netepochs] SCDynamicStore config_callback: k: State:/Network/Interface/en0/SleepProxyServers
2016-10-02 19:39:23.926115+0100 localhost symptomsd[215]: (SymptomEvaluator) [com.apple.symptomsd.netepochs] SCDynamicStore config_callback: k: State:/Network/Interface/en0/SleepProxyServers
2016-10-02 19:39:25.317989+0100 localhost apsd[93]: (CoreDaemon) <APSTCPStream: 0x7fad06c268b0>: Configuring request for sleep proxy keep alives for environment production
2016-10-02 19:39:33.743868+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | SleepWakeCallback | entered. messageType=0xe0000320, gPerformSleepWakeActions=1, userSwitchedOut=0, protectScreen=0, screenIsLocked=0
2016-10-02 19:39:33.743881+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | SleepWakeCallback | kIOMessageSystemWillPowerOn, isMainThread:1
2016-10-02 19:39:33.745108+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | SleepWakeCallback | return from LWMessageTracerInitSystemWakeTime
2016-10-02 19:39:33.745109+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | SleepWakeCallback | return from LWMessageTracerSetTimeToWakeNotification
2016-10-02 19:39:33.745113+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | SleepWakeCallback | return from LWMessageTracerSetTimeToWakeNotificationExit
2016-10-02 19:39:33.745114+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | SleepWakeCallback | exiting
2016-10-02 19:39:33.683611+0100 localhost kernel[0]: PMRD: prevent idle sleep list: IODisplayWrangler+ (1)
2016-10-02 19:39:33.683612+0100 localhost kernel[0]: prevent idle sleep list: IODisplayWrangler+ (1)
2016-10-02 19:39:33.746590+0100 localhost loginwindow[110]: FaceTimeNotificationCenter | kLWDBLogScreenLockAndPower | __RegisterSleepWakeCallback_block_invoke |
IOPMScheduleUserActiveChangedNotification received:1
2016-10-02 19:39:33.747648+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | -[LWScreenLock lowerShieldWindow] | calling CGSSessionIDSetSleepWindowID with shieldID and authWindowID set to kCGNullWindowID
2016-10-02 19:39:34.258550+0100 localhost blued[104]: (IOBluetooth) [com.apple.bluetooth.CBManager] bluetooth_sleepHandler IOPMIsAUserWake
2016-10-02 19:39:34.263481+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | SleepWakeCallback | entered. messageType=0xe0000300, gPerformSleepWakeActions=1, userSwitchedOut=0, protectScreen=0, screenIsLocked=0
2016-10-02 19:39:34.263486+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | SleepWakeCallback | exiting
2016-10-02 19:40:18.501295+0100 localhost loginwindow[110]: FaceTimeNotificationCenter | kLWDBLogScreenLockAndPower | __RegisterSleepWakeCallback_block_invoke | IOPMScheduleUserActiveChangedNotification received:0
2016-10-02 19:40:18.439656+0100 localhost kernel[0]: PMRD: prevent idle sleep list: IODisplayWrangler- (0)
2016-10-02 19:40:18.439658+0100 localhost kernel[0]: prevent idle sleep list: IODisplayWrangler- (0)
2016-10-02 19:40:19.493589+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | LWDisplayWillSleepCallback | entered. isMainThread:1, gPerformSleepWakeActions = 1
2016-10-02 19:40:19.493751+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | -[LWScreenLock enqueueScreenLockAction:requestedBy:] | calling screen lock directly for lock from display sleep
2016-10-02 19:40:19.499582+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | -[LWScreenLock raiseShieldWindowWithFade:] | calling CGSSessionIDSetSleepWindowID with just shieldWindowID: 3641
2016-10-02 19:40:19.497902+0100 localhost loginwindow[110]: ScreenLockAndPower | kLWDBLogLevel_Internal | LWDisplayWillSleepCallback | exit