3 ms·
It's not open source, but the good news is it's relatively simple. My bulbs are Hue bulbs which use their bridge/hub, which just plugs into ethernet and provide
by jffry 5y ago
It's not open source, but the good news is it's relatively simple. My bulbs are Hue bulbs which use their bridge/hub, which just plugs into ethernet and provides a REST API.
The basic loop, run once per minute is:
- Make one API call which returns the id/on/off/brightness of every bulb
- For each bulb that is on, set its color temperature (this has to be one API call per bulb because there is no way to bulk update a list of bulbs. Bulbs can be put into at most one "room" and you can bulk set a whole room but not a subset of bulbs in that room)
As far as scheduling color temperature goes - I just define a few keyframes based on minutes since midnight local time, and then linearly interpolate to get the color temp. Over 24 hours the steps are so small that the change is basically imperceptible.