Piston Won't Turn Off


#1

1) Give a description of the problem
I wrote this (my first) piston to change my Osram light strips for the holiday. The piston does change the colors as expected, but I can’t turn the lights off! They just come right back on.
2) What is the expected behavior?
The lights should turn off when I turn them off with the Smartthings app.

3) What is happening/not happening?
Lights come right back on,

4) Post a Green Snapshot of the pistonimage


#2

What if bulb 11 “changes” to off instead of “is” off?

Do the same for the on line maybe? Changes to instead of is. I might be missing what your trying to do.


#3

you should move all of the wait 1second turn off to the else section of the whole sector.

If RGB switch is on
xyzxyz wait wait wait color etc

else:
wait 1 second
turn off


#4

Thanks guys. I tried both (at least I think I got the idea) and neither worked. I just want the light to turn off when I turn it off with the app, but it just comes back on again. It’s driving me crazy.


#5

Maybe separate the two actions of on and off between 2 pistons. If that works, you can work on combining them.

How quickly are you turning the switch after turning it on? Just curious.

If you get bored, post a log.


#6

Didn’t think of using two pistons. I’ll try that. I was waiting a few cycles to turn off after turning on.


#7

Give this a try and see if it does what you want it to?

Changed your conditions to triggers. Also pulled the nested IF statement for ‘off’ out of the ‘on’ statement so it’s independent.


#8

Thanks! I will try that. I did get it to work by increasing the time to five seconds. Maybe the 2-3 seconds was not enough for the off command to take hold before the next round of execution?
Sorry for the newbyness, but how did you change the conditions to triggers?


#9

No problem! Still pretty green myself - only started with this whole thing a couple weeks ago. :slight_smile:

To change to triggers, when you’re choosing your building your IF statement, use one of the lower selections:

There are times to use either one… @bangali made a nice write-up on them here:


#10

If your looking for a holiday light piston why not take a look at this