Light will not turn off after 1 minute once Ring motion is activated


#1

1) Give a description of the problem
Light will not turn off after 1 minute once Ring motion is activated

2) What is the expected behaviour?
Light should turn off after 1 minute
3) What is happening/not happening?
Light does not turn off after waiting 1 minute

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
1/2/2020, 11:49:11 AM +176ms
+0ms ╔Received event [My home].time = 1577994552775 with a delay of -1600ms
+88ms ║Runtime (37799 bytes) successfully initialized in 49ms (v0.3.110.20191009) (87ms)
+89ms ║╔Execution stage started
+90ms ║╚Execution stage complete. (1ms)
+91ms ╚Event processed successfully (90ms)
1/2/2020, 11:48:52 AM +137ms
+1ms ╔Received event [Front Door].motion = inactive with a delay of 77ms
+82ms ║Runtime (37789 bytes) successfully initialized in 33ms (v0.3.110.20191009) (80ms)
+83ms ║╔Execution stage started
+122ms ║╚Execution stage complete. (39ms)
+123ms ╚Event processed successfully (123ms)
1/2/2020, 11:48:12 AM +630ms
+1ms ╔Received event [Front Door].motion = active with a delay of 59ms
+78ms ║Runtime (37794 bytes) successfully initialized in 39ms (v0.3.110.20191009) (76ms)
+79ms ║╔Execution stage started
+138ms ║║Executed [Front Porch].on (18ms)
+143ms ║║Executed virtual command [Front Porch].wait (0ms)
+144ms ║║Requesting a wake up for Thu, Jan 2 2020 @ 11:49:12 AM PST (in 60.0s)
+148ms ║╚Execution stage complete. (69ms)
+150ms ║Setting up scheduled job for Thu, Jan 2 2020 @ 11:49:12 AM PST (in 59.996s)
+157ms ╚Event processed successfully (156ms)

REMOVE BELOW AFTER READING


#2

Here is how I do it


#3

This is because your conditions were no longer true:

  • 11:48:12 AM = Motion active (Turn on & wait)
  • 11:48:52 AM = Motion inactive (Line 15 is false, so cancels out)
  • 11:49:11 AM = Wait ends, but line 15 is still false

You can get around this by doing something like @ssgcull’s suggestion (double trigger with no WAIT)
… or…
If you want the light turned off after the WAIT regardless of activity, you can change Task Cancellation Policy to Never on your WITH on line 17.


#4

Thanks, ssgcull & WCmore! Both options worked equally well for me.