Dim to warm piston with Hue RGB


#1

1) Give a description of the problem
Not a problem per se, just not sure the best way to approach building a piston that will vary the color temperature of a bulb based on brightness level to mimic the behavior of an incandescent bulb that gets warmer as it gets dimmer.

I would like this piston to basically “watch” all the bulbs in my house so that any other piston I have only needs to set the level and then this other piston will take care of setting the correct color temp.

2) What is the expected behavior?
Above basically covers it. More specifics for my use case. I run a routine that sets a global color temperature and level variable based on the time of day. For example, at noon, set @TOD_Level to 100% and @TOD_Temp to 5400k. Or at 11 pm, set @TOD_Level to 45% and @TOD_Temp to 2200k, etc etc.

Then, all my other pistions reference this variable. For example, when kitchen switch button #1 is pressed, set Kitchen Hue level to integer(@TOD_Level), set Kitchen Hue temperature to integer(@TOD_Temp).

But, as I re-design everything I realized if I had a dim to warm piston that watches all bulbs in my house, I then would only need to reference the single @TOD_Level variable.

3) What is happening/not happening?
I have not started designing this yet because I know enough about my skills to know there will be a much better way of doing it than I can think of. I would love for the color temp to be continuously variable based on the level settings within high and low bracket temps that I can easily adjust to see what colors feel best at certain levels (ie a low of 2200k and a high of 5400k). Also, I wonder if using a logarithmic function to define what temp at what level would be better than a linear approach?

Hope this makes sense. Please let me know if you have any questions or need any additional information. Really appreciate the help!

Kevin


#2

So replying to my own thread, I think Rainbowvalue could do what I need. All the examples I have seen specify a color w/ hex values. Can I use this command with color temperature? I tested below but it does not work. The color does not change with the level change. If I substitute hex values with set color, this expression does work. I would prefer to work with color temperature because I am a photographer and can relate much better to color temp and I also have some bulbs that are not RGB. Am I missing something?

Thank you!


#3

might be simpler to use this:

2200 + (((5600 - 2200) * [Office North : level]) / 100)