Wait 30sec before run piston again?


#22

Your advice is spot on, @Pantheon

An unset boolean is seen as either “false”, or “not true”


#23

It was not :roll_eyes: now it is


#24

Thanks @Pantheon and @WCmore. Changed it like this.


Going to test soon.


#25

Ok I got it!! Finally!

it’s important to find right spot for the wait and second set variable commands.

Thanks you: @Pantheon @WCmore @ike2018 and @Terminal


#26

It’s always nice to see what the “C” in webCoRE stands for… :sunglasses:


#27

Good job!!!


#28

also tagging @WCmore, @ike2018
I’ve got a piston with a similar issue. The piston sends push notifications based on location changes from the webcore presence sensor.

I was having issues where I’d get home, receive a notification that i’m home, but then receive 1-3 more immediate notifications that I’m now Away, then Home, then Away. I’m not sure why, but I figured that if I set my {LastNotice} time variable to $now as you recommended, and wrap my piston with an IF statement that checks if it’s been 30 seconds, i can avoid the wave of notifications. It does indeed work (I had initialized LastNotice for a different method prior to using this check), but then I had some issues when I created a duplicate piston and things weren’t running.

The duplicate piston with unset variables was checking LastNotice (unset by the piston, but still had a time value in the log), finding that it was less than 30 seconds, then cancelling the piston. Never got to the step to properly set LastNotice to $now. Went about a day or two without getting my notifications and noticed this issue in the logs.

So now I figure I should start with a check to ensure that LastNotice has a value and I’m stuck. Someone suggested I use an expression to check that LastNotice is not null. But the problem is, initially LastNotice isn’t “null”, it just says “(not set)”. Other system variables do have the value of “null”. And anyway, like I said when the piston runs with uninitialized the LastNotice variable does have a value somehow.

Is there a proper way to check if my datetime variable has been set? I was able to get my piston going by manually setting it, but if I share this with people I’d like to not require them to do that.


#29

Perhaps you could check if the datetime variable is not between $now +/- some amount of time. If not set it to $now to intialize.


#30

It could be many things, maybe piston you have etc but just remember, GPS signals DO JUMP. Meaning, if you refresh your phone location every 20 seconds, sometimes you will see that you are on the next street, while actually still home.

Try to create a bigger home circle so you won’t get effected by jumps.