A Noob with "Wait" function issues


#1

1) Give a description of the problem
I am trying to get a basic light on, wait, turn off but it seems to be having issues. I previously had a similar piston working but managed to delete it. As I did having one working, im pretty sure i have done everything correct.

Some help or advice on this would be greatly appreciated and could you guy possibly explain any suggested changes in the piston to help a Noobie learn for next time.

2) What is the expected behaviour?
When motion is detected when the light level and loctation mode is correct I expect the selected lights to turn on. Then, after 5min the lights should turn off.

3) What is happening/not happening?
The piston is working up until the “wait” bit. When I “Trace” the piston, i see the timer count down to zero, it changes to say “pending” then the timer next to the wait function starts counting up and the lights stay on indefinitely. The other confusing issue is that sometimes the piston actually works! Looking at the log it seems as if the timer (that show next the the “wait” function when Trace is checked) counts up to 3-4min and then the piston restarts and the 5min/300sec countdown begins again.
.
**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full

5/30/2019, 7:00:46 PM +484ms
+0ms â•”Received event [Home].execute = recovery with a delay of 49ms
+89ms â•‘RunTime Analysis CS > 20ms > PS > 43ms > PE > 27ms > CE
+92ms â•‘Runtime (40113 bytes) successfully initialized in 43ms (v0.3.10c.20190522) (91ms)
+93ms â•‘â•”Execution stage started
+107ms â•‘â•‘Condition #5 evaluated false (8ms)
+109ms â•‘â•‘Condition group #3 evaluated false (state did not change) (9ms)
+112ms â•‘â•‘Cancelling statement #28's schedules...
+122ms â•‘â•‘Executed virtual command [Hue ambiance spot 1, Hue ambiance spot 2, Hue ambiance spot 3].wait (0ms)
+123ms â•‘â•‘Requesting a wake up for Thu, May 30 2019 @ 7:05:46 PM BST (in 300.0s)
+129ms ║╚Execution stage complete. (36ms)
+131ms â•‘Setting up scheduled job for Thu, May 30 2019 @ 7:05:46 PM BST (in 299.994s)
+144ms ╚Event processed successfully (143ms)
5/30/2019, 7:00:38 PM +526ms
+75ms â•”Received event [Home].time = 1559239189925 with a delay of 48595ms
+5267ms â•‘RunTime Analysis CS > 4001ms > PS > 774ms > PE > 498ms > CE
+5271ms â•‘Runtime (40126 bytes) successfully initialized in 774ms (v0.3.10c.20190522) (5179ms)
+5273ms â•‘â•”Execution stage started
+5322ms ║╚Execution stage complete. (50ms)
+6245ms â•‘Setting up scheduled job for Thu, May 30 2019 @ 6:59:49 PM BST (in 1s)
+6257ms ╚Event processed successfully (6257ms)
5/30/2019, 6:54:49 PM +799ms
+1ms â•”Received event [Home].execute = recovery with a delay of 67ms
+93ms â•‘RunTime Analysis CS > 21ms > PS > 46ms > PE > 26ms > CE
+96ms â•‘Runtime (40113 bytes) successfully initialized in 46ms (v0.3.10c.20190522) (93ms)
+97ms â•‘â•”Execution stage started
+111ms â•‘â•‘Condition #5 evaluated false (7ms)
+112ms â•‘â•‘Condition group #3 evaluated false (state did not change) (10ms)
+115ms â•‘â•‘Cancelling statement #28's schedules...
+124ms â•‘â•‘Executed virtual command [Hue ambiance spot 1, Hue ambiance spot 2, Hue ambiance spot 3].wait (1ms)
+126ms â•‘â•‘Requesting a wake up for Thu, May 30 2019 @ 6:59:49 PM BST (in 300.0s)
+137ms ║╚Execution stage complete. (41ms)
+139ms â•‘Setting up scheduled job for Thu, May 30 2019 @ 6:59:49 PM BST (in 299.988s)
+150ms ╚Event processed successfully (150ms)
5/30/2019, 6:47:06 PM +440ms
+1ms â•”Received event [Hue Motion Sensor (Hall)].motion = inactive with a delay of 58ms
+74ms â•‘RunTime Analysis CS > 15ms > PS > 34ms > PE > 26ms > CE
+77ms â•‘Runtime (40125 bytes) successfully initialized in 34ms (v0.3.10c.20190522) (74ms)
+78ms â•‘â•”Execution stage started
+96ms â•‘â•‘Comparison (enum) inactive changes_to (string) active = false (2ms)
+98ms â•‘â•‘Cancelling condition #5's schedules...
+99ms â•‘â•‘Condition #5 evaluated false (10ms)
+101ms â•‘â•‘Cancelling condition #3's schedules...
+102ms â•‘â•‘Condition group #3 evaluated false (state changed) (14ms)
+105ms â•‘â•‘Cancelling statement #28's schedules...
+116ms â•‘â•‘Executed virtual command [Hue ambiance spot 1, Hue ambiance spot 2, Hue ambiance spot 3].wait (1ms)
+118ms â•‘â•‘Requesting a wake up for Thu, May 30 2019 @ 6:52:06 PM BST (in 300.0s)
+124ms ║╚Execution stage complete. (46ms)
+126ms â•‘Setting up scheduled job for Thu, May 30 2019 @ 6:52:06 PM BST (in 299.993s)
+138ms ╚Event processed successfully (138ms)
5/30/2019, 6:46:36 PM +446ms
+1ms â•”Received event [Hue Motion Sensor (Hall)].motion = active with a delay of 66ms
+87ms â•‘RunTime Analysis CS > 18ms > PS > 45ms > PE > 24ms > CE
+89ms â•‘Runtime (40130 bytes) successfully initialized in 45ms (v0.3.10c.20190522) (87ms)
+90ms â•‘â•”Execution stage started
+101ms â•‘â•‘Comparison (enum) active changes_to (string) active = true (1ms)
+103ms â•‘â•‘Cancelling condition #5's schedules...
+104ms â•‘â•‘Condition #5 evaluated true (8ms)
+114ms â•‘â•‘Comparison (integer) 6 is_less_than_or_equal_to (integer) 10 = true (2ms)
+116ms â•‘â•‘Condition #4 evaluated true (10ms)
+122ms â•‘â•‘Comparison (string) :4741a60e498c1b32b57b46dfce8e2ee0: is_any_of (string) :302bcc01d8fc7d79826d917e0169f855:,:4741a60e498c1b32b57b46dfce8e2ee0: = true (3ms)
+124ms â•‘â•‘Condition #16 evaluated true (8ms)
+125ms â•‘â•‘Cancelling condition #3's schedules...
+127ms â•‘â•‘Condition group #3 evaluated true (state changed) (30ms)
+129ms â•‘â•‘Cancelling statement #6's schedules...
+146ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 1].on([]) because it would make no change to the device. (4ms)
+147ms â•‘â•‘Executed [Hue ambiance spot 1].on (6ms)
+152ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 2].on([]) because it would make no change to the device. (2ms)
+153ms â•‘â•‘Executed [Hue ambiance spot 2].on (4ms)
+159ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 3].on([]) because it would make no change to the device. (3ms)
+160ms â•‘â•‘Executed [Hue ambiance spot 3].on (5ms)
+180ms â•‘â•‘Executed physical command [Hue ambiance spot 1].setColorTemperature([5000]) (15ms)
+181ms â•‘â•‘Executed [Hue ambiance spot 1].setColorTemperature (17ms)
+195ms â•‘â•‘Executed physical command [Hue ambiance spot 2].setColorTemperature([5000]) (12ms)
+196ms â•‘â•‘Executed [Hue ambiance spot 2].setColorTemperature (14ms)
+211ms â•‘â•‘Executed physical command [Hue ambiance spot 3].setColorTemperature([5000]) (13ms)
+212ms â•‘â•‘Executed [Hue ambiance spot 3].setColorTemperature (15ms)
+222ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 1].setLevel([100]) because it would make no change to the device. (4ms)
+223ms â•‘â•‘Executed [Hue ambiance spot 1].setLevel (6ms)
+231ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 2].setLevel([100]) because it would make no change to the device. (6ms)
+232ms â•‘â•‘Executed [Hue ambiance spot 2].setLevel (7ms)
+239ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 3].setLevel([100]) because it would make no change to the device. (6ms)
+240ms â•‘â•‘Executed [Hue ambiance spot 3].setLevel (7ms)
+245ms ║╚Execution stage complete. (155ms)
+246ms ╚Event processed successfully (247ms)
5/30/2019, 6:46:06 PM +467ms
+1ms â•”Received event [Hue Motion Sensor (Hall)].motion = inactive with a delay of 87ms
+89ms â•‘RunTime Analysis CS > 20ms > PS > 45ms > PE > 25ms > CE
+92ms â•‘Runtime (40125 bytes) successfully initialized in 45ms (v0.3.10c.20190522) (89ms)
+93ms â•‘â•”Execution stage started
+104ms â•‘â•‘Comparison (enum) inactive changes_to (string) active = false (1ms)
+106ms â•‘â•‘Cancelling condition #5's schedules...
+107ms â•‘â•‘Condition #5 evaluated false (8ms)
+108ms â•‘â•‘Cancelling condition #3's schedules...
+110ms â•‘â•‘Condition group #3 evaluated false (state changed) (10ms)
+113ms â•‘â•‘Cancelling statement #28's schedules...
+123ms â•‘â•‘Executed virtual command [Hue ambiance spot 1, Hue ambiance spot 2, Hue ambiance spot 3].wait (1ms)
+124ms â•‘â•‘Requesting a wake up for Thu, May 30 2019 @ 6:51:06 PM BST (in 300.0s)
+130ms ║╚Execution stage complete. (38ms)
+133ms â•‘Setting up scheduled job for Thu, May 30 2019 @ 6:51:06 PM BST (in 299.994s)
+142ms ╚Event processed successfully (142ms)
5/30/2019, 6:45:36 PM +482ms
+2ms â•”Received event [Hue Motion Sensor (Hall)].motion = active with a delay of 89ms
+112ms â•‘RunTime Analysis CS > 25ms > PS > 50ms > PE > 36ms > CE
+116ms â•‘Runtime (40131 bytes) successfully initialized in 50ms (v0.3.10c.20190522) (113ms)
+118ms â•‘â•”Execution stage started
+128ms â•‘â•‘Comparison (enum) active changes_to (string) active = true (1ms)
+130ms â•‘â•‘Cancelling condition #5's schedules...
+132ms â•‘â•‘Condition #5 evaluated true (7ms)
+141ms â•‘â•‘Comparison (integer) 6 is_less_than_or_equal_to (integer) 10 = true (2ms)
+143ms â•‘â•‘Condition #4 evaluated true (11ms)
+149ms â•‘â•‘Comparison (string) :4741a60e498c1b32b57b46dfce8e2ee0: is_any_of (string) :302bcc01d8fc7d79826d917e0169f855:,:4741a60e498c1b32b57b46dfce8e2ee0: = true (3ms)
+151ms â•‘â•‘Condition #16 evaluated true (7ms)
+153ms â•‘â•‘Cancelling condition #3's schedules...
+154ms â•‘â•‘Condition group #3 evaluated true (state changed) (30ms)
+156ms â•‘â•‘Cancelling statement #6's schedules...
+240ms â•‘â•‘Executed physical command [Hue ambiance spot 1].on() (76ms)
+241ms â•‘â•‘Executed [Hue ambiance spot 1].on (78ms)
+263ms â•‘â•‘Executed physical command [Hue ambiance spot 2].on() (19ms)
+264ms â•‘â•‘Executed [Hue ambiance spot 2].on (21ms)
+286ms â•‘â•‘Executed physical command [Hue ambiance spot 3].on() (19ms)
+287ms â•‘â•‘Executed [Hue ambiance spot 3].on (21ms)
+306ms â•‘â•‘Executed physical command [Hue ambiance spot 1].setColorTemperature([5000]) (13ms)
+307ms â•‘â•‘Executed [Hue ambiance spot 1].setColorTemperature (16ms)
+320ms â•‘â•‘Executed physical command [Hue ambiance spot 2].setColorTemperature([5000]) (11ms)
+321ms â•‘â•‘Executed [Hue ambiance spot 2].setColorTemperature (13ms)
+336ms â•‘â•‘Executed physical command [Hue ambiance spot 3].setColorTemperature([5000]) (13ms)
+337ms â•‘â•‘Executed [Hue ambiance spot 3].setColorTemperature (15ms)
+347ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 1].setLevel([100]) because it would make no change to the device. (5ms)
+348ms â•‘â•‘Executed [Hue ambiance spot 1].setLevel (7ms)
+356ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 2].setLevel([100]) because it would make no change to the device. (5ms)
+357ms â•‘â•‘Executed [Hue ambiance spot 2].setLevel (7ms)
+376ms â•‘â•‘Executed physical command [Hue ambiance spot 3].setLevel([100]) (17ms)
+378ms â•‘â•‘Executed [Hue ambiance spot 3].setLevel (20ms)
+382ms ║╚Execution stage complete. (264ms)
+383ms ╚Event processed successfully (383ms)
5/30/2019, 6:45:22 PM +47ms
+2ms â•”Received event [Home].time = 1559238306673 with a delay of 15374ms
+707ms â•‘RunTime Analysis CS > 284ms > PS > 396ms > PE > 25ms > CE
+711ms â•‘Runtime (40122 bytes) successfully initialized in 396ms (v0.3.10c.20190522) (706ms)
+712ms â•‘â•”Execution stage started
+1685ms â•‘â•‘Executed physical command [Hue ambiance spot 1].off() (20ms)
+1687ms â•‘â•‘Executed [Hue ambiance spot 1].off (22ms)
+1704ms â•‘â•‘Executed physical command [Hue ambiance spot 2].off() (14ms)
+1705ms â•‘â•‘Executed [Hue ambiance spot 2].off (17ms)
+1722ms â•‘â•‘Executed physical command [Hue ambiance spot 3].off() (13ms)
+1723ms â•‘â•‘Executed [Hue ambiance spot 3].off (17ms)
+1727ms ║╚Execution stage complete. (1015ms)
+1729ms ╚Event processed successfully (1728ms)
5/30/2019, 6:40:06 PM +570ms
+1ms â•”Received event [Hue Motion Sensor (Hall)].motion = inactive with a delay of 66ms
+71ms â•‘RunTime Analysis CS > 16ms > PS > 34ms > PE > 21ms > CE
+74ms â•‘Runtime (40130 bytes) successfully initialized in 34ms (v0.3.10c.20190522) (72ms)
+75ms â•‘â•”Execution stage started
+85ms â•‘â•‘Comparison (enum) inactive changes_to (string) active = false (1ms)
+87ms â•‘â•‘Condition #5 evaluated false (6ms)
+88ms â•‘â•‘Condition group #3 evaluated false (state did not change) (8ms)
+91ms â•‘â•‘Cancelling statement #28's schedules...
+100ms â•‘â•‘Executed virtual command [Hue ambiance spot 1, Hue ambiance spot 2, Hue ambiance spot 3].wait (1ms)
+102ms â•‘â•‘Requesting a wake up for Thu, May 30 2019 @ 6:45:06 PM BST (in 300.0s)
+108ms ║╚Execution stage complete. (33ms)
+110ms â•‘Setting up scheduled job for Thu, May 30 2019 @ 6:45:06 PM BST (in 299.994s)
+126ms ╚Event processed successfully (126ms)
5/30/2019, 6:39:36 PM +764ms
+0ms â•”Received event [Home].execute = recovery with a delay of 50ms
+9853ms â•‘RunTime Analysis CS > 21ms > PS > 9810ms > PE > 23ms > CE
+9855ms â•‘Piston waited at a semaphore for 9771ms
+9857ms â•‘Runtime (40186 bytes) successfully initialized in 9810ms (v0.3.10c.20190522) (9856ms)
+9858ms â•‘â•”Execution stage started
+9872ms â•‘â•‘Condition #5 evaluated false (8ms)
+9873ms â•‘â•‘Condition group #3 evaluated false (state did not change) (9ms)
+9876ms â•‘â•‘Cancelling statement #28's schedules...
+9886ms â•‘â•‘Executed virtual command [Hue ambiance spot 1, Hue ambiance spot 2, Hue ambiance spot 3].wait (1ms)
+9888ms â•‘â•‘Requesting a wake up for Thu, May 30 2019 @ 6:44:46 PM BST (in 300.0s)
+9893ms ║╚Execution stage complete. (35ms)
+9895ms â•‘Setting up scheduled job for Thu, May 30 2019 @ 6:44:46 PM BST (in 299.995s)
+9907ms ╚Event processed successfully (9906ms)
5/30/2019, 6:39:37 PM +44ms
+1ms â•”Received event [Home].execute = recovery with a delay of 67ms
+97ms â•‘RunTime Analysis CS > 22ms > PS > 48ms > PE > 26ms > CE
+100ms â•‘Runtime (40106 bytes) successfully initialized in 48ms (v0.3.10c.20190522) (97ms)
+102ms â•‘â•”Execution stage started
+117ms â•‘â•‘Cancelling condition #5's schedules...
+119ms â•‘â•‘Condition #5 evaluated false (10ms)
+121ms â•‘â•‘Cancelling condition #3's schedules...
+122ms â•‘â•‘Condition group #3 evaluated false (state changed) (13ms)
+126ms â•‘â•‘Cancelling statement #28's schedules...
+138ms â•‘â•‘Executed virtual command [Hue ambiance spot 1, Hue ambiance spot 2, Hue ambiance spot 3].wait (0ms)
+140ms â•‘â•‘Requesting a wake up for Thu, May 30 2019 @ 6:44:37 PM BST (in 300.0s)
+146ms ║╚Execution stage complete. (44ms)
+148ms â•‘Setting up scheduled job for Thu, May 30 2019 @ 6:44:37 PM BST (in 299.994s)
+157ms ╚Event processed successfully (157ms)
5/30/2019, 6:39:36 PM +491ms
+1ms â•”Received event [Hue Motion Sensor (Hall)].motion = active with a delay of 78ms
+125ms â•‘RunTime Analysis CS > 26ms > PS > 64ms > PE > 35ms > CE
+128ms â•‘Runtime (40131 bytes) successfully initialized in 64ms (v0.3.10c.20190522) (125ms)
+129ms â•‘â•”Execution stage started
+140ms â•‘â•‘Comparison (enum) active changes_to (string) active = true (1ms)
+142ms â•‘â•‘Cancelling condition #5's schedules...
+143ms â•‘â•‘Condition #5 evaluated true (8ms)
+154ms â•‘â•‘Comparison (integer) 5 is_less_than_or_equal_to (integer) 10 = true (2ms)
+156ms â•‘â•‘Condition #4 evaluated true (11ms)
+162ms â•‘â•‘Comparison (string) :4741a60e498c1b32b57b46dfce8e2ee0: is_any_of (string) :302bcc01d8fc7d79826d917e0169f855:,:4741a60e498c1b32b57b46dfce8e2ee0: = true (3ms)
+165ms â•‘â•‘Condition #16 evaluated true (7ms)
+166ms â•‘â•‘Cancelling condition #3's schedules...
+167ms â•‘â•‘Condition group #3 evaluated true (state changed) (32ms)
+171ms â•‘â•‘Cancelling statement #6's schedules...
+210ms â•‘â•‘Executed physical command [Hue ambiance spot 1].on() (19ms)
+212ms â•‘â•‘Executed [Hue ambiance spot 1].on (22ms)
+236ms â•‘â•‘Executed physical command [Hue ambiance spot 2].on() (18ms)
+238ms â•‘â•‘Executed [Hue ambiance spot 2].on (22ms)
+262ms â•‘â•‘Executed physical command [Hue ambiance spot 3].on() (18ms)
+264ms â•‘â•‘Executed [Hue ambiance spot 3].on (22ms)
+285ms â•‘â•‘Executed physical command [Hue ambiance spot 1].setColorTemperature([5000]) (12ms)
+287ms â•‘â•‘Executed [Hue ambiance spot 1].setColorTemperature (16ms)
+303ms â•‘â•‘Executed physical command [Hue ambiance spot 2].setColorTemperature([5000]) (12ms)
+305ms â•‘â•‘Executed [Hue ambiance spot 2].setColorTemperature (16ms)
+412ms â•‘â•‘Executed physical command [Hue ambiance spot 3].setColorTemperature([5000]) (104ms)
+413ms â•‘â•‘Executed [Hue ambiance spot 3].setColorTemperature (107ms)
+424ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 1].setLevel([100]) because it would make no change to the device. (5ms)
+425ms â•‘â•‘Executed [Hue ambiance spot 1].setLevel (7ms)
+432ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 2].setLevel([100]) because it would make no change to the device. (5ms)
+433ms â•‘â•‘Executed [Hue ambiance spot 2].setLevel (7ms)
+440ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 3].setLevel([100]) because it would make no change to the device. (4ms)
+441ms â•‘â•‘Executed [Hue ambiance spot 3].setLevel (6ms)
+444ms ║╚Execution stage complete. (316ms)
+446ms ╚Event processed successfully (446ms)`Preformatted text`

#2

I have not tested it, but I suspect you need to set your Task Cancellation Policy of your IF to Never Cancel. I suspect your Wait is long enough to allow your motion sensor to reset. That cancels your piston execution and restarts from the beginning because the “trigger” state has changed.


#3

Thanks @Pantheon for the suggestion however it doesn’t look like it has resolved the issue. I also tried the No Task Cancellation Policy on the “With” statement only, and also the “If” and "with together with no success.

5/30/2019, 9:41:39 PM +759ms
+2ms â•”Received event [Hue Motion Sensor (Hall)].motion = inactive with a delay of 74ms
+170ms â•‘RunTime Analysis CS > 17ms > PS > 120ms > PE > 32ms > CE
+173ms â•‘Runtime (40125 bytes) successfully initialized in 120ms (v0.3.10c.20190522) (171ms)
+175ms â•‘â•”Execution stage started
+186ms â•‘â•‘Comparison (enum) inactive changes_to (string) active = false (1ms)
+188ms â•‘â•‘Cancelling condition #5's schedules...
+189ms â•‘â•‘Condition #5 evaluated false (8ms)
+191ms â•‘â•‘Cancelling condition #3's schedules...
+192ms â•‘â•‘Condition group #3 evaluated false (state changed) (11ms)
+195ms â•‘â•‘Cancelling statement #28's schedules...
+205ms â•‘â•‘Executed virtual command [Hue ambiance spot 1, Hue ambiance spot 2, Hue ambiance spot 3].wait (1ms)
+207ms â•‘â•‘Requesting a wake up for Thu, May 30 2019 @ 9:46:39 PM BST (in 300.0s)
+214ms ║╚Execution stage complete. (39ms)
+216ms â•‘Setting up scheduled job for Thu, May 30 2019 @ 9:46:39 PM BST (in 299.993s)
+228ms ╚Event processed successfully (228ms)
5/30/2019, 9:41:09 PM +796ms
+0ms â•”Received event [Hue Motion Sensor (Hall)].motion = active with a delay of 77ms
+71ms â•‘RunTime Analysis CS > 15ms > PS > 33ms > PE > 24ms > CE
+74ms â•‘Runtime (40127 bytes) successfully initialized in 33ms (v0.3.10c.20190522) (72ms)
+75ms â•‘â•”Execution stage started
+86ms â•‘â•‘Comparison (enum) active changes_to (string) active = true (1ms)
+87ms â•‘â•‘Cancelling condition #5's schedules...
+89ms â•‘â•‘Condition #5 evaluated true (7ms)
+98ms â•‘â•‘Comparison (integer) 0 is_less_than_or_equal_to (integer) 10 = true (1ms)
+100ms â•‘â•‘Condition #4 evaluated true (9ms)
+105ms â•‘â•‘Comparison (string) :302bcc01d8fc7d79826d917e0169f855: is_any_of (string) :302bcc01d8fc7d79826d917e0169f855:,:4741a60e498c1b32b57b46dfce8e2ee0: = true (2ms)
+107ms â•‘â•‘Condition #16 evaluated true (7ms)
+108ms â•‘â•‘Cancelling condition #3's schedules...
+109ms â•‘â•‘Condition group #3 evaluated true (state changed) (28ms)
+113ms â•‘â•‘Cancelling statement #6's schedules...
+133ms â•‘â•‘Executed physical command [Hue ambiance spot 1].on() (13ms)
+134ms â•‘â•‘Executed [Hue ambiance spot 1].on (15ms)
+151ms â•‘â•‘Executed physical command [Hue ambiance spot 2].on() (14ms)
+152ms â•‘â•‘Executed [Hue ambiance spot 2].on (16ms)
+168ms â•‘â•‘Executed physical command [Hue ambiance spot 3].on() (13ms)
+170ms â•‘â•‘Executed [Hue ambiance spot 3].on (15ms)
+185ms â•‘â•‘Executed physical command [Hue ambiance spot 1].setColorTemperature([5000]) (10ms)
+186ms â•‘â•‘Executed [Hue ambiance spot 1].setColorTemperature (12ms)
+197ms â•‘â•‘Executed physical command [Hue ambiance spot 2].setColorTemperature([5000]) (10ms)
+198ms â•‘â•‘Executed [Hue ambiance spot 2].setColorTemperature (11ms)
+210ms â•‘â•‘Executed physical command [Hue ambiance spot 3].setColorTemperature([5000]) (10ms)
+211ms â•‘â•‘Executed [Hue ambiance spot 3].setColorTemperature (12ms)
+221ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 1].setLevel([100]) because it would make no change to the device. (4ms)
+222ms â•‘â•‘Executed [Hue ambiance spot 1].setLevel (6ms)
+228ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 2].setLevel([100]) because it would make no change to the device. (5ms)
+230ms â•‘â•‘Executed [Hue ambiance spot 2].setLevel (6ms)
+246ms â•‘â•‘Executed physical command [Hue ambiance spot 3].setLevel([100]) (15ms)
+248ms â•‘â•‘Executed [Hue ambiance spot 3].setLevel (16ms)
+251ms ║╚Execution stage complete. (177ms)
+253ms ╚Event processed successfully (254ms)

#4

Ok, my fault. I did not read your post correctly the first time. As I understand it, you want to do the following :
When motion is detected
and illuminance is low (it’s dark)
and location mode is Home - Evening or Home - Day
Then
Turn on the Kitchen Lights
Set the color to 5000
Set the level to 100%

Then you want to wait 5 minutes and turn Kitchen Lights off. Is that correct?
If so, then move everything from your ELSE statement into the THEN statement :

IF motion_1 motion changes to active
     and illuminance is less than or equal to 10
     and Location mode is Home - Evening or Home - Day
Then
     With Kitchen_Lights
	Turn ON
	Set color to 5000
	Set level to 100%
	Wait 300 seconds
	Turn OFF

You will still need to set your Task Cancellation Policy to Never Cancel.


#5

If that works for you, then you may want to give things a little more thought. Let’s say you walk into the kitchen and the lights turn on as desired. And then you leave. If you walk back into the Kitchen 4 minutes and 59 seconds later, the lights will turn off and may not turn back on.


#6

One way to address that problem is :

IF motion_1 motion changes to active
     and illuminance is less than or equal to 10
     and Location mode is Home - Evening or Home - Day
Then
     With Kitchen_Lights
	Turn ON
	Set color to 5000
	Set level to 100%
END IF

IF motion_1  motion stays inactive for 5 minutes
Then
Turn Kitchen Lights Off
END IF

#8

I gave the “Wait” function another go and it was hit and miss to whether it worked or not so, i tried your other suggestion of “inactive for Xmins then”. Again this was hit and miss. I set the time for 1min for testing. You can see in the log that a full 10mins of inactivity went past until the lights turned off.

6/1/2019, 12:14:48 PM +762ms
+1ms â•”Received event [Home].execute = recovery with a delay of 61ms
+110ms â•‘RunTime Analysis CS > 18ms > PS > 35ms > PE > 57ms > CE
+112ms â•‘Runtime (40473 bytes) successfully initialized in 35ms (v0.3.10c.20190522) (110ms)
+113ms â•‘â•”Execution stage started
+128ms â•‘â•‘Condition #5 evaluated false (7ms)
+129ms â•‘â•‘Condition group #3 evaluated false (state did not change) (9ms)
+141ms â•‘â•‘Comparison (enum) inactive stays (string) inactive = true (2ms)
+145ms â•‘â•‘Condition #18 evaluated false (11ms)
+146ms â•‘â•‘Condition group #17 evaluated false (state did not change) (14ms)
+168ms ║║Cancelling condition #18’s schedules…
+169ms â•‘â•‘Condition #18 evaluated true (2ms)
+171ms ║║Cancelling condition #17’s schedules…
+172ms â•‘â•‘Condition group #17 evaluated true (state changed) (5ms)
+175ms ║║Cancelling statement #19’s schedules…
+195ms â•‘â•‘Executed physical command [Hue ambiance spot 1].off() (13ms)
+197ms â•‘â•‘Executed [Hue ambiance spot 1].off (15ms)
+213ms â•‘â•‘Executed physical command [Hue ambiance spot 2].off() (13ms)
+215ms â•‘â•‘Executed [Hue ambiance spot 2].off (15ms)
+231ms â•‘â•‘Executed physical command [Hue ambiance spot 3].off() (13ms)
+232ms â•‘â•‘Executed [Hue ambiance spot 3].off (16ms)
+235ms ║╚Execution stage complete. (122ms)
+237ms ╚Event processed successfully (237ms)
6/1/2019, 12:04:21 PM +70ms
+1ms â•”Received event [Hue Motion Sensor (Hall)].motion = inactive with a delay of 83ms
+107ms â•‘RunTime Analysis CS > 18ms > PS > 41ms > PE > 48ms > CE
+110ms â•‘Runtime (40488 bytes) successfully initialized in 41ms (v0.3.10c.20190522) (107ms)
+111ms â•‘â•”Execution stage started
+121ms â•‘â•‘Comparison (enum) inactive changes_to (string) active = false (0ms)
+123ms ║║Cancelling condition #5’s schedules…
+124ms â•‘â•‘Condition #5 evaluated false (6ms)
+125ms ║║Cancelling condition #3’s schedules…
+126ms â•‘â•‘Condition group #3 evaluated false (state changed) (10ms)
+135ms â•‘â•‘Comparison (enum) inactive stays (string) inactive = true (2ms)
+138ms â•‘â•‘Adding a timed trigger schedule for condition 18
+141ms â•‘â•‘Condition #18 evaluated false (12ms)
+142ms â•‘â•‘Condition group #17 evaluated false (state did not change) (13ms)
+145ms ║╚Execution stage complete. (35ms)
+147ms â•‘Setting up scheduled job for Sat, Jun 1 2019 @ 12:05:21 PM BST (in 59.993s)
+170ms ╚Event processed successfully (169ms)
6/1/2019, 12:03:51 PM +32ms
+1ms â•”Received event [Hue Motion Sensor (Hall)].motion = active with a delay of 79ms
+100ms â•‘RunTime Analysis CS > 15ms > PS > 35ms > PE > 49ms > CE
+103ms â•‘Runtime (40488 bytes) successfully initialized in 35ms (v0.3.10c.20190522) (100ms)
+104ms â•‘â•”Execution stage started
+114ms â•‘â•‘Comparison (enum) active changes_to (string) active = true (1ms)
+116ms ║║Cancelling condition #5’s schedules…
+117ms â•‘â•‘Condition #5 evaluated true (7ms)
+126ms â•‘â•‘Comparison (integer) 34 is_less_than_or_equal_to (integer) 100 = true (2ms)
+128ms â•‘â•‘Condition #4 evaluated true (10ms)
+135ms â•‘â•‘Comparison (string) :4741a60e498c1b32b57b46dfce8e2ee0: is_any_of (string) :302bcc01d8fc7d79826d917e0169f855:,:4741a60e498c1b32b57b46dfce8e2ee0: = true (2ms)
+137ms â•‘â•‘Condition #16 evaluated true (7ms)
+138ms ║║Cancelling condition #3’s schedules…
+139ms â•‘â•‘Condition group #3 evaluated true (state changed) (30ms)
+142ms ║║Cancelling statement #6’s schedules…
+165ms â•‘â•‘Executed physical command [Hue ambiance spot 1].on() (15ms)
+166ms â•‘â•‘Executed [Hue ambiance spot 1].on (17ms)
+183ms â•‘â•‘Executed physical command [Hue ambiance spot 2].on() (14ms)
+185ms â•‘â•‘Executed [Hue ambiance spot 2].on (16ms)
+201ms â•‘â•‘Executed physical command [Hue ambiance spot 3].on() (14ms)
+202ms â•‘â•‘Executed [Hue ambiance spot 3].on (16ms)
+218ms â•‘â•‘Executed physical command [Hue ambiance spot 1].setColorTemperature([5000]) (10ms)
+219ms â•‘â•‘Executed [Hue ambiance spot 1].setColorTemperature (13ms)
+231ms â•‘â•‘Executed physical command [Hue ambiance spot 2].setColorTemperature([5000]) (10ms)
+232ms â•‘â•‘Executed [Hue ambiance spot 2].setColorTemperature (12ms)
+244ms â•‘â•‘Executed physical command [Hue ambiance spot 3].setColorTemperature([5000]) (10ms)
+246ms â•‘â•‘Executed [Hue ambiance spot 3].setColorTemperature (12ms)
+255ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 1].setLevel([100]) because it would make no change to the device. (4ms)
+256ms â•‘â•‘Executed [Hue ambiance spot 1].setLevel (7ms)
+264ms â•‘â•‘Skipped execution of physical command [Hue ambiance spot 2].setLevel([100]) because it would make no change to the device. (6ms)
+265ms â•‘â•‘Executed [Hue ambiance spot 2].setLevel (8ms)
+283ms â•‘â•‘Executed physical command [Hue ambiance spot 3].setLevel([100]) (15ms)
+285ms â•‘â•‘Executed [Hue ambiance spot 3].setLevel (18ms)
+298ms â•‘â•‘Comparison (enum) active stays (string) inactive = false (2ms)
+301ms â•‘â•‘Cancelling any timed trigger schedules for condition 18
+302ms ║║Cancelling statement #18’s schedules…
+303ms ║║Cancelling condition #18’s schedules…
+305ms â•‘â•‘Condition #18 evaluated false (13ms)
+307ms ║║Cancelling condition #17’s schedules…
+308ms â•‘â•‘Condition group #17 evaluated false (state changed) (17ms)
+313ms ║╚Execution stage complete. (209ms)
+314ms ╚Event processed successfully (314ms)
6/1/2019, 12:02:35 PM +338ms
+1ms â•”Received event [Home].time = 1559386956375 with a delay of -1038ms
+677ms â•‘RunTime Analysis CS > 163ms > PS > 371ms > PE > 143ms > CE
+681ms â•‘Runtime (40480 bytes) successfully initialized in 371ms (v0.3.10c.20190522) (679ms)
+683ms â•‘â•”Execution stage started
+685ms ║╚Execution stage complete. (3ms)
+688ms ╚Event processed successfully (688ms)


#9

Hmmm…This tells me that your motion sensor is still active in the second IF and therefore the OFF gets cancelled. I wonder if you change the Task Cancellation Policy back to default (since you don’t have a WAIT) if that will allow your lights to turn off after 5 minutes.


#10

@WCmore?


#11

Your latest piston (joqgs) looks good to me… I would not change a thing with that one…

According to the log, webCoRE did what it was programmed to.

12:04:21 PM = Received event [Hue Motion Sensor (Hall)].motion = inactive
12:04:21 PM = Setting up scheduled job for 12:05:21 PM (in 60s)

It seems like something was bogging down your system at 12:05. After ten minutes, webCoRE’s recovery kicked in.

12:14:48 PM = Received event [Home].execute = recovery

This makes me think that you have other pistons/programming looping, and the ST hub was overwhelmed at the time…

If there is too much commotion, sometimes commands will get lost in the ethers…
(kind of like packet losses)


#12

This might have something in it, i have only 3 active pistons however, i have another 3 or 4 “Test” Pistons paused. Is it possible that they are interfering with the active ones?

Thinking about it, i had trouble installing the latest update, could it be that i have somehow got two versions of WebCoRE installed and running together? How would i check this? In Smartthings Classic I only have one WebCoRE smart app displayed but could the be running tin the background?


#13

The number of pistons doesn’t really matter. (I have 396 pistons in my house. Maybe half are paused) Any pistons that are paused will not execute.

What matters is what is happening at the time of execution. It could be another piston looping. It could be another automation in process (ST Routine etc). It could even be heavy internet traffic at the time. For example, when I am bittorrenting, my pistons drop to only 90% reliable.


#14

Hi there just a quick update… I decided to completely start from scratch with regards to uninstall webcore and factory reset the ST Hub. (not as drastic as it sounds lol. I have only been trying to learn this for less than a month so only i had 2 pistons and all my devices import from my Hue Bridge). Now everything is running again i have found that the piston is working as expected as it is setup in the “joqgs” piston. It sometimes lags but it must be a cloud based lag as i have minimal internet traffic.

Thanks for the help and suggestions @Pantheon and @WCmore. It is good to know that there wasn’t anything major wrong with the piston. :smile::+1:


#15

:+1:Welcome to webcore. You will find lots of community help here.