1) Give a description of the problem
I have lots of pistons, which control a bunch of Hue and LIFX lights in various rooms. I would like for those lights to have a color temp at 7500k in the morning and 3000k in the afternoon.
It sounds easy, but I have had challenges with getting this to work reliably or in a desired manner, partially because setting the color temp causes the lights to turn on.
This means that I have to include the color temp logic in every piston I create which makes it complex to maintain and easy to make easy to make mistakes.
- Desired result
One thought I had on how I would solve this was to create a function (separate piston) and pass the lights being switched on through the color function. This function/piston would then then take the device object as an input, check the time of day, and set the appropriate color temp of the light object passed. OR maybe I create a piston with a trigger which fires anytime time light X turns on which then executes the color/temp time stuff - but then I think I would need a piston for every individual light bulb, which again seems like a lot of code.
The problem is when I take an action, such as changing the color, I have to specify the exact device instead of an input variable. Otherwise if I had a piston which says IF Lights A, B, or C power on, the action will power on all the lights in the target section instead of just the one that powered on.
I can’t be the only one who has had this thought. Is there a way to do this without adding the color temp/time logic to every piston I create? Does anyone have examples of how they deal with this?
Thanks for your help!