Need help altering piston


#1

1) Give a description of the problem
Piston is designed to illuminate kitchen and livingroom to 1% between 12-6am on motion detection wait 1 minute and then turn them off.

2) What is the expected behavior?
Would like to change it so that if the light is switched on manually (brighter than 1%) during 1 minute wait period to cancel turn off command

3) What is happening/not happening?
at the moment with the piston in its current state turning on the lights brighter than 1% will still get turned off after 1 minute wait is done.

4) Post a Green Snapshot of the pistonimage

please tell me how to change this piston to behave as I desire


#2

Try changing your task cancelation policy to the default setting, then throw in an extra condition that says “and light level(s) have not changed in the last 1 minute” and see if that works?

If you’re concerned that one minute lockout might prevent the piston from executing when you want it to, you could take it a step further and inside your WITH statement set a variable called LastRun to $now. Then instead of your IF condition being “in the last minute” you could write it “light label has not changed after LastRun”. That will force a condition change and should make your piston cancel all pending tasks.


#3

really appreciate the response, although I have some experience with creating pistons, while I understand what you want me to do I have no Idea how to write it or what to click on. Could you further elaborate on what to press inorder to setup that variable inside the WITH statement Lastrun to $now. or, and I hate asking this because I would love to learn, could you set up a template for me


#4

Of course! I’ll throw something together with a few screenshots and explanations in the next few hours. I have some stuff I need to take care of at home first.


#6

Start by changing you Task Cancellation Policies back to the defaults. I’m not sure if you set these on your own or imported someone else’s piston… so here’s a screen grab on how to change it. Click on your IF statement, then click the gear icon at the bottom to expand the settings:

Repeat the steps above except clicking on your WITH statement.

I think this should be enough to solve your issue. If it’s not, we’ll try something with variables to strengthen it. For some reason everything I have tried tonight wasn’t working though - so I’m hopeful the simple changes above will do it.


#7

I purposely added the task cancellations because what would happen is either the lights would stay on and not shut off after the wait or they wouldn’t come back on the second time after motion was detected again. I cant remember exactly but that why I had to add them. so sorry for the late response I’m just seeing this, so I guess we need to leave the task cancellations in and go to your plan B.