Wait 5 Minutes and Turn Lights Off


#1

1) Give a description of the problem
I have a piston designed to turn the garage lights on when the door opens, wait 5 minutes, and turn them off. I can get the lights to turn on - but they never turn off.

2) What is the expected behaviour?
5 minutes after the contact sensor status changes to open and the garage lights turn on, turn the garage lights off

3) What is happening/not happening?
The lights are not turning off

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
12/3/2019, 8:03:37 AM +257ms
+0ms ╔Received event [Home].time = 1575385417996 with a delay of -739ms
+125ms ║RunTime Analysis CS > 27ms > PS > 71ms > PE > 27ms > CE
+127ms ║Runtime (37778 bytes) successfully initialized in 71ms (v0.3.110.20191009) (126ms)
+128ms ║╔Execution stage started
+129ms ║╚Execution stage complete. (1ms)
+130ms ╚Event processed successfully (130ms)
12/3/2019, 7:58:42 AM +362ms
+1ms ╔Received event [Garage Entry].contact = closed with a delay of 178ms
+160ms ║RunTime Analysis CS > 22ms > PS > 113ms > PE > 25ms > CE
+162ms ║Runtime (37776 bytes) successfully initialized in 113ms (v0.3.110.20191009) (160ms)
+163ms ║╔Execution stage started
+169ms ║║Comparison (enum) closed changes_to (string) open = false (0ms)
+171ms ║║Cancelling condition #2’s schedules…
+172ms ║║Condition #2 evaluated false (5ms)
+173ms ║║Cancelling condition #1’s schedules…
+173ms ║║Condition group #1 evaluated false (state changed) (7ms)
+175ms ║╚Execution stage complete. (12ms)
+176ms ╚Event processed successfully (176ms)
12/3/2019, 7:58:37 AM +881ms
+1ms ╔Received event [Garage Entry].contact = open with a delay of 184ms
+86ms ║RunTime Analysis CS > 20ms > PS > 43ms > PE > 23ms > CE
+88ms ║Runtime (37778 bytes) successfully initialized in 43ms (v0.3.110.20191009) (86ms)
+89ms ║╔Execution stage started
+96ms ║║Comparison (enum) open changes_to (string) open = true (0ms)
+98ms ║║Cancelling condition #2’s schedules…
+99ms ║║Condition #2 evaluated true (5ms)
+100ms ║║Cancelling condition #1’s schedules…
+100ms ║║Condition group #1 evaluated true (state changed) (7ms)
+102ms ║║Cancelling statement #3’s schedules…
+109ms ║║Skipped execution of physical command [Garage Lights].on([]) because it would make no change to the device. (4ms)
+110ms ║║Executed [Garage Lights].on (5ms)
+113ms ║║Executed virtual command [Garage Lights].wait (0ms)
+114ms ║║Requesting a wake up for Tue, Dec 3 2019 @ 8:03:37 AM MST (in 300.0s)
+118ms ║╚Execution stage complete. (29ms)
+120ms ║Setting up scheduled job for Tue, Dec 3 2019 @ 8:03:37 AM MST (in 299.996s)
+132ms ╚Event processed successfully (131ms)
12/3/2019, 7:35:17 AM +235ms
+1ms ╔Received event [Home].time = 1575383718424 with a delay of -1189ms
+164ms ║RunTime Analysis CS > 44ms > PS > 86ms > PE > 33ms > CE
+166ms ║Runtime (37779 bytes) successfully initialized in 86ms (v0.3.110.20191009) (164ms)
+167ms ║╔Execution stage started
+168ms ║╚Execution stage complete. (1ms)
+169ms ╚Event processed successfully (169ms)
12/3/2019, 7:30:22 AM +888ms
+1ms ╔Received event [Garage Entry].contact = closed with a delay of 179ms
+87ms ║RunTime Analysis CS > 22ms > PS > 43ms > PE > 22ms > CE
+89ms ║Runtime (37773 bytes) successfully initialized in 43ms (v0.3.110.20191009) (87ms)
+90ms ║╔Execution stage started
+97ms ║║Comparison (enum) closed changes_to (string) open = false (0ms)
+98ms ║║Cancelling condition #2’s schedules…
+99ms ║║Condition #2 evaluated false (5ms)
+100ms ║║Cancelling condition #1’s schedules…
+100ms ║║Condition group #1 evaluated false (state changed) (6ms)
+102ms ║╚Execution stage complete. (12ms)
+103ms ╚Event processed successfully (103ms)
12/3/2019, 7:30:18 AM +138ms
+2ms ╔Received event [Garage Entry].contact = open with a delay of 299ms
+226ms ║RunTime Analysis CS > 40ms > PS > 72ms > PE > 114ms > CE
+228ms ║Runtime (37780 bytes) successfully initialized in 72ms (v0.3.110.20191009) (226ms)
+229ms ║╔Execution stage started
+236ms ║║Comparison (enum) open changes_to (string) open = true (1ms)
+238ms ║║Cancelling condition #2’s schedules…
+239ms ║║Condition #2 evaluated true (5ms)
+240ms ║║Cancelling condition #1’s schedules…
+240ms ║║Condition group #1 evaluated true (state changed) (7ms)
+242ms ║║Cancelling statement #3’s schedules…
+281ms ║║Executed physical command [Garage Lights].on() (35ms)
+282ms ║║Executed [Garage Lights].on (37ms)
+285ms ║║Executed virtual command [Garage Lights].wait (1ms)
+286ms ║║Requesting a wake up for Tue, Dec 3 2019 @ 7:35:18 AM MST (in 300.0s)
+289ms ║╚Execution stage complete. (60ms)
+291ms ║Setting up scheduled job for Tue, Dec 3 2019 @ 7:35:18 AM MST (in 299.996s)
+300ms ╚Event processed successfully (300ms)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


Lights changing status when it should stay the same status
#2

This is a common question for new users. The door closing event is canceling your timer. The fix is to set the TCP (task cancellation policy) on the with to Never.

Clicking the with brings the following up on the right hand of the screen…
image

You can also click the COG icon and it will bring up the following…


#3

and you might want to check this post… all about WAIT


#4

Thanks! I have updated the cancellation policy to ‘Never’

I was so stumped because i have a similar piston that turns lights on when an arrival sensor arrives at home, and it always turns the hallway light off after 5 minutes.

I would imagine that for that piston, if the arrival sensor left before the 5 minute timer went off, then it would cancel that task as well - just haven’t had that occur yet.