Issue with alert from multiple sensors and waiting for door to open


#1

1) Give a description of the problem
Hi Everyone, the problem I have is that I am trying to get an alert if two movement sensors are triggered within a minute of each other, and the front door sensor does NOT open within a minute of the two sensors being triggered. It needs to be setup like this so I get a genuine alert as someone approaches my house, but not to alert if that person is a family member who then proceeds to open the door and enter the house.

2) What is the expected behavior?
Expected behaviour is to alert if there is movement across two sensors but no contact opening within 20 seconds at the front door.

3) What is happening/not happening?
I never receive the alert.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)

20/03/2018, 17:36:17 +128ms
+10128ms ║Piston waited at a semaphore for 9958ms
20/03/2018, 08:54:32 +126ms
+0ms ╔Received event [Bushbys Park].time = 1521536073521 with a delay of -1396ms
+349ms ║RunTime Analysis CS > 19ms > PS > 287ms > PE > 43ms > CE
+351ms ║Runtime (40182 bytes) successfully initialized in 287ms (v0.3.000.20180224) (350ms)
+353ms ║╔Execution stage started
+362ms ║║Cancelling condition #10’s schedules…
+363ms ║║Condition #10 evaluated true (1ms)
+374ms ║║Comparison (time) 32072490 is_between (time) 32340000 … (time) 82800000 = false (7ms)
+376ms ║║Condition #11 evaluated false (12ms)
+377ms ║║Condition group #1 evaluated false (state did not change) (17ms)
+384ms ║╚Execution stage complete. (32ms)
+386ms ╚Event processed successfully (385ms)
20/03/2018, 08:54:13 +390ms
+1ms ╔Received event [Virtual movement front door].motion = active with a delay of 49ms
+105ms ║RunTime Analysis CS > 12ms > PS > 58ms > PE > 35ms > CE
+107ms ║Runtime (40192 bytes) successfully initialized in 58ms (v0.3.000.20180224) (105ms)
+108ms ║╔Execution stage started
+117ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+118ms ║║Cancelling condition #9’s schedules…
+119ms ║║Condition #9 evaluated true (5ms)
+120ms ║║Cancelling statement #7’s schedules…
+120ms ║║Condition group #7 made progress up the ladder, currently at step 2 of 2
+121ms ║║Cancelling statement #7’s schedules…
+122ms ║║Condition group #7 evaluated true (state did not change) (9ms)
+129ms ║║Comparison (enum) closed stays_unchanged = true (0ms)
+130ms ║║Adding a timed trigger schedule for condition 10
+132ms ║║Cancelling condition #10’s schedules…
+133ms ║║Condition #10 evaluated false (11ms)
+134ms ║║Condition group #1 evaluated false (state did not change) (21ms)
+136ms ║╚Execution stage complete. (28ms)
+137ms ║Setting up scheduled job for Tue, Mar 20 2018 @ 8:54:33 AM GMT (in 19.994s)
+175ms ╚Event processed successfully (175ms)
20/03/2018, 08:54:10 +573ms
+1ms ╔Received event [front cctv move].motion = inactive with a delay of 566ms
+139ms ║RunTime Analysis CS > 20ms > PS > 84ms > PE > 34ms > CE
+141ms ║Runtime (40035 bytes) successfully initialized in 84ms (v0.3.000.20180224) (139ms)
+142ms ║╔Execution stage started
+153ms ║║Condition #9 evaluated false (5ms)
+154ms ║║Condition group #1 evaluated false (state did not change) (8ms)
+156ms ║╚Execution stage complete. (14ms)
+157ms ║Setting up scheduled job for Tue, Mar 20 2018 @ 8:56:04 AM GMT (in 114s)
+167ms ╚Event processed successfully (167ms)
20/03/2018, 08:54:04 +566ms
+1ms ╔Received event [front cctv move].motion = active with a delay of 65ms
+149ms ║RunTime Analysis CS > 24ms > PS > 81ms > PE > 43ms > CE
+151ms ║Runtime (40023 bytes) successfully initialized in 81ms (v0.3.000.20180224) (149ms)
+152ms ║╔Execution stage started
+160ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+161ms ║║Cancelling condition #8’s schedules…
+162ms ║║Condition #8 evaluated true (5ms)
+162ms ║║Cancelling statement #7’s schedules…
+163ms ║║Condition group #7 made progress up the ladder, currently at step 1 of 2
+166ms ║║Condition group #1 evaluated false (state did not change) (10ms)
+168ms ║╚Execution stage complete. (16ms)
+170ms ║Setting up scheduled job for Tue, Mar 20 2018 @ 8:56:04 AM GMT (in 119.995s)
+177ms ╚Event processed successfully (176ms)
20/03/2018, 08:53:12 +387ms
+0ms ╔Starting piston… (v0.3.000.20180224)
+308ms ║╔Subscribing to devices…
+316ms ║║Subscribing to front cctv move.motion…
+330ms ║║Subscribing to Virtual movement front door.motion…
+344ms ║║Subscribing to Front Door Sensor.contact…
+438ms ║║Subscribing to Family Room Sonos…
+439ms ║╚Finished subscribing (147ms)
+458ms ║Cancelling condition #7’s schedules…
+465ms ║Comparison (enum) closed stays_unchanged = true (1ms)
+474ms ║Comparison (time) 31992853 is_between (time) 32340000 … (time) 82800000 = false (6ms)
+483ms ╚Piston successfully started (483ms)


#2

A couple things… There may be a bug with the “followed by” statement that the WC team is working to fix. There’s a thread in the bug reports section regarding it…

However, even if that was working you’d run into an issue with the “stays unchanged” part of your piston. That’s also a Trigger and you’re asking for too many things to happen all at the same time for that to work properly.

Just thinking here…but perhaps a better approach would be to go something like:

IF motion B changes to Active
AND
motion A is active (as long as your timeout value is >2 minutes this will work)
THEN
Wait 20 seconds
Check to see the last time the door was opened… age(device:contact)
and if it was more than your specified time
send your notificaiton

I use something similar (minus the wait part) to turn on lights if I’m going one way in my house and not if I’m going in the opposite direction. So I pass by Motion A first, so it changes to active and stays active long enough for me to pass by Motion B…so when that happens I know which way I’m moving and I can turn on the lights in the direction I’m going.