Wake Me Up!

Wake me up!

Alarms are alarming. They’re super fine and useful if you really need to be up at a certain time and it’s hard for you to hit it. Otherwise, they are the harbingers of morning terrorism.

I got my lights to slowly turn on to tell me it’s time to get up. It takes 15 minutes to go from 0 to full brightness, at the time I specify.

I’m finally back on a hacking/automation kick. For a number of reasons which I won’t write about, for everybody’s sake, It’s been a while. This is nowhere near the intentions I have for the Plum Garage controller/automation system, but it’s the sort of results I want to see.

This small hack took two steps, first was the python script to slowly open the lights (based on my python-hue work) and the second is running that on a cron job on a raspberry pi. That’s it.

Script wakemeup.py:

#!/usr/bin/env python

from hue import Hue

def wakemeup():
    h = Hue()
    h.station_ip = '192.168.42.89'
    h.get_state()

    minutes = 15
    transition = minutes * 60 * 10

    h.lights['l1'].off()
    h.lights['l1'].set_state({
        "on": True,
        "bri": 255,
        "transitiontime": transition
    })


if __name__ == "__main__":
    wakemeup()

Cron Task:

45 6 * * * /home/pi/python-hue/wakemeup.py

Comments and Messages

I won't ever give out your email address. I don't publish comments but if you'd like to write to me then you could use this form.

Issac Kelly