Whole House Light Show Help Needed


#1

Crazy request, but any suggestions for how to trigger a whole-house “light show” with lights all over the house going on and off at random and for random (fast) intervals? I want to hit a virtual switch and have the house appear to be “possessed”. House has GE Z-wave switches all over the place for the lights.

I tried to create a simple piston that used the emulated flash command, but it seems like I had to mess around a lot with the durations to get it to work (maybe that’s a limitation of Smartthings… it can’t handle fast flashing?)

Would like to have some random-ness in the piston… intervals/number of flashes and which lights could all be randomized… I would guess I would need to set up some async “For Each” or “Repeat” loops?

Any advice or sample code snippets would be appreciated.


#2

Well, not exactly what you are looking for, but an example I can provide.

This piston I enable during Christmas time. It sets the colors of my exterior lights to red/green. It goes through the list of lights, sets randomly to red (random value < .5) or green (random value > .5), and after a random 2-7 seconds goes to the next light in the list and repeats. Net result is that it looks random even though it cycles through the lights in the same order because it may or may not change the color for any given light.

Again, not the fast flickering you are looking for, but maybe a place to start…


#3

Cool, thnx, will mess around with it to see if I can adapt it for my needs.


#4

Here’s what I have working so far… but I’m stuck… how do I get the flashing to STOP when I flip the swtich off? Is there a way to interupt the flash command once it’s already started?
Also, would there be a better way to have this continue looping and flashing while the switch stays on? This will only trigger once when the switch is turned on… preferable the light show would continue until the switch was turned off.


#5

That’s the repeat part in my example:

repeat
do
your flashy stuff
until
switch is on
end repeat

I see you have all the switches doing the same thing, since they are all in the same WITH statement. I wonder if you could switch to a “for each” like I used so they are more independent. Maybe if it the piston was set for asynchronous it would go from one switch to the next without waiting for the previous switch to finish it’s flash routine?

Just guessing here. :slight_smile:

milhouse


#6

So I’m under the impression that the calls I make to generate a random OnTime and OffTime are made independently for each of the lights in the WITH loop… to add some randomness to the effect… am I wrong about that? Do the OnTime / OffTime variables stay the same for each light in the WITH loop?

I still can’t figure out how to get the flashes to stop when the switch is turned off… it seems they will continue until they reach the value for NumTimes no matter what. I tried to issue another Flash command when the switch is turned off to see if it would over-ride, but it doesn’t.

I may need to change this to Turn On/Turn Off statements in a loop instead if the Flash command can’t be interrupted mid-way through.


#7

I think that using the WITH you’d only get the variable set once, and used for all devices. It sends the signal once and includes all device in the command. If you’d use a FOR EACH then the variable should get set multiple times because each command is one device. If you want to test, set the values to something high that you can actually observe, like 10 seconds vs 20 seconds depending on the random variable, and see if they’re all the same.

I am fairly certain you are correct in that the flash command cannot be interrupted.