Piston firing even with my only when restriction


#1

1) Give a description of the problem
Piston fired and turned on the outlet even when my mode was vacation mode that was specified in my exceptions.

2) What is the expected behavior?
Not to fire

3) What is happening/not happening?
(PUT YOUR INFO HERE)

**4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

And to specify it turned on at 7pm the even though mode was vacation.


#3

did you enable trace and look at the logs?


#4

What is trace?


#5

Found trace do the numbers represent the order it looks at a line of code?


#6

Are you certain that it was in vacation mode when it ran? I experienced something similar, I ultimately discovered that I had another routine that ran and changed the mode so it wasn’t really in vacation mode at the time.


#7

Positive. Checked the logs vacation mode went at 6ish the 7 pm triggered it. I’m sure I can fix this with a condition or extra IF statement or something. I just thought it was cleaner and simpler this way and ultimately want to know if it’s a bug or me not using the statement correctly.


#8

I’m no expert here with this…but I ran into the same problem and I believe after doing a bit of tinkering that I’ve figured out what is happening. Please test for yourself to confirm though.

What it looks like is going on to me is that the Restriction is not being checked when the Timer triggers (meaning Every Day at 7:00AM). The restriction is only checked when the Timer is initiated (when the Piston starts).

Basically what I’m seeing is that the piston will execute at the Time if the Restriction WAS false, not if the Restriction IS false.

So…for the long-winded explanation… When you started the Piston, Vacation Mode was likely Off. So the Piston put in a Task to Start and fully execute at 7AM. Later on you turned on Vacation Mode. But the task was already set to happen at 7AM and it does not look like (from what I can tell) that the Piston cares that the Restriction changed after the task was set to initiate.

I don’t know if there is a fix for this…or if you’re supposed to design your piston in a different way… Such as:

Every day at 7AM
Do
IF location mode is not vacation
Turn on your lights…or whatever…

But it certainly seems like to me that Restrictions are evaluated when the Piston STARTS the Timer not when the Piston EXECUTES the Timer…which certainly is backed up by the results I’m seeing and from this post as well.