Fade light at time piston acting funny!


#1

I’m actually thrilled there’s now a whole site dedicated to webcore Qs.

So, I have the following piston to dim my media room lights at 7pm if the level is greater or equal to 31%.

However, when it runs, it starts to fade, then the level bounces up and down a bit. Here’s the result log:

Can anybody shed any light on what’s happening here?


#2

And here’s the result, because it said I can only put in one image as a new user :frowning:


#3

I’ve had issues with this as well - I’ve got some night time indoor hue lights that I set to a certain color, but I don’t want them to A. Go straight to 100%, B. Do it instantly. C. Start on the color I want - if I have them doing something different during the day, the first time they come on at night, they flash the last color and jump to the new color. Interestingly - and semi-unrelated - this particular set of actions are almost instantaneous, but if I tell them to ‘turn off’, I think there must be some built in fade mechanism upon receiving that command will fade over whatever time they set at the manufacturer. If I try to fade to off or fade to 0% - and this seems to be true of most of the lights I’ve tried - they kinda wig out. I wonder if it would work better if you did a for loop or something with a delay…

Like (Probably syntactically wrong, but the idea being…):
for (i = 100(%); i > 0; --i)
{
set theLight to 99;
wait 1 second;
}

sorry - hit the submit on accident

Anyway, the fade timer - including colors - doesn’t seem to work without employing some sort of logic like the above and ‘mapping’ values since the above would take ~100 seconds… Imagine if you were going from color temps - 2500-6500!

On that note, is there a ‘map’ function?