My first Piston, can you take a look?


#1

Hi!

I’m creating my first Piston and I would like someone experienced to please take a look at it.

It’s supposed to light all my outdoor lights at sunset, with a few seconds between each ligth. 10 minutes after sunrise I want them all to turn off, randomly again.

I think it looks weird at Line 36, “Time is before 10 minutes before sunriset”. Will it work like that or can I change it to something better?

Thanks in advance!


#2

Hi @twk

I have never used WAIT RANDOMLY so i wouldn’t know about that but when you use a TRIGGER and WAIT command after, in most cases you need to use NEVER CANCEL TASK.
Once your tigger is no longer TRUE the piston will stop…
Lets say your sunrise is at 6.32am (in the morning)
6.32.00.000 you piston will execute
but
6.32.01.000 it’s no longer TRUE and it will stop
so in theory you first light will turn on but the rest i am not sure…

once again WAIT RAMDOM command may have different way of functioning???


#3

Thanks for the reply!

I found WAIT RANDOMLY in another Piston when googling. I haven’t tried if it works yet. It’s hard for me to try this Piston since sunrise and sunset isn’t that often and I’m not always home.


#4

you can test it with a different time and/or simulated switch


#5

For your off time, you are probably better using the same as your on, I.e., happens daily at 10 minutes after sunrise.


#6

I have reworked the Piston and added virtual devices instead, I will spare my neighbors my blinking exterior ligths :slight_smile:

It’s looks like this now:


I will keep it running for the next couple of days and watch the log in Smartthings to see if the virtual switches have turned on and off at the right times.