Motion Based Light EXCEPT when Manually turned On

motion
light
manual
except
off

#81

Thanks for working on this…just tried it…it turns the light on with motion, but not off after inactive (which occurs within 1-2 seconds…)


#82

i just tested it again. seems to work. the first attempt may not work because variables are not initialized. if you switch off the light manually then try, does it work?


#83

Yes, I turned it on and off a couple times at the switch…it recognizes the motion to turn on, but not off…


#84

9/29/2017, 4:00:37 PM +670ms
+1ms ╔Received event [Master Bedroom Closet].switch = on with a delay of 62ms
+143ms ║RunTime Analysis CS > 23ms > PS > 59ms > PE > 62ms > CE
+153ms ║Runtime (41167 bytes) successfully initialized in 59ms (v0.2.0ec.20170927) (151ms)
+155ms ║╔Execution stage started
+176ms ║║Condition #5 evaluated false (11ms)
+177ms ║║Condition group #1 evaluated false (state did not change) (13ms)
+191ms ║║Cancelling condition #12’s schedules…
+192ms ║║Condition #12 evaluated false (9ms)
+193ms ║║Condition group #8 evaluated false (state did not change) (12ms)
+205ms ║║Comparison (enum) on changes_to (string) on = true (2ms)
+207ms ║║Cancelling condition #18’s schedules…
+208ms ║║Condition #18 evaluated true (10ms)
+210ms ║║Cancelling condition #14’s schedules…
+211ms ║║Condition group #14 evaluated true (state changed) (13ms)
+221ms ║║Comparison (boolean) true is (boolean) true = true (3ms)
+223ms ║║Cancelling condition #30’s schedules…
+224ms ║║Condition #30 evaluated true (9ms)
+226ms ║║Cancelling condition #27’s schedules…
+227ms ║║Condition group #27 evaluated true (state changed) (12ms)
+230ms ║║Cancelling statement #28’s schedules…
+238ms ║║Executed virtual command setVariable (3ms)
+252ms ║║Comparison (enum) on changes_to (string) off = false (1ms)
+254ms ║║Condition #26 evaluated false (8ms)
+255ms ║║Condition group #23 evaluated false (state did not change) (11ms)
+259ms ║╚Execution stage complete. (105ms)
+268ms ╚Event processed successfully (267ms)
9/29/2017, 4:00:32 PM +876ms
+2ms ╔Received event [Master Bedroom Closet Motion].motion = inactive with a delay of 509ms
+167ms ║RunTime Analysis CS > 42ms > PS > 72ms > PE > 54ms > CE
+317ms ║Runtime (41178 bytes) successfully initialized in 72ms (v0.2.0ec.20170927) (315ms)
+318ms ║╔Execution stage started
+336ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+338ms ║║Cancelling condition #5’s schedules…
+339ms ║║Condition #5 evaluated false (11ms)
+341ms ║║Cancelling condition #1’s schedules…
+342ms ║║Condition group #1 evaluated false (state changed) (13ms)
+354ms ║║Comparison (enum) inactive changes_to (string) inactive = true (1ms)
+357ms ║║Cancelling condition #12’s schedules…
+358ms ║║Condition #12 evaluated true (11ms)
+365ms ║║Comparison (boolean) false is (boolean) true = false (3ms)
+367ms ║║Condition #13 evaluated false (9ms)
+368ms ║║Condition group #8 evaluated false (state did not change) (22ms)
+383ms ║║Condition #18 evaluated false (10ms)
+385ms ║║Condition group #14 evaluated false (state did not change) (12ms)
+398ms ║║Condition #26 evaluated false (9ms)
+399ms ║║Condition group #23 evaluated false (state did not change) (10ms)
+403ms ║╚Execution stage complete. (85ms)
+413ms ╚Event processed successfully (413ms)
9/29/2017, 4:00:31 PM +964ms
+2ms ╔Received event [Master Bedroom Closet Motion].motion = active with a delay of 962ms
+150ms ║RunTime Analysis CS > 25ms > PS > 72ms > PE > 52ms > CE
+375ms ║Runtime (41177 bytes) successfully initialized in 72ms (v0.2.0ec.20170927) (371ms)
+376ms ║╔Execution stage started
+394ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+396ms ║║Cancelling condition #5’s schedules…
+397ms ║║Condition #5 evaluated true (11ms)
+408ms ║║Comparison (enum) off is (string) off = true (2ms)
+410ms ║║Cancelling condition #6’s schedules…
+411ms ║║Condition #6 evaluated true (13ms)
+412ms ║║Cancelling condition #1’s schedules…
+413ms ║║Condition group #1 evaluated true (state changed) (27ms)
+417ms ║║Cancelling statement #2’s schedules…
+442ms ║║Executed physical command [Master Bedroom Closet].on() (23ms)
+443ms ║║Executed [Master Bedroom Closet].on (25ms)
+451ms ║║Executed virtual command [Master Bedroom Closet].setVariable (4ms)
+464ms ║║Comparison (enum) active changes_to (string) inactive = false (1ms)
+466ms ║║Condition #12 evaluated false (10ms)
+467ms ║║Condition group #8 evaluated false (state did not change) (11ms)
+481ms ║║Condition #18 evaluated false (9ms)
+482ms ║║Condition group #14 evaluated false (state did not change) (11ms)
+497ms ║║Cancelling condition #26’s schedules…
+499ms ║║Condition #26 evaluated false (11ms)
+501ms ║║Cancelling condition #23’s schedules…
+502ms ║║Condition group #23 evaluated false (state changed) (15ms)
+507ms ║╚Execution stage complete. (130ms)
+516ms ╚Event processed successfully (516ms)


#85

if you turn it off using the switch and let motion activate and turn on the light, it does not turn it off after the wait timer?


#86

this is the current sequence:

+1ms ╔Received event [Master Bedroom Closet].switch = on with a delay of 62ms
+2ms ╔Received event [Master Bedroom Closet Motion].motion = inactive with a delay of 509ms
+2ms ╔Received event [Master Bedroom Closet Motion].motion = active with a delay of 962ms

can you please share the logs for this sequence?

master bedroom closet switch off
master bedroom closet motion active
master bedroom closet switch on
master bedroom closet motion inactive

this should be the normal sequence and works for me repeatedly.


#87

Sure, and to be clear, I changed the wait time to off to 5 seconds…just so I can test it…that’s ok, right?


#88

What level log do you need?


#89

lets use 30 seconds just to be on the safe side.


#90

same as before please.


#91

put it back to 30 seconds…

Just to be clear, this motion sensor is “blind” for 60 seconds after it detects motion…period…The only thing I can alter is how quickly it sends the inactive signal after inactivity (I have it set to 1 second…) That shouldn’t have an impact with what I am doing, but I thought I would tell you that…

9/29/2017, 4:27:10 PM +455ms
+1ms ╔Received event [Master Bedroom Closet].switch = on with a delay of 116ms
+148ms ║RunTime Analysis CS > 26ms > PS > 57ms > PE > 65ms > CE
+161ms ║Runtime (41166 bytes) successfully initialized in 57ms (v0.2.0ec.20170927) (159ms)
+163ms ║╔Execution stage started
+181ms ║║Condition #5 evaluated false (9ms)
+183ms ║║Condition group #1 evaluated false (state did not change) (10ms)
+196ms ║║Cancelling condition #12’s schedules…
+197ms ║║Condition #12 evaluated false (9ms)
+199ms ║║Cancelling condition #8’s schedules…
+200ms ║║Condition group #8 evaluated false (state changed) (12ms)
+212ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+214ms ║║Cancelling condition #18’s schedules…
+215ms ║║Condition #18 evaluated true (10ms)
+216ms ║║Cancelling condition #14’s schedules…
+217ms ║║Condition group #14 evaluated true (state changed) (13ms)
+227ms ║║Comparison (boolean) true is (boolean) true = true (3ms)
+229ms ║║Cancelling condition #30’s schedules…
+230ms ║║Condition #30 evaluated true (9ms)
+232ms ║║Cancelling condition #27’s schedules…
+233ms ║║Condition group #27 evaluated true (state changed) (12ms)
+237ms ║║Cancelling statement #28’s schedules…
+244ms ║║Executed virtual command setVariable (3ms)
+258ms ║║Comparison (enum) on changes_to (string) off = false (1ms)
+260ms ║║Condition #26 evaluated false (8ms)
+261ms ║║Condition group #23 evaluated false (state did not change) (11ms)
+266ms ║╚Execution stage complete. (104ms)
+275ms ╚Event processed successfully (276ms)
9/29/2017, 4:27:06 PM +46ms
+1ms ╔Received event [Master Bedroom Closet Motion].motion = inactive with a delay of 520ms
+126ms ║RunTime Analysis CS > 21ms > PS > 51ms > PE > 55ms > CE
+136ms ║Runtime (41180 bytes) successfully initialized in 51ms (v0.2.0ec.20170927) (134ms)
+137ms ║╔Execution stage started
+153ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+155ms ║║Cancelling condition #5’s schedules…
+156ms ║║Condition #5 evaluated false (10ms)
+157ms ║║Cancelling condition #1’s schedules…
+158ms ║║Condition group #1 evaluated false (state changed) (12ms)
+169ms ║║Comparison (enum) inactive changes_to (string) inactive = true (1ms)
+172ms ║║Cancelling condition #12’s schedules…
+173ms ║║Condition #12 evaluated true (9ms)
+179ms ║║Comparison (boolean) true is (boolean) true = true (3ms)
+181ms ║║Condition #13 evaluated true (8ms)
+182ms ║║Cancelling condition #8’s schedules…
+183ms ║║Condition group #8 evaluated true (state changed) (21ms)
+187ms ║║Cancelling statement #9’s schedules…
+194ms ║║Executed virtual command [Master Bedroom Closet].wait (1ms)
+195ms ║║Requesting a wake up for Fri, Sep 29 2017 @ 4:27:36 PM PDT (in 30.0s)
+203ms ║╚Execution stage complete. (65ms)
+205ms ║Setting up scheduled job for Fri, Sep 29 2017 @ 4:27:36 PM PDT (in 29.991s)
+223ms ╚Event processed successfully (223ms)
9/29/2017, 4:27:04 PM +983ms
+2ms ╔Received event [Master Bedroom Closet Motion].motion = active with a delay of 245ms
+184ms ║RunTime Analysis CS > 26ms > PS > 74ms > PE > 84ms > CE
+241ms ║Runtime (41180 bytes) successfully initialized in 74ms (v0.2.0ec.20170927) (238ms)
+242ms ║╔Execution stage started
+260ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+262ms ║║Cancelling condition #5’s schedules…
+263ms ║║Condition #5 evaluated true (11ms)
+276ms ║║Comparison (enum) off is (string) off = true (2ms)
+278ms ║║Condition #6 evaluated true (13ms)
+279ms ║║Cancelling condition #1’s schedules…
+280ms ║║Condition group #1 evaluated true (state changed) (28ms)
+284ms ║║Cancelling statement #2’s schedules…
+311ms ║║Executed physical command [Master Bedroom Closet].on() (24ms)
+312ms ║║Executed [Master Bedroom Closet].on (26ms)
+320ms ║║Executed virtual command [Master Bedroom Closet].setVariable (3ms)
+333ms ║║Comparison (enum) active changes_to (string) inactive = false (1ms)
+335ms ║║Condition #12 evaluated false (10ms)
+336ms ║║Condition group #8 evaluated false (state did not change) (11ms)
+350ms ║║Condition #18 evaluated false (9ms)
+352ms ║║Condition group #14 evaluated false (state did not change) (10ms)
+366ms ║║Condition #26 evaluated false (9ms)
+367ms ║║Condition group #23 evaluated false (state did not change) (11ms)
+371ms ║╚Execution stage complete. (129ms)
+382ms ╚Event processed successfully (382ms)


#92

thanks for letting me know. how long does it take to send the inactive event after the last active?

this log starts with:

could you please post for this sequence instead?

received event master bedroom closet switch off
received event master bedroom closet motion active
received event master bedroom closet switch on
received event master bedroom closet motion inactive


#93

in order to do switch off, I need to turn on the light…do you want me to do that?


#94

yes please. turn off logging. turn it on. turn on logging. turn off light. let motion activate and turn on light. then wait a couple of minutes and share log uptil that point.


#95

also remind me, is this a smart switch with a dumb light or a dumb switch with a smart light? i think its a smart switch with a dumb light, yes?


#96

Yes, smart smith, dumb light…

9/29/2017, 4:45:31 PM +796ms
+2ms ╔Received event [Master Bedroom Closet].switch = on with a delay of 113ms
+173ms ║RunTime Analysis CS > 27ms > PS > 72ms > PE > 74ms > CE
+186ms ║Runtime (41163 bytes) successfully initialized in 72ms (v0.2.0ec.20170927) (183ms)
+188ms ║╔Execution stage started
+209ms ║║Condition #5 evaluated false (10ms)
+210ms ║║Condition group #1 evaluated false (state did not change) (13ms)
+224ms ║║Cancelling condition #12’s schedules…
+225ms ║║Condition #12 evaluated false (9ms)
+226ms ║║Cancelling condition #8’s schedules…
+227ms ║║Condition group #8 evaluated false (state changed) (13ms)
+240ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+242ms ║║Cancelling condition #18’s schedules…
+243ms ║║Condition #18 evaluated true (11ms)
+244ms ║║Cancelling condition #14’s schedules…
+245ms ║║Condition group #14 evaluated true (state changed) (14ms)
+256ms ║║Comparison (boolean) true is (boolean) true = true (2ms)
+258ms ║║Condition #30 evaluated true (8ms)
+259ms ║║Condition group #27 evaluated true (state did not change) (10ms)
+263ms ║║Cancelling statement #28’s schedules…
+271ms ║║Executed virtual command setVariable (4ms)
+285ms ║║Comparison (enum) on changes_to (string) off = false (1ms)
+288ms ║║Condition #26 evaluated false (10ms)
+289ms ║║Condition group #23 evaluated false (state did not change) (12ms)
+293ms ║╚Execution stage complete. (106ms)
+303ms ╚Event processed successfully (303ms)
9/29/2017, 4:45:29 PM +132ms
+2ms ╔Received event [Master Bedroom Closet Motion].motion = inactive with a delay of 530ms
+178ms ║RunTime Analysis CS > 41ms > PS > 68ms > PE > 69ms > CE
+190ms ║Runtime (41179 bytes) successfully initialized in 68ms (v0.2.0ec.20170927) (187ms)
+191ms ║╔Execution stage started
+210ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+213ms ║║Cancelling condition #5’s schedules…
+214ms ║║Condition #5 evaluated false (12ms)
+216ms ║║Cancelling condition #1’s schedules…
+217ms ║║Condition group #1 evaluated false (state changed) (15ms)
+230ms ║║Comparison (enum) inactive changes_to (string) inactive = true (1ms)
+232ms ║║Cancelling condition #12’s schedules…
+233ms ║║Condition #12 evaluated true (11ms)
+241ms ║║Comparison (boolean) true is (boolean) true = true (2ms)
+243ms ║║Cancelling condition #13’s schedules…
+244ms ║║Condition #13 evaluated true (10ms)
+245ms ║║Cancelling condition #8’s schedules…
+247ms ║║Condition group #8 evaluated true (state changed) (25ms)
+250ms ║║Cancelling statement #9’s schedules…
+258ms ║║Executed virtual command [Master Bedroom Closet].wait (1ms)
+260ms ║║Requesting a wake up for Fri, Sep 29 2017 @ 4:46:59 PM PDT (in 90.0s)
+270ms ║╚Execution stage complete. (78ms)
+272ms ║Setting up scheduled job for Fri, Sep 29 2017 @ 4:46:59 PM PDT (in 89.989s)
+294ms ╚Event processed successfully (293ms)
9/29/2017, 4:45:28 PM +4ms
+2ms ╔Received event [Master Bedroom Closet Motion].motion = active with a delay of 911ms
+167ms ║RunTime Analysis CS > 26ms > PS > 74ms > PE > 67ms > CE
+183ms ║Runtime (41177 bytes) successfully initialized in 74ms (v0.2.0ec.20170927) (181ms)
+184ms ║╔Execution stage started
+203ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+206ms ║║Cancelling condition #5’s schedules…
+207ms ║║Condition #5 evaluated true (11ms)
+219ms ║║Comparison (enum) off is (string) off = true (3ms)
+221ms ║║Condition #6 evaluated true (12ms)
+222ms ║║Cancelling condition #1’s schedules…
+223ms ║║Condition group #1 evaluated true (state changed) (29ms)
+227ms ║║Cancelling statement #2’s schedules…
+255ms ║║Executed physical command [Master Bedroom Closet].on() (24ms)
+256ms ║║Executed [Master Bedroom Closet].on (26ms)
+264ms ║║Executed virtual command [Master Bedroom Closet].setVariable (4ms)
+278ms ║║Comparison (enum) active changes_to (string) inactive = false (1ms)
+281ms ║║Condition #12 evaluated false (10ms)
+282ms ║║Condition group #8 evaluated false (state did not change) (13ms)
+295ms ║║Condition #18 evaluated false (8ms)
+297ms ║║Condition group #14 evaluated false (state did not change) (10ms)
+311ms ║║Cancelling condition #26’s schedules…
+312ms ║║Condition #26 evaluated false (10ms)
+314ms ║║Cancelling condition #23’s schedules…
+315ms ║║Condition group #23 evaluated false (state changed) (13ms)
+319ms ║╚Execution stage complete. (135ms)
+360ms ╚Event processed successfully (360ms)
9/29/2017, 4:45:20 PM +624ms
+2ms ╔Received event [Master Bedroom Closet].switch = off with a delay of 150ms
+163ms ║RunTime Analysis CS > 26ms > PS > 74ms > PE > 63ms > CE
+175ms ║Runtime (41168 bytes) successfully initialized in 74ms (v0.2.0ec.20170927) (172ms)
+177ms ║╔Execution stage started
+198ms ║║Condition #5 evaluated false (11ms)
+200ms ║║Condition group #1 evaluated false (state did not change) (12ms)
+213ms ║║Condition #12 evaluated false (9ms)
+215ms ║║Condition group #8 evaluated false (state did not change) (10ms)
+228ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+230ms ║║Cancelling condition #18’s schedules…
+231ms ║║Condition #18 evaluated false (11ms)
+233ms ║║Cancelling condition #14’s schedules…
+234ms ║║Condition group #14 evaluated false (state changed) (15ms)
+247ms ║║Comparison (enum) off changes_to (string) off = true (1ms)
+250ms ║║Cancelling condition #26’s schedules…
+251ms ║║Condition #26 evaluated true (11ms)
+252ms ║║Cancelling condition #23’s schedules…
+253ms ║║Condition group #23 evaluated true (state changed) (14ms)
+258ms ║║Cancelling statement #24’s schedules…
+266ms ║║Executed virtual command setVariable (3ms)
+271ms ║╚Execution stage complete. (94ms)
+280ms ╚Event processed successfully (280ms)


#97

The motion inactive is almost immediate…I can adjust that within the Device Handler if that helps?


#98

ahh, that’s why. change motion inactive to be delayed a few seconds. lets say 10 seconds.

let me also show you whats happening:

9/29/2017, 4:45:20 PM +624ms
+2ms ╔Received event [Master Bedroom Closet].switch = off with a delay of 150ms
9/29/2017, 4:45:28 PM +4ms
+2ms ╔Received event [Master Bedroom Closet Motion].motion = active with a delay of 911ms
9/29/2017, 4:45:29 PM +132ms
+2ms ╔Received event [Master Bedroom Closet Motion].motion = inactive with a delay of 530ms
9/29/2017, 4:45:31 PM +796ms
+2ms ╔Received event [Master Bedroom Closet].switch = on with a delay of 113ms

its receiving the motion inactive event before the switch on event. which is throwing everything off.


#99

or change line 48 to:

white bulb 7's switch is on

but, dont do both :slight_smile:


#100

You are like a surgeon :slight_smile: Let me change the Device handler…

Once again, I’m sure WebCoRE is doing EXACTLY what it should be…:slight_smile: