yes, that exactly what I would mean (sorry if I was not clear) and it works perfectly like this inside the every event or inside other event since events are considered like a single block…
But if I use the same stays condition inside a simple if statment, it does not start a timer or a schedule to see if the variable stays to a value… it just check if the variable was at this value for the period specified… so let say a have a variable = 1 since few hour and the piston execute the stays (for 5 minutes) condition, it automatically execute the condition. If the variable is set to 1 only 2 minutes before executing the stays condition, it will not do anything because it check if the variable was at that value in the past 5 minutes…
I made some test and it looks like this to me, I was just wondering why the same condition is considered differently according if its in event or if statment…
That s also why using the if statment was causing some issue… The work around I found to this (still in test) is to use a global variable that is set to 0 and I use the ‘if happen every day at’ statment to turn this variable to 1 and to set the local variable to the time of the next execution. I changed the every event by a on change event with that global with the condition to be = 1. So inside this event I execute the same code as the every but at the end I set the global back to 0.
Looks great for now but it takes few days to test and be sure…
Let me know if you know why that stays act different in normal statment that in event… maybe I m doing something wrong! To test it I simply create a blank piston and add a every event at each 2 minutes and add inside the stays condition (1 minutes) and once triggered, 1 minutes later it send me the push notification I added. After that I changed the every event by the if happen every day at condition. The time of the execution is stored inside a variable and update (variable = addMinutes($now,2)) so the piston run every 2 minutes… and this way, the stays condition is always triggered directly at the same time of the piston… Should have an explanation, for now I simply think that is because the event is considered as a piston or as a separated block but not sure if it s the reason!
Thanks again!