It’s a presence sensor with a trigger on events from the presence sensor, and then a switch for setting the variables. I just don’t want it changing the variable too frequently. Sometimes my presence sensor freaks out and changes back and forth a couple times, meaning, I’ll arrive home and it changes to present, then not present, then back to present again. This causing my automations to be all weird, so I’m hoping to just catch the initial change which is always correct. I thought about trying to use a time delay such as IF presence sensor stays present for 10 seconds
, but I’m not sure how to do that in this piston either.
What I’m trying to achieve is something where the piston still executes because of the trigger, but it just doesn’t change the variable because it hasn’t been long enough yet. I figured if I did on events
from presence sensor’s presence, IF
current time is greater than last run plus 5 minutes, set variable
, else
exit.
EDIT: You can see the “lastrun” variable I had been playing with, I forgot to pull that back out. This is my test piston.