Following motion around home


#1

I have multiple motion sensors through my home. In particular I have two for my hallway and steps. One is at the base of steps and other is in hallway upstairs.

What I want to do is track which fires first and then which fires second. Thus determining if we are going up the stairs and down the hall, or in reverse, down the hall and then down the stairs.

After they become inactive clear the variables and wait for triggers again.

By doing this I can turn lights on ahead of the path traveling from bedrooms to kitchen or vice versa.

Anybody have something like this running already that would like to share?


#2

You should use the ‘followed by’ option… build two conditions:

IF
motion x IS active
AND
motion y IS active

Click on the AND and select ‘followed by’

Click on the first condition and you’ll see new options to change the followed by timeframe.

So if landing motion followed by hallway motion, you are heading downstairs.


#3

Half way there.

This is going up stairs and down stairs it seems to work fine.

However. I must have a ghost here because I moved away from stairs and a minute later it checked again and after going down stairs. It reset the variable as if I went back up. I was in a total different room no where near motion detectors. They stay active for 1 minute, their blind time, the go inactive and start looking for motion again.

Piston:

Logs:

12/18/2017, 12:11:54 PM +188ms
+0ms ╔Received event [Hall Motion Lower].motion = inactive with a delay of 82ms
+75ms ║RunTime Analysis CS > 25ms > PS > 26ms > PE > 25ms > CE
+77ms ║Runtime (41536 bytes) successfully initialized in 26ms (v0.2.100.20171211) (76ms)
+78ms ║╔Execution stage started
+86ms ║║Comparison (enum) inactive changes_to (string) active = false (0ms)
+88ms ║║Condition #4 evaluated false (4ms)
+88ms ║║Cancelling statement #1’s schedules…
+89ms ║║Condition group #1 evaluated false (state did not change) (6ms)
+98ms ║║Condition #9 evaluated false (6ms)
+99ms ║║Cancelling statement #6’s schedules…
+100ms ║║Condition group #6 evaluated false (state did not change) (8ms)
+102ms ║╚Execution stage complete. (24ms)
+103ms ╚Event processed successfully (103ms)
12/18/2017, 12:11:45 PM +650ms
+1ms ╔Received event [Hall Motion Upper].motion = inactive with a delay of 234ms
+80ms ║RunTime Analysis CS > 25ms > PS > 33ms > PE > 22ms > CE
+83ms ║Runtime (41533 bytes) successfully initialized in 33ms (v0.2.100.20171211) (81ms)
+84ms ║╔Execution stage started
+95ms ║║Cancelling condition #4’s schedules…
+96ms ║║Condition #4 evaluated false (7ms)
+96ms ║║Cancelling statement #1’s schedules…
+97ms ║║Cancelling condition #1’s schedules…
+98ms ║║Condition group #1 evaluated false (state changed) (10ms)
+103ms ║║Comparison (enum) inactive changes_to (string) active = false (0ms)
+104ms ║║Condition #9 evaluated false (3ms)
+105ms ║║Cancelling statement #6’s schedules…
+106ms ║║Condition group #6 evaluated false (state did not change) (6ms)
+108ms ║╚Execution stage complete. (25ms)
+109ms ╚Event processed successfully (109ms)
12/18/2017, 12:11:45 PM +279ms
+0ms ╔Received event [Home].time = 1513620706857 with a delay of -1579ms
+83ms ║RunTime Analysis CS > 30ms > PS > 32ms > PE > 21ms > CE
+85ms ║Runtime (41535 bytes) successfully initialized in 32ms (v0.2.100.20171211) (84ms)
+86ms ║╔Execution stage started
+96ms ║║Cancelling statement #1’s schedules…
+97ms ║║Condition group #1 made progress up the ladder, currently at step 2 of 2
+98ms ║║Cancelling statement #1’s schedules…
+99ms ║║Cancelling condition #1’s schedules…
+100ms ║║Condition group #1 evaluated true (state changed) (8ms)
+103ms ║║Cancelling statement #2’s schedules…
+109ms ║║Executed virtual command setVariable (3ms)
+118ms ║║Cancelling condition #9’s schedules…
+119ms ║║Condition #9 evaluated false (7ms)
+120ms ║║Cancelling statement #6’s schedules…
+121ms ║║Cancelling condition #6’s schedules…
+122ms ║║Condition group #6 evaluated false (state changed) (10ms)
+124ms ║╚Execution stage complete. (38ms)
+126ms ╚Event processed successfully (127ms)
12/18/2017, 12:10:46 PM +750ms
+1ms ╔Received event [Hall Motion Lower].motion = active with a delay of 664ms
+91ms ║RunTime Analysis CS > 29ms > PS > 40ms > PE > 22ms > CE
+93ms ║Runtime (41547 bytes) successfully initialized in 40ms (v0.2.100.20171211) (91ms)
+94ms ║╔Execution stage started
+102ms ║║Comparison (enum) active changes_to (string) active = true (0ms)
+104ms ║║Cancelling condition #4’s schedules…
+104ms ║║Condition #4 evaluated true (5ms)
+105ms ║║Cancelling statement #1’s schedules…
+106ms ║║Condition group #1 made progress up the ladder, currently at step 1 of 2
+115ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+116ms ║║Cancelling condition #10’s schedules…
+117ms ║║Condition #10 evaluated true (5ms)
+118ms ║║Cancelling statement #6’s schedules…
+118ms ║║Condition group #6 made progress up the ladder, currently at step 2 of 2
+119ms ║║Cancelling statement #6’s schedules…
+120ms ║║Cancelling condition #6’s schedules…
+121ms ║║Condition group #6 evaluated true (state changed) (11ms)
+123ms ║║Cancelling statement #7’s schedules…
+129ms ║║Executed virtual command setVariable (3ms)
+132ms ║╚Execution stage complete. (37ms)
+133ms ║Setting up scheduled job for Mon, Dec 18 2017 @ 12:11:46 PM CST (in 59.975s)
+144ms ╚Event processed successfully (144ms)
12/18/2017, 12:10:33 PM +863ms
+1ms ╔Received event [Hall Motion Upper].motion = active with a delay of 82ms
+67ms ║RunTime Analysis CS > 16ms > PS > 32ms > PE > 19ms > CE
+70ms ║Runtime (41537 bytes) successfully initialized in 32ms (v0.2.100.20171211) (68ms)
+71ms ║╔Execution stage started
+84ms ║║Condition #4 evaluated false (7ms)
+85ms ║║Cancelling statement #1’s schedules…
+86ms ║║Condition group #1 evaluated false (state did not change) (9ms)
+92ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+94ms ║║Cancelling condition #9’s schedules…
+95ms ║║Condition #9 evaluated true (5ms)
+95ms ║║Cancelling statement #6’s schedules…
+96ms ║║Condition group #6 made progress up the ladder, currently at step 1 of 2
+102ms ║╚Execution stage complete. (31ms)
+103ms ║Setting up scheduled job for Mon, Dec 18 2017 @ 12:11:33 PM CST (in 59.995s)
+111ms ╚Event processed successfully (110ms


#4

Maybe try IS instead of CHANGES TO


#5

Robin

Is this the best approach for a challenge I am trying to address.
A flight of stairs with pressure sensors top & bottom.
I would like to be able the count the number of persons in the room at the top of the stairs, as there is no other entrance other than the staircase.

Currently my pistons are simple, using the state of the associated light(s) to determine if the lights should be turned on or off. But I would like to introduce additional functionality to count the number of persons who have successfully gone up the stairs but not come back down.
(ignore the Disarming)


#6

Depends if people use the stairs as desired, only step on each mat the once and only go up individually… not gonna by to be as reliable as you would like.