Motion sensor and GE light switch not working as expected


#1

1) Give a description of the problem
Motion sensor in closet works when there is motion (door opens, etc.). After two minutes, it shuts off as expected. However, if I manually shut the light with the smart switch (GE) the light pops back on immediately.

2) What is the expected behavior?
Light should shut off with switch OR motion timeout

3) What is happening/not happening?
Light comes back on immediately after hitting switch

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)
1/26/2018, 3:51:10 PM +222ms
+1ms ╔Received event [Master Closet Light].switch = off with a delay of 977ms
+155ms ║RunTime Analysis CS > 24ms > PS > 47ms > PE > 85ms > CE
+164ms ║Runtime (37437 bytes) successfully initialized in 47ms (v0.2.0ff.20171129) (158ms)
+165ms ║╔Execution stage started
+173ms ║║Comparison (enum) off is (string) on = false (1ms)
+174ms ║║Cancelling condition #5’s schedules…
+175ms ║║Condition #5 evaluated false (6ms)
+176ms ║║Cancelling condition #1’s schedules…
+177ms ║║Condition group #1 evaluated false (state changed) (7ms)
+185ms ║║Comparison (enum) inactive is (string) active = false (1ms)
+186ms ║║Cancelling condition #10’s schedules…
+187ms ║║Condition #10 evaluated false (8ms)
+188ms ║║Cancelling condition #7’s schedules…
+189ms ║║Condition group #7 evaluated false (state changed) (11ms)
+191ms ║╚Execution stage complete. (27ms)
+198ms ╚Event processed successfully (198ms)
1/26/2018, 3:51:09 PM +395ms
+0ms ╔Received event [Home].time = 1517003470049 with a delay of -655ms
+187ms ║RunTime Analysis CS > 20ms > PS > 52ms > PE > 115ms > CE
+201ms ║Runtime (37432 bytes) successfully initialized in 52ms (v0.2.0ff.20171129) (200ms)
+203ms ║╔Execution stage started
+241ms ║║Executed physical command [Master Closet Light].off() (17ms)
+242ms ║║Executed [Master Closet Light].off (19ms)
+245ms ║╚Execution stage complete. (42ms)
+254ms ╚Event processed successfully (255ms)
1/26/2018, 3:49:09 PM +885ms
+1ms ╔Received event [Master Closet Motion Sensor].motion = inactive with a delay of 981ms
+122ms ║RunTime Analysis CS > 14ms > PS > 31ms > PE > 77ms > CE
+133ms ║Runtime (37453 bytes) successfully initialized in 31ms (v0.2.0ff.20171129) (131ms)
+134ms ║╔Execution stage started
+145ms ║║Comparison (enum) on is (string) on = true (2ms)
+146ms ║║Condition #5 evaluated true (7ms)
+150ms ║║Comparison (enum) inactive is (string) inactive = true (2ms)
+151ms ║║Cancelling condition #6’s schedules…
+152ms ║║Condition #6 evaluated true (4ms)
+153ms ║║Cancelling condition #1’s schedules…
+153ms ║║Condition group #1 evaluated true (state changed) (15ms)
+155ms ║║Cancelling statement #2’s schedules…
+158ms ║║Executed virtual command [Master Closet Light].wait (0ms)
+164ms ║║Requesting a wake up for Fri, Jan 26 2018 @ 3:51:10 PM CST (in 120.0s)
+167ms ║╚Execution stage complete. (34ms)
+169ms ║Setting up scheduled job for Fri, Jan 26 2018 @ 3:51:10 PM CST (in 119.996s)
+191ms ╚Event processed successfully (190ms)
1/26/2018, 3:48:43 PM +188ms
+1ms ╔Received event [Master Closet Light].switch = on with a delay of 1035ms
+147ms ║RunTime Analysis CS > 20ms > PS > 45ms > PE > 82ms > CE
+157ms ║Runtime (37442 bytes) successfully initialized in 45ms (v0.2.0ff.20171129) (155ms)
+158ms ║╔Execution stage started
+166ms ║║Comparison (enum) on is (string) on = true (1ms)
+168ms ║║Cancelling condition #5’s schedules…
+168ms ║║Condition #5 evaluated true (5ms)
+176ms ║║Comparison (enum) active is (string) inactive = false (1ms)
+177ms ║║Condition #6 evaluated false (8ms)
+178ms ║║Condition group #1 evaluated false (state did not change) (14ms)
+186ms ║║Comparison (enum) active is (string) active = true (1ms)
+187ms ║║Condition #10 evaluated true (8ms)
+188ms ║║Condition group #7 evaluated true (state did not change) (9ms)
+190ms ║║Cancelling statement #8’s schedules…
+193ms ║║Skipped execution of physical command [Master Closet Light].on([]) because it would make no change to the device. (0ms)
+195ms ║║Executed [Master Closet Light].on (3ms)
+198ms ║╚Execution stage complete. (40ms)
+205ms ╚Event processed successfully (205ms)
1/26/2018, 3:48:42 PM +1ms
+2ms ╔Received event [Master Closet Light].switch = off with a delay of 1002ms
+251ms ║RunTime Analysis CS > 15ms > PS > 158ms > PE > 78ms > CE
+260ms ║Runtime (37443 bytes) successfully initialized in 158ms (v0.2.0ff.20171129) (258ms)
+261ms ║╔Execution stage started
+269ms ║║Comparison (enum) off is (string) on = false (2ms)
+270ms ║║Cancelling condition #5’s schedules…
+271ms ║║Condition #5 evaluated false (6ms)
+272ms ║║Condition group #1 evaluated false (state did not change) (7ms)
+281ms ║║Comparison (enum) active is (string) active = true (1ms)
+282ms ║║Condition #10 evaluated true (8ms)
+283ms ║║Condition group #7 evaluated true (state did not change) (9ms)
+285ms ║║Cancelling statement #8’s schedules…
+302ms ║║Executed physical command [Master Closet Light].on() (14ms)
+302ms ║║Executed [Master Closet Light].on (14ms)
+305ms ║╚Execution stage complete. (45ms)
+312ms ╚Event processed successfully (312ms)
1/26/2018, 3:48:36 PM +924ms
+2ms ╔Received event [Master Closet Light].switch = on with a delay of 1054ms
+153ms ║RunTime Analysis CS > 20ms > PS > 57ms > PE > 76ms > CE
+173ms ║Runtime (37441 bytes) successfully initialized in 57ms (v0.2.0ff.20171129) (170ms)
+174ms ║╔Execution stage started
+181ms ║║Comparison (enum) on is (string) on = true (1ms)
+183ms ║║Cancelling condition #5’s schedules…
+183ms ║║Condition #5 evaluated true (5ms)
+190ms ║║Comparison (enum) active is (string) inactive = false (1ms)
+192ms ║║Cancelling condition #6’s schedules…
+192ms ║║Condition #6 evaluated false (8ms)
+193ms ║║Condition group #1 evaluated false (state did not change) (15ms)
+200ms ║║Comparison (enum) active is (string) active = true (1ms)
+201ms ║║Condition #10 evaluated true (6ms)
+202ms ║║Condition group #7 evaluated true (state did not change) (7ms)
+204ms ║║Cancelling statement #8’s schedules…
+208ms ║║Skipped execution of physical command [Master Closet Light].on([]) because it would make no change to the device. (1ms)
+208ms ║║Executed [Master Closet Light].on (1ms)
+211ms ║╚Execution stage complete. (38ms)
+223ms ╚Event processed successfully (223ms)
1/26/2018, 3:48:35 PM +963ms
+2ms ╔Received event [Master Closet Motion Sensor].motion = active with a delay of 1203ms
+159ms ║RunTime Analysis CS > 17ms > PS > 56ms > PE > 86ms > CE
+167ms ║Runtime (37457 bytes) successfully initialized in 56ms (v0.2.0ff.20171129) (164ms)
+167ms ║╔Execution stage started
+179ms ║║Comparison (enum) off is (string) on = false (2ms)
+180ms ║║Condition #5 evaluated false (8ms)
+181ms ║║Condition group #1 evaluated false (state did not change) (9ms)
+186ms ║║Comparison (enum) active is (string) active = true (1ms)
+187ms ║║Cancelling condition #10’s schedules…
+188ms ║║Condition #10 evaluated true (5ms)
+189ms ║║Cancelling condition #7’s schedules…
+189ms ║║Condition group #7 evaluated true (state changed) (7ms)
+191ms ║║Cancelling statement #8’s schedules…
+210ms ║║Executed physical command [Master Closet Light].on() (17ms)
+211ms ║║Executed [Master Closet Light].on (19ms)
+214ms ║╚Execution stage complete. (47ms)
+222ms ╚Event processed successfully (222ms)


#2

Are you turning light off while motion status is still active. It takes a few minutes for the motion to return in active. Thus if you turn off while it is still active it will turn it back on. May want to try changing your ifs from us active/ inactive to changes to active/ inactive


#3

The way you have this piston setup you’ve got three conditions in it which are going to act as triggers. So when you turn the light OFF manually, the piston will actually run because the piston is watching the state of the light switch. But, because the switch is no longer ON, it falls into the ELSE part of the piston, which turns on the light…which technically will cause the piston to run again as it’s monitoring the state of the switch. it’s not recommended to create a piston which monitors something and then changes that same thing…you cause the piston to loop back into itself.

image

Anyway, what most people find works well for them is to just monitor the state of the motion sensor. Ignore the light switch entirely. So you want a piston that’s more along these lines:

Or you could do this as the “ELSE” part here will trigger when the sensor changes to the opposite of Active, which is of course Inactive.

It might be necessary to add in the Never Cancel that you had in your initial post as sometimes Waits of a certain duration can cause the piston to start cancelling events. Test to see for yourself on that one.


#4

Thanks for the help. Now when i walk out of the closet and manually turn off the light with the switch, then walk back in a few seconds later, the sensor the light does not turn back on. This happens with “Never Cancel” and without.


#5

That’s likely a function of your Device. Most motion sensors have a setting on them which dictates how often they re-detect motion after they’ve just detected motion. So if the sensor was just “active” and enough time has not gone by then it’s not going to detect new motion.

Check in the ST app for that particular device to see if you can modify the settings on it. But I’m not sure how low you can set them. The one that I have only allows me to set it down to 20 seconds.