0

I wrote a a python script to check the tmperature via API call and then change the color of my Philips Hue Lights regarding temperature and rain. The only problem I'm facing is that the whole thing runs - as a cronjob - on my MacBook Air(10.10.4) which is normally asleep at 6am.

Crontab and launchd is not a solution, because those don't wake the Mac. I tried a scheduled wake up with Energy Savers's schedule but due to the mac is closed it immediately falls asleep again. I thought about using caffeinated with a cronjob that runs a minute before the actual script to keep the MacBook alive(after the schedule from the energy saver kicks in) but no success.

There is a third party solution which also didn't work for me: power manager

The only thing that should work is to "prevent computer from sleeping automatically when the display is off" in the energy saver preferences. The computer is most of the time on the charger so this would work. Although there is a slight chance that I forget to not close the lid before going to sleep at night ;-)

so any solutions which do not include buying a mac mini for automatic tasks like this :-)

br.kg

1 Answer 1

0

You can use NoSleep: https://code.google.com/p/macosx-nosleep-extension/

It does what it says on the tin ...

Or, if you don't want to install that, just turn on internet connection sharing, and leave it plugged in. This stops the Mac from sleeping

1
  • thx! I tried it and so far it seems to work. I would love to see a other solution, where the system wakes up and goes to sleep after a defined time period again, but so far this solves my problem!
    – bausi2k
    Commented Jun 14, 2015 at 18:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .