How to prevent light on trigger if already on


#1

1) Give a description of the problem
I can’t figure out how to keep the light on if it is already on.
2) What is the expected behavior?
I want to ignore the trigger to turn off the light after x min if the light is already on.

3) What is happening/not happening?
The light goes out as instructed.


#2

Although the piston looks pretty straightforward, I’d start out by removing all the extraneous if/then statements (as below). If it still turns the light off unexpectedly, a log should be able to tell us what’s happening.

index


#3

I will clean up the extra statement, thanks. I’d like to add that if the light is already on and the door sensor is triggered during the set time frame that it doesn’t turn off after the set timeframe. Any suggestions on this portion?


#4

I’m not quite clear what you’re saying. However, you should note that piston is going to reevaluate every time the door contact changes (opens or closes), and that will cancel any pending tasks and reschedule them. In order to change that, click on ‘with’ and then on the cog at the bottom of the pop-up. Change Task Cancellation Policy to ‘Never Cancel Tasks’. See if that gets you closer to what you need.


#5

Basically, I only want this piston to trigger if the light is off. If the light is on when the door is opened, then ignore the timer. I don’t want someone home watching TV late at night and then the door opens and turns off the light after 10 min.


#6

Next time it fires unexpectedly, post your logs.


#7

I was able to get the piston to work as I wished. If the light is currently on and the front door sensor is open between 10:30pm and 2:00am, then do nothing, else turn the light on, wait 5 min and then turn off.