As mentioned here in a previous post about circadian-adaptive lighting, I've been searching for a user-friendly way to use off-the-shelf RGBW LED lighting in the home to reinforce healthy circadian rhythms for some time now.
After doing a bit of research, talking with engineers from the CLA / Philips / Zigbee camp, and some digging around in the LIFX developer forums, I eventually decided I had to roll my own.
Running the controller is pretty simple - users edit a JSON LUT that describes an arbitrary number of scenes. Each scene gets a name, start time, a HSB value, and a white point. The system, once daily, pulls that LUT in (daily in case you've changed it since you ran the daemon), and localizes it based on the latitude and longitude you've provided.
If you set the 'extended-sunlight-mode' flag to True, the system will move your scenes named 'sunrise', 'sunrise-end', 'noon', 'sunset', and 'twilight' to the times they would occur on the longest day of the year (June 21-ish) for your location - that's crucial for people who experience the winter blues or just like to keep a regular schedule year-round.
With the flag set to False, those events (if they exist in your LUT) will be localized to match the outside lighting conditions.
Here's the LUT I've been running:
{ "states":[ {"name":"overnight", "start":0.0, "hue":0, "sat":1.0, "bright":0.02, "kelvin":2500}, {"name":"overnight-end", "start":0.20, "hue":0, "sat":1.0, "bright":0.02, "kelvin":2500}, {"name":"sunrise", "start":0.3125, "hue":30, "sat":1.0, "bright":0.65, "kelvin":2800}, {"name":"sunrise-end", "start":0.3535, "hue":30, "sat":0.6, "bright":0.7, "kelvin":3300}, {"name":"mid-morn", "start":0.4166, "hue":30, "sat":0, "bright":0.8, "kelvin":4000}, {"name":"noon", "start":0.5416, "hue":30, "sat":0, "bright":1.0, "kelvin":5500}, {"name":"mid-day-end", "start":0.7016, "hue":30, "sat":0, "bright":1.0, "kelvin":5500}, {"name":"sunset", "start":0.8125, "hue":50, "sat":1.0, "bright":0.55, "kelvin":5500}, {"name":"bed", "start":0.9375, "hue":20, "sat":1.0, "bright":0.05, "kelvin":2500} ], "lat":40.677459, "long":-73.963367, "extended-sunlight-mode":"True" }
The system is designed to be daemonized — I'm running it on an RPi. It hosts a bootstrap controller at port 7777 from which you can switch the lights on and off without interrupting the current transition. (Unfortunately, the current implementation of the LIFX HTTP API lacks the ability to put a power state change without interrupting a non-power-related put in progress.)
I plan to add a 'bypass' toggle to the controller that allows the user to manually control the lights again, and perhaps implement something to let you enumerate the lights you want included in the data.json - right now it acts on all LIFX lights connected to the API token you provide.
Next big feature after that is Philips Hue support ...
You can check out the repository here ... please let me know about all the bugs you find and features you want.