Greetings KSchullerToronto,
I understand your iMac is entering and exiting sleep repeatedly. That does sound troublesome. The following article provides troubleshooting steps which you may want to explore:
OS X Yosemite: If your Mac won’t go to or stay in sleep
If your Mac won’t go to sleep or stay in sleep, here are some possible solutions:
If your Mac doesn’t go to sleep when you expect it to, or if it wakes up unexpectedly, you may need to change your sleep preferences. If that doesn’t work, something may be waking your Mac.
-
Check your system’s sleep settings:
Make sure the sleep settings are set the way you want. To view sleep settings, choose Apple menu > System Preferences, then click Energy Saver.
Drag the slider to set the amount of time that should pass before your computer goes to sleep. For more information, see Schedule a time for your Mac to turn on or off or go to sleep.
-
Check your system’s network access setting:
Other users may be waking your Mac remotely to use its shared resources. If you don’t want this to happen, choose Apple menu > System Preferences, then click Energy Saver.
Then deselect “Wake for network access.”
-
Check your system’s Bluetooth settings:
Bluetooth devices can wake your Mac. If you don’t want a Bluetooth keyboard or mouse to be able to wake the Mac, choose Apple menu > System Preferences, then click Bluetooth.
Click Advanced, then deselect “Allow Bluetooth devices to wake this computer.”
-
Check your system’s sharing preferences:
People using shared services on your Mac can prevent it from sleeping. For example, they may be using a printer connected to your Mac or accessing shared files stored on it. To check to see that you’ve enabled the right set of sharing preferences, choose Apple menu > System Preferences, then click Sharing.
Then turn off any services you don’t need to use by deselecting the On checkbox next to the service.
-
Check to see if something else is waking your Mac:
Check any of the following:
Unexpected keyboard presses or mouse and trackpad clicks: Key presses and mouse or trackpad clicks can wake your Mac. If your Mac wakes when you’re not present, something may be pressing the trackpad or mouse button, or keyboard keys.
Apps: Apps that access a disk can keep your Mac from going to sleep. For example, iTunes accesses your disk to read the songs it plays, and DVD Player accesses the optical disc drive to play movies.
Spotlight indexing: If Spotlight is indexing your hard disk, your Mac won’t go to sleep. Click the Spotlight icon on the right side of the menu bar of your Mac to see if Spotlight is indexing. Indexing can take several hours, depending on the number of files on your Mac.
Connected storage and devices: Malfunctioning USB, FireWire, and Thunderbolt storage and devices may keep your Mac from going to sleep. Disconnect those devices and see if your Mac goes to sleep. If it does, reconnect each item, one at a time, until you find the one that’s malfunctioning. Contact that device’s manufacturer for more information.
If these steps above provide no results, your iMac may need to be serviced. The following link should help you get started with the process and has links with additional information on topics such as warranty and service pricing, battery replacement, and express replacement service.
Apple - Support - Service Answer Center
Thank you for contributing to Apple Support Communities.
Best,
Bobby_D