Motion Sensor - Not always firing right


#1

1) Give a description of the problem
I have 2 motion sensors setup identically for different lights. Often the first time I trip motion it will not fire the second time it will. it is frustrating as I find I have to stop moving and then move to turn on the light or trip over due to impatience while asking alexa to turn on the light

2) What is the expected behavior?
If the motion is seen, turn on light for x period and turn off.
If the light is already on do nothing

3) What is happening/not happening?
Not always firing

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
Logs from WebCoRE first fails the second clearly works. only SECONDS later???

01‎/‎12‎/‎2017‎ ‎07‎:‎24‎:‎48 +135ms
+1ms
╔Received event [Kitchen Sensor].motion = inactive with a delay of 152ms
+73ms
║RunTime Analysis CS > 14ms > PS > 26ms > PE > 33ms > CE
+80ms
║Runtime (38482 bytes) successfully initialized in 26ms (v0.2.0fd.20171105) (79ms)
+81ms
║╔Execution stage started
+109ms
║║Comparison (time) 26688220 is_between (time) 1512144000000 … (time) 1512114420000 = true (6ms)
+110ms
║║Time restriction check passed
+111ms
║║Condition #3 evaluated true (27ms)
+127ms
║║Comparison (string) off is (string) off = true (1ms)
+128ms
║║Condition #14 evaluated true (16ms)
+129ms
║║Condition group #null evaluated true (state did not change) (45ms)
+142ms
║║Comparison (enum) off is (string) off = true (1ms)
+143ms
║║Comparison (enum) off is (string) off = true (1ms)
+145ms
║║Condition #17 evaluated true (14ms)
+146ms
║║Cancelling condition #1’s schedules…
+146ms
║║Condition group #1 evaluated true (state changed) (15ms)
+150ms
║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+151ms
║║Condition #2 evaluated false (4ms)
+152ms
║║Cancelling condition #1’s schedules…
+153ms
║║Condition group #1 evaluated false (state changed) (5ms)
+154ms
║╚Execution stage complete. (73ms)
+160ms
╚Event processed successfully (160ms)
‎01‎/‎12‎/‎2017‎ ‎07‎:‎24‎:‎29 +225ms
+1ms
╔Received event [Kitchen Sensor].motion = active with a delay of 166ms
+137ms
║RunTime Analysis CS > 15ms > PS > 90ms > PE > 32ms > CE
+144ms
║Runtime (38475 bytes) successfully initialized in 90ms (v0.2.0fd.20171105) (143ms)
+145ms
║╔Execution stage started
+174ms
║║Comparison (time) 26669374 is_between (time) 1512144000000 … (time) 1512114420000 = true (7ms)
+175ms
║║Time restriction check passed
+176ms
║║Condition #3 evaluated true (27ms)
+182ms
║║Comparison (string) off is (string) off = true (1ms)
+183ms
║║Condition #14 evaluated true (6ms)
+184ms
║║Condition group #null evaluated true (state did not change) (36ms)
+197ms
║║Comparison (enum) off is (string) off = true (1ms)
+199ms
║║Comparison (enum) off is (string) off = true (1ms)
+200ms
║║Cancelling condition #17’s schedules…
+201ms
║║Condition #17 evaluated true (15ms)
+202ms
║║Condition group #1 evaluated true (state did not change) (15ms)
+205ms
║║Comparison (enum) active changes_to (string) active = false (1ms)
+206ms
║║Cancelling condition #2’s schedules…
+207ms
║║Condition #2 evaluated false (5ms)
+208ms
║║Cancelling condition #1’s schedules…
+208ms
║║Condition group #1 evaluated false (state changed) (6ms)
+210ms
║╚Execution stage complete. (65ms)
+216ms
╚Event processed successfully (216ms)


#2

I’m not 100% sure why it should matter, but maybe try ‘IS’ instead of ‘changes to’… ‘IS’ should behave like ‘changes to’ when used alone (as in your example) but the logs infer that change = false???


#3

Your method will leave you in the dark after 5 minutes regardless of whether motion is still active or not… I’ve produced the following piston which will ignore motion if lights are turned on manually and will keep lights on until motion has stopped for minutes.

Tested and working :smile:


#4

@Robin thanks for this … going to read it a few more times to grok it

Similar to what I am trying to do in my Garage. I have a motion sensor in the garage, door contacts on the garage bay doors and the door from the house to the garage.

I want to turn the lights on if any of those contacts change to OPEN or motion is detected and keep them on while there is motion.

The motion sensor is a Bosch that has a 3m refresh (it flashes a motion event - then a motion stopped event and wont trigger again for 3m) … so if no motion in 5m then turn off

I know the logic I am trying to accomplish - just trying to muck it together in webcore

Its getting to winter here in north east PA so I may go into the garage to futz around on things, and as long as I am moving I’d like to keep the lights on :slight_smile:


#5

What do the (*#'s) mean beside the lines in the piston?


#6

Those numbers help identify what condition/statement the logs are referring to.


#7

You are a star.
We should have a locked area for examples or common tasks just like this for people to grab. This is much better than I had. It look great. I will install and test and let you know but it looks sensible.


#8

Have you checked out #Examples