My iMac went to sleep on me again yesterday, for 2 hours.
Since this is the third time this has happened to me in the last several months, when I called Apple, they immediately elevated me to a level 2 tech agent. The only problem with this was it took me 15 minutes to convince him that you could prevent a one-year-old iMac running 10.10.2 from going to sleep. He was convinced that it was no longer possible. But after he was able to prevent his own machine from sleeping when the display went to sleep, then he was a wee bit more helpful.
In any case, the only thing he ended up telling me to do that I hadn't already tried was to check the box that says,
Wake for network access. He theorized that since my VP2 console is uploading data via IP that this should prevent the thing from going to sleep and if it did go to sleep it should wake right back up.
I have tried resetting the SMC, Restoring the Defaults in the Energy Saving Preferences, and reinstalling Yosemite.
Why is your Mac going to sleep - it's changed a little bit in 10.10 - you need the 'Prevent Computer From Sleeping Automatically When The Display Is Off' tick-box ticked in the Energy Saver Prefs pane (I'm guessing you already know this ).
If you go to the Console.app, select 'Diagnostic and Usage Messages' then enter 'power' as the search term, it'll display all log entries to do with power related events - there may be something there that can help diagnose why.
See the attached screenshots for the last messages from the console before it went to sleep and for the current
Energy Saver settings.
By the way, he told me Apple recommends you do NOT check
Start up automatically after a power failure because they want you to manually startup once you know the power from the mains is stable. I told him I thought that was silly if you have a decent UPS and told him he could quote me to Tim Cook should the opportunity arise.