Wyze cam as a motion sensor. code will not execute after WAIT


#1

I am using my Wyze cam as a motion sensor on my driveway (IFTTT turns on a virtual switch when motion is detected). In a seperate pistion, if the Virtural switch is turned on the piston will turn it off after 5 seconds.

When motion on my driveway is detected I on turn of various lights to 100% , then they go back to their orginal state after the 10 second timmer.

My problem is that when motion timer above turns the virtural switch OFF the code below stops executing after the 10 second Wait. So the lights stay at 100%.

Is there a way for all of my code to execute when the virtual switch switches to ON?

LOG
10/10/2019, 12:41:19 PM +119ms
+0ms ╔Received event [Home].time = 1570729280478 with a delay of -1359ms
+124ms ║RunTime Analysis CS > 45ms > PS > 46ms > PE > 32ms > CE
+126ms ║Runtime (40150 bytes) successfully initialized in 46ms (v0.3.10f.20190822) (125ms)
+128ms ║╔Execution stage started
+129ms ║╚Execution stage complete. (1ms)
+130ms ╚Event processed successfully (130ms)
10/10/2019, 12:41:14 PM +443ms
+1ms ╔Received event [Ext. Garage Motion Wyze V].switch = off with a delay of 107ms
+72ms ║RunTime Analysis CS > 16ms > PS > 28ms > PE > 28ms > CE
+74ms ║Runtime (40153 bytes) successfully initialized in 28ms (v0.3.10f.20190822) (72ms)
+75ms ║╔Execution stage started
+82ms ║║Comparison (enum) off changes_to (string) on = false (0ms)
+84ms ║║Cancelling condition #15’s schedules…
+85ms ║║Condition #15 evaluated false (5ms)
+86ms ║║Cancelling condition #14’s schedules…
+87ms ║║Condition group #14 evaluated false (state changed) (8ms)
+88ms ║║Cancelling condition #1’s schedules…
+89ms ║║Condition group #1 evaluated false (state changed) (9ms)
+91ms ║╚Execution stage complete. (15ms)
+92ms ╚Event processed successfully (92ms)
10/10/2019, 12:41:10 PM +257ms
+1ms ╔Received event [Ext. Garage Motion Wyze V].switch = on with a delay of 116ms
+103ms ║RunTime Analysis CS > 20ms > PS > 48ms > PE > 36ms > CE
+106ms ║Runtime (40162 bytes) successfully initialized in 48ms (v0.3.10f.20190822) (103ms)
+107ms ║╔Execution stage started
+114ms ║║Comparison (enum) on changes_to (string) on = true (0ms)
+116ms ║║Cancelling condition #15’s schedules…
+117ms ║║Condition #15 evaluated true (6ms)
+118ms ║║Cancelling condition #14’s schedules…
+119ms ║║Condition group #14 evaluated true (state changed) (7ms)
+120ms ║║Cancelling condition #1’s schedules…
+120ms ║║Condition group #1 evaluated true (state changed) (10ms)
+122ms ║║Cancelling statement #4’s schedules…
+136ms ║║Executed virtual command [Exterior Lamps].saveStateGlobally (8ms)
+146ms ║║Executed virtual command [Exterior Side door lantern].saveStateGlobally (8ms)
+155ms ║║Executed virtual command [Exterior Soffit Lights].saveStateGlobally (7ms)
+166ms ║║Executed virtual command [Ext. Front balcony].saveStateGlobally (6ms)
+176ms ║║Executed virtual command [Ext. Front porch].saveStateGlobally (7ms)
+185ms ║║Skipped execution of physical command [Exterior Lamps].setLevel([100]) because it would make no change to the device. (6ms)
+186ms ║║Executed [Exterior Lamps].setLevel (6ms)
+192ms ║║Skipped execution of physical command [Exterior Side door lantern].setLevel([100]) because it would make no change to the device. (5ms)
+193ms ║║Executed [Exterior Side door lantern].setLevel (7ms)
+201ms ║║Skipped execution of physical command [Exterior Soffit Lights].setLevel([100]) because it would make no change to the device. (6ms)
+201ms ║║Executed [Exterior Soffit Lights].setLevel (7ms)
+208ms ║║Skipped execution of physical command [Ext. Front balcony].setLevel([100]) because it would make no change to the device. (5ms)
+209ms ║║Executed [Ext. Front balcony].setLevel (7ms)
+216ms ║║Skipped execution of physical command [Ext. Front porch].setLevel([100]) because it would make no change to the device. (6ms)
+217ms ║║Executed [Ext. Front porch].setLevel (6ms)
+220ms ║║Executed virtual command [Exterior Lamps, Exterior Side door lantern, Exterior Soffit Lights, Ext. Front balcony, Ext. Front porch].wait (0ms)
+221ms ║║Requesting a wake up for Thu, Oct 10 2019 @ 12:41:20 PM CDT (in 10.0s)
+225ms ║╚Execution stage complete. (118ms)
+226ms ║Setting up scheduled job for Thu, Oct 10 2019 @ 12:41:20 PM CDT (in 9.996s)
+234ms ╚Event processed successfully (234ms)
10/10/2019, 12:37:44 PM +145ms
+1ms ╔Received event [Home].time = 1570729065472 with a delay of -1327ms
+94ms ║RunTime Analysis CS > 18ms > PS > 45ms > PE > 31ms > CE
+97ms ║Runtime (40151 bytes) successfully initialized in 45ms (v0.3.10f.20190822) (96ms)
+98ms ║╔Execution stage started
+99ms ║╚Execution stage complete. (1ms)
+100ms ╚Event processed successfully (100ms)
10/10/2019, 12:37:39 PM +441ms
+1ms ╔Received event [Ext. Garage Motion Wyze V].switch = off with a delay of 105ms
+105ms ║RunTime Analysis CS > 29ms > PS > 50ms > PE > 27ms > CE
+108ms ║Runtime (40156 bytes) successfully initialized in 50ms (v0.3.10f.20190822) (106ms)
+109ms ║╔Execution stage started
+116ms ║║Comparison (enum) off changes_to (string) on = false (0ms)
+118ms ║║Cancelling condition #15’s schedules…
+119ms ║║Condition #15 evaluated false (5ms)
+120ms ║║Cancelling condition #14’s schedules…
+121ms ║║Condition group #14 evaluated false (state changed) (8ms)
+122ms ║║Cancelling condition #1’s schedules…
+123ms ║║Condition group #1 evaluated false (state changed) (9ms)
+125ms ║╚Execution stage complete. (16ms)
+126ms ╚Event processed successfully (126ms)
10/10/2019, 12:37:35 PM +177ms
+1ms ╔Received event [Ext. Garage Motion Wyze V].switch = on with a delay of 112ms
+99ms ║RunTime Analysis CS > 17ms > PS > 46ms > PE > 36ms > CE
+102ms ║Runtime (40162 bytes) successfully initialized in 46ms (v0.3.10f.20190822) (100ms)
+103ms ║╔Execution stage started
+110ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+112ms ║║Cancelling condition #15’s schedules…
+112ms ║║Condition #15 evaluated true (5ms)
+113ms ║║Cancelling condition #14’s schedules…
+114ms ║║Condition group #14 evaluated true (state changed) (7ms)
+115ms ║║Cancelling condition #1’s schedules…
+116ms ║║Condition group #1 evaluated true (state changed) (10ms)
+118ms ║║Cancelling statement #4’s schedules…
+130ms ║║Executed virtual command [Exterior Lamps].saveStateGlobally (7ms)
+139ms ║║Executed virtual command [Exterior Side door lantern].saveStateGlobally (7ms)
+148ms ║║Executed virtual command [Exterior Soffit Lights].saveStateGlobally (6ms)
+157ms ║║Executed virtual command [Ext. Front balcony].saveStateGlobally (6ms)
+165ms ║║Executed virtual command [Ext. Front porch].saveStateGlobally (4ms)
+208ms ║║Executed physical command [Exterior Lamps].setLevel([100]) (41ms)
+209ms ║║Executed [Exterior Lamps].setLevel (41ms)
+238ms ║║Executed physical command [Exterior Side door lantern].setLevel([100]) (27ms)
+239ms ║║Executed [Exterior Side door lantern].setLevel (29ms)
+261ms ║║Executed physical command [Exterior Soffit Lights].setLevel([100]) (21ms)
+262ms ║║Executed [Exterior Soffit Lights].setLevel (22ms)
+277ms ║║Executed physical command [Ext. Front balcony].setLevel([100]) (14ms)
+278ms ║║Executed [Ext. Front balcony].setLevel (16ms)
+289ms ║║Executed physical command [Ext. Front porch].setLevel([100]) (10ms)
+290ms ║║Executed [Ext. Front porch].setLevel (11ms)
+293ms ║║Executed virtual command [Exterior Lamps, Exterior Side door lantern, Exterior Soffit Lights, Ext. Front balcony, Ext. Front porch].wait (1ms)
+294ms ║║Requesting a wake up for Thu, Oct 10 2019 @ 12:37:45 PM CDT (in 10.0s)
+298ms ║╚Execution stage complete. (196ms)
+299ms ║Setting up scheduled job for Thu, Oct 10 2019 @ 12:37:45 PM CDT (in 9.996s)
+307ms ╚Event processed successfully (307ms)


#2

On the DO, I don’t see that you have “TCP” , Task Cancellation Policy, set to never, click the cog to find it.


#3

Got it. Thanks