Motion light timer won't reset with new motion


#1

1) Give a description of the problem
using a smart outlet to turn a light on then off again after 5min without motion

2) What is the expected behaviour?
detect motion, turn on light, start 5min timer, reset timer when it detects motion, else turn off the light.

3) What is happening/not happening?
the timer isn’t resetting, once the light comes on it turns off in 5mins regardless of new motion.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
2/3/2020, 1:49:30 PM +52ms
+1ms ╔Received event [Home].time = 1580766570783 with a delay of -731ms
+142ms ║RunTime Analysis CS > 42ms > PS > 53ms > PE > 47ms > CE
+144ms ║Runtime (38043 bytes) successfully initialized in 53ms (v0.3.110.20191009) (142ms)
+145ms ║╔Execution stage started
+159ms ║║Cancelling condition #6’s schedules…
+160ms ║║Condition #6 evaluated true (1ms)
+161ms ║║Cancelling condition #5’s schedules…
+162ms ║║Condition group #5 evaluated true (state changed) (5ms)
+165ms ║║Cancelling statement #7’s schedules…
+180ms ║║Executed physical command [Kitchen Outlet].off() (11ms)
+182ms ║║Executed [Kitchen Outlet].off (13ms)
+185ms ║╚Execution stage complete. (40ms)
+186ms ╚Event processed successfully (186ms)
2/3/2020, 1:45:48 PM +66ms
+1ms ╔Received event [Motion Sensor].motion = inactive with a delay of 106ms
+80ms ║RunTime Analysis CS > 16ms > PS > 36ms > PE > 29ms > CE
+83ms ║Runtime (38043 bytes) successfully initialized in 36ms (v0.3.110.20191009) (81ms)
+84ms ║╔Execution stage started
+90ms ║║Comparison (enum) inactive changes = true (0ms)
+91ms ║║Condition #2 evaluated true (4ms)
+92ms ║║Condition group #1 evaluated true (state did not change) (4ms)
+97ms ║║Comparison (enum) inactive is (string) active = false (1ms)
+98ms ║║Cancelling condition #4’s schedules…
+99ms ║║Condition #4 evaluated false (5ms)
+100ms ║║Cancelling condition #3’s schedules…
+101ms ║║Condition group #3 evaluated false (state changed) (8ms)
+107ms ║║Comparison (enum) inactive stays (string) inactive = true (1ms)
+109ms ║║Condition #6 evaluated false (6ms)
+110ms ║║Condition group #5 evaluated false (state did not change) (7ms)
+113ms ║╚Execution stage complete. (30ms)
+115ms ║Setting up scheduled job for Mon, Feb 3 2020 @ 1:49:30 PM PST (in 222.603s)
+126ms ╚Event processed successfully (125ms)
2/3/2020, 1:45:21 PM +278ms
+1ms ╔Received event [Motion Sensor].motion = active with a delay of 100ms
+94ms ║RunTime Analysis CS > 27ms > PS > 36ms > PE > 32ms > CE
+97ms ║Runtime (38045 bytes) successfully initialized in 36ms (v0.3.110.20191009) (95ms)
+97ms ║╔Execution stage started
+104ms ║║Comparison (enum) active changes = true (1ms)
+105ms ║║Condition #2 evaluated true (3ms)
+106ms ║║Condition group #1 evaluated true (state did not change) (5ms)
+112ms ║║Comparison (enum) active is (string) active = true (2ms)
+113ms ║║Cancelling condition #4’s schedules…
+114ms ║║Condition #4 evaluated true (6ms)
+115ms ║║Cancelling condition #3’s schedules…
+116ms ║║Condition group #3 evaluated true (state changed) (8ms)
+118ms ║║Cancelling statement #9’s schedules…
+131ms ║║Skipped execution of physical command [Kitchen Outlet].on([]) because it would make no change to the device. (10ms)
+132ms ║║Executed [Kitchen Outlet].on (11ms)
+135ms ║╚Execution stage complete. (38ms)
+136ms ║Setting up scheduled job for Mon, Feb 3 2020 @ 1:49:30 PM PST (in 249.369s)
+146ms ╚Event processed successfully (147ms)
2/3/2020, 1:44:30 PM +665ms
+1ms ╔Received event [Motion Sensor].motion = inactive with a delay of 106ms
+85ms ║RunTime Analysis CS > 17ms > PS > 37ms > PE > 31ms > CE
+88ms ║Runtime (38041 bytes) successfully initialized in 37ms (v0.3.110.20191009) (86ms)
+89ms ║╔Execution stage started
+96ms ║║Comparison (enum) inactive changes = true (0ms)
+97ms ║║Condition #2 evaluated true (4ms)
+98ms ║║Condition group #1 evaluated true (state did not change) (5ms)
+104ms ║║Comparison (enum) inactive is (string) active = false (1ms)
+106ms ║║Cancelling condition #4’s schedules…
+107ms ║║Condition #4 evaluated false (6ms)
+108ms ║║Cancelling condition #3’s schedules…
+108ms ║║Condition group #3 evaluated false (state changed) (8ms)
+115ms ║║Comparison (enum) inactive stays (string) inactive = true (2ms)
+117ms ║║Adding a timed trigger schedule for condition 6
+119ms ║║Cancelling condition #6’s schedules…
+120ms ║║Condition #6 evaluated false (9ms)
+121ms ║║Cancelling condition #5’s schedules…
+122ms ║║Condition group #5 evaluated false (state changed) (12ms)
+125ms ║╚Execution stage complete. (36ms)
+127ms ║Setting up scheduled job for Mon, Feb 3 2020 @ 1:49:30 PM PST (in 299.992s)
+135ms ╚Event processed successfully (135ms)
2/3/2020, 1:44:17 PM +700ms
+1ms ╔Received event [Motion Sensor].motion = active with a delay of 107ms
+86ms ║RunTime Analysis CS > 17ms > PS > 36ms > PE > 33ms > CE
+88ms ║Runtime (38043 bytes) successfully initialized in 36ms (v0.3.110.20191009) (87ms)
+89ms ║╔Execution stage started
+95ms ║║Comparison (enum) active changes = true (1ms)
+96ms ║║Condition #2 evaluated true (3ms)
+97ms ║║Condition group #1 evaluated true (state did not change) (4ms)
+103ms ║║Comparison (enum) active is (string) active = true (1ms)
+104ms ║║Cancelling condition #4’s schedules…
+105ms ║║Condition #4 evaluated true (6ms)
+106ms ║║Cancelling condition #3’s schedules…
+107ms ║║Condition group #3 evaluated true (state changed) (8ms)
+110ms ║║Cancelling statement #9’s schedules…
+128ms ║║Executed physical command [Kitchen Outlet].on() (14ms)
+129ms ║║Executed [Kitchen Outlet].on (16ms)
+131ms ║╚Execution stage complete. (42ms)
+132ms ╚Event processed successfully (132ms)


#2

I would start by pulling both IF on line 20 & 29 out. They should be two separate IF instances. Move them out and remove the line 18 condition. Then change the line 21 trigger to “changes to active”

When editing the piston, click the 4th button from the left in the top left tool options if it wasn’t blue already. This brings over the little handles allowing you to drag and drop the selection you have grabbed. Just drag that second if down, out of the first one and retest.


#3

https://wiki.webcore.co/WCmore's_DragAndDrop


#4

that creates the desired effect.

is there anyway to make it more responsive? there seems to be a significant delay before the timer kicks in, and also there’s similarly large pause between deactivation and reactivation of the script/light

is there’s a timer or some kinda of time limiter I’m not aware of that causes this and can it be shortened?


#5

Many things can impact the responsiveness of a piston. Just to mention a few :

  1. Internet latency - webcore/smartthings runs in the cloud
  2. Is there any other piston/routine that is acting on your devices and possibly causing interference?
  3. The caliber of your home network, including z-wave or zigbee
  4. The response times of your devices.

No, not to my knowledge.

@WCmore has mentioned others

Battery is getting low in the device
Using an old outdated Device Handler
Holes in a Mesh network / device too far away
Poorly coded pistons
Too many things happening at once

#6

ok well I’m not sure any of the applies except maybe the device handler but I don’t know anything about that.

This will do for now. Thank you all for the help.