This is annoying. I put my iMac asleep and it will wake itself up. That wasn’t much of an issue in earlier OS versions as there was an option underneath the login button to cancel. In Sonoma you have to log in and then put it to sleep again. I don’t know why it’s happening. I don’t have a screen saver so that shouldn’t be an issue.
Is there anyway I can stop it. (I know I could do a shut down but then I have to wait for it to boot and that’s not ideal.)
There are two different sleeps. If you put the computer to sleep, I believe the processor only runs at a minimal level until you wake it or you have ‘wake for network activity’ set and there is a network trigger like incoming email. When that happens, I think the display will also attempt to wake, giving you the prompt that you used to be cancel, but can no longer do so.
However, there is also Display Sleep. This does not throttle the processor, but does keep the display dark. You can trigger that by setting a Hot Corner for it using the button in the lower right corner of the Desktop and Dock settings panel. If you move your cursor to the set corner, the display will go dark, and I believe will stay dark until there is a keyboard or pointing device trigger.
I believe that this is the better choice for what you want. But I could be wrong.
There is another sleep function - it is Power Nap and its setting in found in System Prefs Battery. Switching this on allows system updates, email downloads, calendar, iCloud, and Time Machine cleanups (compressions of hourly, daily, and weekly into backup file dated 2-5 weeks per month) activity.
When Power Nap turned off and while you are actively using you computer, these updates are applied while you trying to get your work done. When turned-on, your computer is freshened up and ready to go in the morning.
The benefit to Apple is that its output computer load to millions of users will be leveled out as the sun flies around the globe.
I had this once some years ago, well before Sonoma times. For no rhyme or reason an iMac would wake up from sleep. One day we detected that it also woke up when somebody in the next door bathroom switched the electricity off. Our electrician explained it was a minor earthing problem. It also happened when we pulled a USB cable whilst the iMac was in sleep, but this is expected behaviour.
Earthing fluctuations can be normal, not much you can do about it, also not a safety issue. We ignored it and many months later the problem had disappeared.