SHM Arming piston (after 10 minutes)


#1

1) Give a description of the problem
Trying to make sure that my piston only arms SHM if we’ve been away from the location for 10 minutes. If

2) What is the expected behavior?
If both my wife and I leave the area, the piston will send a notice that SHM will arm in 10 minutes. If no presence is detected in those 10 minutes, SHM will arm. If it is, the piston will cancel and notify that SHM did not arm.

4) Post a Green Snapshot of the pistonimage

Basically, this piston was working great until this morning, when my wife took the dog for a longer then usual walk, and the system didn’t have time to react to her leaving and returning, because Life360 didn’t pick up the new location update so soon. I’m trying to find a way to prevent issues like this going forward.


#2

What exactly happened this morning? It didn’t detect that she returned, so the system armed? Or it didn’t detect she left, so it didn’t arm when she was away?

If Life360 is the limitation, it might be difficult to write a piston around its shortcomings in specific scenarios.


#3

She took her phone with her to walk the dog, but went just outside of the boundary area. Life360 detected it as her leaving home, so SHM armed itself as it should. She came back into the area, but Life360 hadn’t updated yet. So by the time she got to the front door, SHM was still armed, and it set off an intrusion alarm when she came in.

I’m trying to make the piston wait 10 minutes, and see if the presence returns, before arming SHM for good.


#4

I think this will do what you’re after, while saving you from having to code conditions for every conceivable combination of events. Look this over and let me know if you want to give it a shot - I’ll help you sort out anything that doesn’t work quite the way you want it to.


#5

Thanks! It looks good, and I’ll give it a shot for tomorrow morning when we both leave home.

One thing I’m confused on though:

{occupancy} = {occupancy+1}

What does that do exactly?


#6

So this just finished running this morning. It notified when my wife left, and told me SHM would arm in 10 minutes, but no change. Logs below. She left home at 11:41, so it should have armed at 11:51.

7/12/2018, 11:51:47 AM +73ms
+1ms	╔Received event [Home].time = 1531410708407 with a delay of -1335ms
+246ms	║Runtime (46527 bytes) successfully initialized in 50ms (v0.3.105.20180628) (243ms)
+247ms	║╔Execution stage started
+299ms	║╚Execution stage complete. (52ms)
+300ms	╚Event processed successfully (300ms)
7/12/2018, 11:41:48 AM +227ms
+1ms	╔Received event [Mari].presence = not present with a delay of 57ms
+109ms	║Runtime (46522 bytes) successfully initialized in 43ms (v0.3.105.20180628) (107ms)
+110ms	║╔Execution stage started
+144ms	║║Executed virtual command sendPushNotification (9ms)
+165ms	║║Executed virtual command setVariable (3ms)
+188ms	║╚Execution stage complete. (79ms)
+190ms	║Setting up scheduled job for Thu, Jul 12 2018 @ 11:51:48 AM EDT (in 599.991s)
+197ms	╚Event processed successfully (197ms)

#7

That simply adds 1 to whatever the current Occupancy value is.

Sorry it didn’t work, and thanks for posting the logs! I’ll take a look at this after lunch and figure out why it didn’t work - we’ll get it running.


#8

I think the triggers based on the variables weren’t working the way I hoped they would. In this one I built in a different way for the piston to tell if the 10 minute window passed; this allows us to only use conditions for the IF statements that use a variable.

Let me know if this one works?