Do you have Bluetooth turned on and if so, in the advanced tab of the bluetooth preference panel to you have the checkbox checked that allows bluetooth devices to wake your computer?
I had a similar problem and found that my magic mouse was preventing hibernation with the lid open.
knodi was close, but pmset sleep 180
does not mean "180 x display sleep time" it simply means 180 minutes.
Before you change any of your pmset
settings, I would take note of your current settings. If you enter this line in Terminal.app:
sudo pmset -g live | tee -a ~/Desktop/original-pmset.txt
it will show you the current pmset
settings and it will also save a copy to ~/Desktop/original-pmset.txt so you can keep it as a reference.
Manipulating computer sleep time with pmset
If I want my MacBook Air to go to skeep after 60 minutes of idle time when it is plugged into wall/AC power, I can set that using:
sudo pmset -c sleep 60
Similarly,
sudo pmset -c sleep 0
tells my MacBook Air not to put the computer to sleep, even if the display goes to sleep.
If I wanted that same setting for when the MacBook is on battery power (not AC/wall power), then I would use
sudo pmset -b sleep 0
I can also set different sleep times for disksleep
and displaysleep
(You can read more about pmset at https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/pmset.1.html or man pmset
in Terminal.)
I would be very interested to know if sudo pmset -c sleep 60
(or whatever value you choose) actually works for a Haswell-based MacBook Air.
Best Answer
Thanks for your help Graham, but I decided to take a look at my logic board and found some places that had been corroded. I removed my logic board and gave it a good clean with isopropyl alcohol and a toothbrush and for now my mac has stopped going to sleep on its own, also fans are back to normal.