Help with simple piston - made change and it stopped working


#1

1) Give a description of the problem
I changed the piston from two statements (no lights from 20 minutes before sunset) to (no lights after 20 minutes after sunrise), to one statement (no lights from 20 before sunset to 20 after sunrise). The lights didn’t turn on when it triggered, so I changed it back, but still no lights.

2) What is the expected behaviour?
The piston triggers with motion in the driveway and sends me a notification and has my small speaker play track 1. From 20 minutes before sunset to 20 minutes after sunrise, a couple lights turn on for 5 minutes and then turn back off.

3) What is happening/not happening?
No lights at any time.

**4)

)

**5) A lotta logs below!

11/9/2019, 8:30:30 PM +3ms
+1ms ╔Received event [Driveway].contact = open with a delay of 126ms
+73ms ║RunTime Analysis CS > 17ms > PS > 30ms > PE > 25ms > CE
+75ms ║Runtime (38394 bytes) successfully initialized in 30ms (v0.3.110.20191009) (73ms)
+76ms ║╔Execution stage started
+83ms ║║Comparison (enum) open changes_to (string) closed = false (1ms)
+84ms ║║Cancelling condition #2's schedules...
+85ms ║║Condition #2 evaluated false (5ms)
+86ms ║║Cancelling condition #1's schedules...
+87ms ║║Condition group #1 evaluated false (state changed) (7ms)
+89ms ║╚Execution stage complete. (14ms)
+90ms ╚Event processed successfully (90ms)
11/9/2019, 8:30:28 PM +955ms
+0ms ╔Received event [Driveway].contact = closed with a delay of 95ms
+80ms ║RunTime Analysis CS > 17ms > PS > 32ms > PE > 31ms > CE
+82ms ║Runtime (38398 bytes) successfully initialized in 32ms (v0.3.110.20191009) (81ms)
+83ms ║╔Execution stage started
+90ms ║║Comparison (enum) closed changes_to (string) closed = true (0ms)
+91ms ║║Cancelling condition #2's schedules...
+92ms ║║Condition #2 evaluated true (5ms)
+93ms ║║Cancelling condition #1's schedules...
+94ms ║║Condition group #1 evaluated true (state changed) (8ms)
+96ms ║║Cancelling statement #3's schedules...
+253ms ║║Executed physical command [Small Speaker].playTrack([5]) (152ms)
+254ms ║║Executed [Small Speaker].playTrack (153ms)
+256ms ║║Cancelling statement #5's schedules...
+266ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (6ms)
+295ms ║║Comparison (time) 73829224 is_after (time) 1573335000000 = true (5ms)
+296ms ║║Time restriction check passed
+297ms ║║Condition #8 evaluated true (28ms)
+305ms ║║Comparison (time) 73829253 is_before (time) 1573299240000 = false (5ms)
+307ms ║║Condition #9 evaluated false (8ms)
+308ms ║║Condition group #7 evaluated false (state did not change) (39ms)
+310ms ║╚Execution stage complete. (226ms)
+311ms ╚Event processed successfully (311ms)
11/9/2019, 6:14:38 PM +807ms
+1ms ╔Starting piston... (v0.3.110.20191009)
+400ms ║╔Subscribing to devices...
+442ms ║║Subscribing to Driveway.contact...
+515ms ║║Subscribing to Small Speaker...
+517ms ║║Subscribing to Eryc Courmac's iPhone...
+518ms ║║Subscribing to Basement Door Light...
+519ms ║║Subscribing to Driveway Light...
+520ms ║╚Finished subscribing (136ms)
+603ms ║Comparison (time) 65679371 is_after (time) 1573335000000 = true (8ms)
+604ms ║Time restriction check passed
+606ms ║Cancelling condition #8's schedules...
+618ms ║Comparison (time) 65679414 is_before (time) 1573299240000 = false (7ms)
+631ms ╚Piston successfully started (631ms)
11/9/2019, 10:47:38 AM +726ms
+1ms ╔Received event [Driveway].contact = open with a delay of 1459ms
+80ms ║RunTime Analysis CS > 19ms > PS > 37ms > PE > 23ms > CE
+82ms ║Runtime (38396 bytes) successfully initialized in 37ms (v0.3.110.20191009) (80ms)
+83ms ║╔Execution stage started
+89ms ║║Comparison (enum) open changes_to (string) closed = false (1ms)
+90ms ║║Cancelling condition #2's schedules...
+91ms ║║Condition #2 evaluated false (5ms)
+92ms ║║Cancelling condition #1's schedules...
+93ms ║║Condition group #1 evaluated false (state changed) (7ms)
+95ms ║╚Execution stage complete. (12ms)
+96ms ╚Event processed successfully (95ms)
11/9/2019, 10:47:36 AM +201ms
+1ms ╔Received event [Driveway].contact = closed with a delay of 103ms
+118ms ║RunTime Analysis CS > 31ms > PS > 47ms > PE > 41ms > CE
+121ms ║Runtime (38400 bytes) successfully initialized in 47ms (v0.3.110.20191009) (118ms)
+121ms ║╔Execution stage started
+129ms ║║Comparison (enum) closed changes_to (string) closed = true (0ms)
+130ms ║║Cancelling condition #2's schedules...
+131ms ║║Condition #2 evaluated true (5ms)
+132ms ║║Cancelling condition #1's schedules...
+133ms ║║Condition group #1 evaluated true (state changed) (7ms)
+135ms ║║Cancelling statement #3's schedules...
+683ms ║║Executed physical command [Small Speaker].playTrack([5]) (543ms)
+684ms ║║Executed [Small Speaker].playTrack (545ms)
+687ms ║║Cancelling statement #5's schedules...
+702ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (10ms)
+735ms ║║Comparison (time) 38856906 is_after (time) 1573335000000 = false (5ms)
+736ms ║║Cancelling condition #8's schedules...
+737ms ║║Condition #8 evaluated false (33ms)
+738ms ║║Condition group #7 evaluated false (state did not change) (34ms)
+740ms ║╚Execution stage complete. (619ms)
+741ms ╚Event processed successfully (741ms)
11/8/2019, 7:53:17 PM +425ms
+1ms ╔Starting piston... (v0.3.110.20191009)
+446ms ║╔Subscribing to devices...
+479ms ║║Subscribing to Driveway.contact...
+601ms ║║Subscribing to Small Speaker...
+602ms ║║Subscribing to Eryc Courmac's iPhone...
+603ms ║║Subscribing to Basement Door Light...
+605ms ║║Subscribing to Driveway Light...
+606ms ║╚Finished subscribing (180ms)
+695ms ║Comparison (time) 71598072 is_after (time) 1573248720000 = true (8ms)
+696ms ║Time restriction check passed
+709ms ║Comparison (time) 71598123 is_before (time) 1573212720000 = false (8ms)
+718ms ╚Piston successfully started (716ms)
11/8/2019, 7:50:15 PM +29ms
+0ms ╔Received event [Home].test = 1573260615029 with a delay of 1ms
+103ms ║RunTime Analysis CS > 24ms > PS > 51ms > PE > 27ms > CE
+105ms ║Runtime (38398 bytes) successfully initialized in 51ms (v0.3.110.20191009) (104ms)
+106ms ║╔Execution stage started
+118ms ║║Condition #2 evaluated false (7ms)
+119ms ║║Condition group #1 evaluated false (state did not change) (8ms)
+123ms ║╚Execution stage complete. (17ms)
+125ms ╚Event processed successfully (124ms)
11/8/2019, 7:14:43 PM +155ms
+1ms ╔Received event [Driveway].contact = open with a delay of 128ms
+83ms ║RunTime Analysis CS > 23ms > PS > 39ms > PE > 21ms > CE
+85ms ║Runtime (38394 bytes) successfully initialized in 39ms (v0.3.110.20191009) (83ms)
+86ms ║╔Execution stage started
+93ms ║║Comparison (enum) open changes_to (string) closed = false (0ms)
+94ms ║║Cancelling condition #2's schedules...
+95ms ║║Condition #2 evaluated false (5ms)
+96ms ║║Cancelling condition #1's schedules...
+96ms ║║Condition group #1 evaluated false (state changed) (6ms)
+98ms ║╚Execution stage complete. (12ms)
+99ms ╚Event processed successfully (99ms)
11/8/2019, 7:14:42 PM +37ms
+2ms ╔Received event [Driveway].contact = closed with a delay of 90ms
+81ms ║RunTime Analysis CS > 22ms > PS > 38ms > PE > 21ms > CE
+83ms ║Runtime (38398 bytes) successfully initialized in 38ms (v0.3.110.20191009) (81ms)
+84ms ║╔Execution stage started
+91ms ║║Comparison (enum) closed changes_to (string) closed = true (1ms)
+93ms ║║Cancelling condition #2's schedules...
+93ms ║║Condition #2 evaluated true (5ms)
+94ms ║║Cancelling condition #1's schedules...
+95ms ║║Condition group #1 evaluated true (state changed) (7ms)
+97ms ║║Cancelling statement #3's schedules...
+247ms ║║Executed physical command [Small Speaker].playTrack([5]) (144ms)
+248ms ║║Executed [Small Speaker].playTrack (146ms)
+250ms ║║Cancelling statement #5's schedules...
+266ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (11ms)
+298ms ║║Comparison (time) 69282306 is_after (time) 1573248720000 = true (6ms)
+299ms ║║Time restriction check passed
+300ms ║║Condition #8 evaluated true (31ms)
+310ms ║║Comparison (time) 69282338 is_before (time) 1573212720000 = false (6ms)
+311ms ║║Condition #9 evaluated false (10ms)
+312ms ║║Condition group #7 evaluated false (state did not change) (44ms)
+314ms ║╚Execution stage complete. (230ms)
+315ms ╚Event processed successfully (315ms)
11/8/2019, 7:14:08 PM +926ms
+1ms ╔Received event [Driveway].contact = open with a delay of 109ms
+91ms ║RunTime Analysis CS > 26ms > PS > 43ms > PE > 22ms > CE
+93ms ║Runtime (38396 bytes) successfully initialized in 43ms (v0.3.110.20191009) (91ms)
+94ms ║╔Execution stage started
+100ms ║║Comparison (enum) open changes_to (string) closed = false (1ms)
+101ms ║║Condition #2 evaluated false (4ms)
+102ms ║║Condition group #1 evaluated false (state did not change) (5ms)
+104ms ║╚Execution stage complete. (11ms)
+105ms ╚Event processed successfully (105ms)
11/8/2019, 6:55:14 PM +197ms
+1ms ╔Received event [Driveway].contact = closed with a delay of 154ms
+10099ms ║RunTime Analysis CS > 18ms > PS > 10056ms > PE > 25ms > CE
+10099ms ║Piston waited at a semaphore for 10018ms
+10101ms ║Runtime (38477 bytes) successfully initialized in 10056ms (v0.3.110.20191009) (10099ms)
+10102ms ║╔Execution stage started
+10109ms ║║Comparison (enum) closed changes_to (string) closed = false (1ms)
+10110ms ║║Cancelling condition #2's schedules...
+10111ms ║║Condition #2 evaluated false (5ms)
+10112ms ║║Cancelling condition #1's schedules...
+10113ms ║║Condition group #1 evaluated false (state changed) (7ms)
+10115ms ║╚Execution stage complete. (13ms)
+10116ms ╚Event processed successfully (10116ms)
11/8/2019, 6:55:14 PM +190ms
+1ms ╔Received event [Driveway].contact = closed with a delay of 140ms
+85ms ║RunTime Analysis CS > 20ms > PS > 42ms > PE > 23ms > CE
+87ms ║Runtime (38399 bytes) successfully initialized in 42ms (v0.3.110.20191009) (85ms)
+88ms ║╔Execution stage started
+95ms ║║Comparison (enum) closed changes_to (string) closed = true (0ms)
+97ms ║║Cancelling condition #2's schedules...
+98ms ║║Condition #2 evaluated true (5ms)
+99ms ║║Cancelling condition #1's schedules...
+99ms ║║Condition group #1 evaluated true (state changed) (7ms)
+101ms ║║Cancelling statement #3's schedules...
+237ms ║║Executed physical command [Small Speaker].playTrack([5]) (130ms)
+238ms ║║Executed [Small Speaker].playTrack (132ms)
+240ms ║║Cancelling statement #5's schedules...
+256ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (10ms)
+286ms ║║Comparison (time) 68114448 is_after (time) 1573248720000 = true (5ms)
+287ms ║║Time restriction check passed
+288ms ║║Condition #8 evaluated true (30ms)
+297ms ║║Comparison (time) 68114479 is_before (time) 1573212720000 = false (6ms)
+299ms ║║Condition #9 evaluated false (10ms)
+300ms ║║Condition group #7 evaluated false (state did not change) (42ms)
+302ms ║╚Execution stage complete. (214ms)
+303ms ╚Event processed successfully (303ms)
11/8/2019, 5:38:09 PM +436ms
+0ms ╔Received event [Driveway].contact = open with a delay of 128ms
+63ms ║RunTime Analysis CS > 17ms > PS > 30ms > PE > 17ms > CE
+66ms ║Runtime (38394 bytes) successfully initialized in 30ms (v0.3.110.20191009) (65ms)
+67ms ║╔Execution stage started
+73ms ║║Comparison (enum) open changes_to (string) closed = false (0ms)
+75ms ║║Cancelling condition #2's schedules...
+76ms ║║Condition #2 evaluated false (4ms)
+77ms ║║Cancelling condition #1's schedules...
+77ms ║║Condition group #1 evaluated false (state changed) (7ms)
+79ms ║╚Execution stage complete. (13ms)
+80ms ╚Event processed successfully (81ms)
11/8/2019, 5:38:08 PM +375ms
+1ms ╔Received event [Driveway].contact = closed with a delay of 98ms
+81ms ║RunTime Analysis CS > 21ms > PS > 39ms > PE > 21ms > CE
+83ms ║Runtime (38398 bytes) successfully initialized in 39ms (v0.3.110.20191009) (81ms)
+84ms ║╔Execution stage started
+91ms ║║Comparison (enum) closed changes_to (string) closed = true (1ms)
+93ms ║║Cancelling condition #2's schedules...
+94ms ║║Condition #2 evaluated true (5ms)
+95ms ║║Cancelling condition #1's schedules...
+95ms ║║Condition group #1 evaluated true (state changed) (7ms)
+98ms ║║Cancelling statement #3's schedules...
+270ms ║║Executed physical command [Small Speaker].playTrack([5]) (167ms)
+271ms ║║Executed [Small Speaker].playTrack (169ms)
+274ms ║║Cancelling statement #5's schedules...
+289ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (10ms)
+320ms ║║Comparison (time) 63488667 is_after (time) 1573248720000 = true (6ms)
+321ms ║║Time restriction check passed
+322ms ║║Condition #8 evaluated true (31ms)
+331ms ║║Comparison (time) 63488698 is_before (time) 1573212720000 = false (6ms)
+333ms ║║Condition #9 evaluated false (9ms)
+334ms ║║Condition group #7 evaluated false (state did not change) (42ms)
+336ms ║╚Execution stage complete. (252ms)
+337ms ╚Event processed successfully (337ms)
11/8/2019, 5:30:06 PM +214ms
+2ms ╔Received event [Driveway].contact = open with a delay of 128ms
+199ms ║RunTime Analysis CS > 90ms > PS > 90ms > PE > 19ms > CE
+202ms ║Runtime (38395 bytes) successfully initialized in 90ms (v0.3.110.20191009) (199ms)
+203ms ║╔Execution stage started
+210ms ║║Comparison (enum) open changes_to (string) closed = false (0ms)
+211ms ║║Cancelling condition #2's schedules...
+212ms ║║Condition #2 evaluated false (5ms)
+213ms ║║Cancelling condition #1's schedules...
+214ms ║║Condition group #1 evaluated false (state changed) (8ms)
+216ms ║╚Execution stage complete. (14ms)
+217ms ╚Event processed successfully (217ms)
11/8/2019, 5:30:05 PM +189ms
+1ms ╔Received event [Driveway].contact = closed with a delay of 272ms
+221ms ║RunTime Analysis CS > 103ms > PS > 99ms > PE > 19ms > CE
+223ms ║Runtime (38402 bytes) successfully initialized in 99ms (v0.3.110.20191009) (221ms)
+224ms ║╔Execution stage started
+231ms ║║Comparison (enum) closed changes_to (string) closed = true (1ms)
+232ms ║║Cancelling condition #2's schedules...
+233ms ║║Condition #2 evaluated true (5ms)
+234ms ║║Cancelling condition #1's schedules...
+235ms ║║Condition group #1 evaluated true (state changed) (7ms)
+237ms ║║Cancelling statement #3's schedules...
+398ms ║║Executed physical command [Small Speaker].playTrack([5]) (154ms)
+399ms ║║Executed [Small Speaker].playTrack (156ms)
+401ms ║║Cancelling statement #5's schedules...
+428ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (22ms)
+460ms ║║Comparison (time) 63005620 is_after (time) 1573248720000 = true (6ms)
+461ms ║║Time restriction check passed
+462ms ║║Cancelling condition #8's schedules...
+463ms ║║Condition #8 evaluated true (32ms)
+472ms ║║Comparison (time) 63005653 is_before (time) 1573212720000 = false (6ms)
+473ms ║║Condition #9 evaluated false (9ms)
+474ms ║║Condition group #7 evaluated false (state did not change) (43ms)
+476ms ║╚Execution stage complete. (252ms)
+477ms ╚Event processed successfully (477ms)
11/8/2019, 11:00:38 AM +233ms
+2ms ╔Received event [Driveway].contact = open with a delay of 107ms
+91ms ║RunTime Analysis CS > 24ms > PS > 47ms > PE > 20ms > CE
+94ms ║Runtime (38395 bytes) successfully initialized in 47ms (v0.3.110.20191009) (91ms)
+95ms ║╔Execution stage started
+102ms ║║Comparison (enum) open changes_to (string) closed = false (1ms)
+104ms ║║Cancelling condition #2's schedules...
+105ms ║║Condition #2 evaluated false (5ms)
+106ms ║║Cancelling condition #1's schedules...
+107ms ║║Condition group #1 evaluated false (state changed) (7ms)
+109ms ║╚Execution stage complete. (14ms)
+110ms ╚Event processed successfully (110ms)
11/8/2019, 11:00:37 AM +201ms
+1ms ╔Received event [Driveway].contact = closed with a delay of 74ms
+61ms ║RunTime Analysis CS > 17ms > PS > 30ms > PE > 14ms > CE
+63ms ║Runtime (38399 bytes) successfully initialized in 30ms (v0.3.110.20191009) (61ms)
+64ms ║╔Execution stage started
+72ms ║║Comparison (enum) closed changes_to (string) closed = true (0ms)
+73ms ║║Cancelling condition #2's schedules...
+74ms ║║Condition #2 evaluated true (6ms)
+75ms ║║Cancelling condition #1's schedules...
+76ms ║║Condition group #1 evaluated true (state changed) (8ms)
+78ms ║║Cancelling statement #3's schedules...
+216ms ║║Executed physical command [Small Speaker].playTrack([5]) (133ms)
+217ms ║║Executed [Small Speaker].playTrack (135ms)
+219ms ║║Cancelling statement #5's schedules...
+233ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (9ms)
+260ms ║║Comparison (time) 39637437 is_after (time) 1573248720000 = false (6ms)
+262ms ║║Condition #8 evaluated false (26ms)
+263ms ║║Condition group #7 evaluated false (state did not change) (27ms)
+265ms ║╚Execution stage complete. (201ms)
+266ms ╚Event processed successfully (266ms)
11/8/2019, 10:59:38 AM +836ms
+1ms ╔Received event [Driveway].contact = open with a delay of 1469ms
+58ms ║RunTime Analysis CS > 17ms > PS > 27ms > PE > 14ms > CE
+60ms ║Runtime (38396 bytes) successfully initialized in 27ms (v0.3.110.20191009) (58ms)
+61ms ║╔Execution stage started
+68ms ║║Comparison (enum) open changes_to (string) closed = false (1ms)
+69ms ║║Cancelling condition #2's schedules...
+70ms ║║Condition #2 evaluated false (5ms)
+71ms ║║Cancelling condition #1's schedules...
+72ms ║║Condition group #1 evaluated false (state changed) (7ms)
+74ms ║╚Execution stage complete. (13ms)
+75ms ╚Event processed successfully (75ms)
11/8/2019, 10:59:38 AM +65ms
+2ms ╔Received event [Driveway].contact = closed with a delay of 1728ms
+83ms ║RunTime Analysis CS > 21ms > PS > 47ms > PE > 14ms > CE
+85ms ║Runtime (38401 bytes) successfully initialized in 47ms (v0.3.110.20191009) (83ms)
+86ms ║╔Execution stage started
+92ms ║║Comparison (enum) closed changes_to (string) closed = true (0ms)
+94ms ║║Cancelling condition #2's schedules...
+95ms ║║Condition #2 evaluated true (4ms)
+96ms ║║Cancelling condition #1's schedules...
+96ms ║║Condition group #1 evaluated true (state changed) (7ms)
+98ms ║║Cancelling statement #3's schedules...
+237ms ║║Executed physical command [Small Speaker].playTrack([5]) (134ms)
+238ms ║║Executed [Small Speaker].playTrack (135ms)
+240ms ║║Cancelling statement #5's schedules...
+252ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (7ms)
+282ms ║║Comparison (time) 39578321 is_after (time) 1573248720000 = false (5ms)
+283ms ║║Condition #8 evaluated false (28ms)
+284ms ║║Condition group #7 evaluated false (state did not change) (29ms)
+286ms ║╚Execution stage complete. (201ms)
+287ms ╚Event processed successfully (287ms)
11/8/2019, 7:34:21 AM +434ms
+2ms ╔Received event [Driveway].contact = open with a delay of 57ms
+79ms ║RunTime Analysis CS > 21ms > PS > 42ms > PE > 15ms > CE
+81ms ║Runtime (38394 bytes) successfully initialized in 42ms (v0.3.110.20191009) (79ms)
+82ms ║╔Execution stage started
+89ms ║║Comparison (enum) open changes_to (string) closed = false (1ms)
+91ms ║║Cancelling condition #2's schedules...
+92ms ║║Condition #2 evaluated false (5ms)
+93ms ║║Cancelling condition #1's schedules...
+93ms ║║Condition group #1 evaluated false (state changed) (7ms)
+95ms ║╚Execution stage complete. (13ms)
+96ms ╚Event processed successfully (96ms)
11/8/2019, 7:34:20 AM +383ms
+1ms ╔Received event [Driveway].contact = closed with a delay of 36ms
+60ms ║RunTime Analysis CS > 18ms > PS > 31ms > PE > 11ms > CE
+63ms ║Runtime (38399 bytes) successfully initialized in 31ms (v0.3.110.20191009) (61ms)
+63ms ║╔Execution stage started
+70ms ║║Comparison (enum) closed changes_to (string) closed = true (1ms)
+71ms ║║Cancelling condition #2's schedules...
+72ms ║║Condition #2 evaluated true (5ms)
+73ms ║║Cancelling condition #1's schedules...
+74ms ║║Condition group #1 evaluated true (state changed) (7ms)
+76ms ║║Cancelling statement #3's schedules...
+210ms ║║Executed physical command [Small Speaker].playTrack([5]) (129ms)
+211ms ║║Executed [Small Speaker].playTrack (131ms)
+214ms ║║Cancelling statement #5's schedules...
+226ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (8ms)
+251ms ║║Comparison (time) 27260612 is_after (time) 1573248720000 = false (6ms)
+253ms ║║Condition #8 evaluated false (25ms)
+254ms ║║Condition group #7 evaluated false (state did not change) (25ms)
+256ms ║╚Execution stage complete. (193ms)
+257ms ╚Event processed successfully (257ms)
11/7/2019, 3:00:50 PM +484ms
+0ms ╔Received event [Driveway].contact = open with a delay of 86ms
+53ms ║RunTime Analysis CS > 16ms > PS > 28ms > PE > 10ms > CE
+55ms ║Runtime (38394 bytes) successfully initialized in 28ms (v0.3.110.20191009) (54ms)
+56ms ║╔Execution stage started
+63ms ║║Comparison (enum) open changes_to (string) closed = false (1ms)
+64ms ║║Cancelling condition #2's schedules...
+65ms ║║Condition #2 evaluated false (5ms)
+66ms ║║Cancelling condition #1's schedules...
+67ms ║║Condition group #1 evaluated false (state changed) (7ms)
+69ms ║╚Execution stage complete. (12ms)
+70ms ╚Event processed successfully (70ms)
11/7/2019, 3:00:49 PM +489ms
+1ms ╔Received event [Driveway].contact = closed with a delay of 122ms
+65ms ║RunTime Analysis CS > 13ms > PS > 31ms > PE > 21ms > CE
+67ms ║Runtime (38399 bytes) successfully initialized in 31ms (v0.3.110.20191009) (66ms)
+68ms ║╔Execution stage started
+76ms ║║Comparison (enum) closed changes_to (string) closed = true (0ms)
+77ms ║║Cancelling condition #2's schedules...
+78ms ║║Condition #2 evaluated true (5ms)
+79ms ║║Cancelling condition #1's schedules...
+80ms ║║Condition group #1 evaluated true (state changed) (8ms)
+82ms ║║Cancelling statement #3's schedules...
+579ms ║║Executed physical command [Small Speaker].playTrack([5]) (492ms)
+580ms ║║Executed [Small Speaker].playTrack (494ms)
+583ms ║║Cancelling statement #5's schedules...
+601ms ║║Executed virtual command [Eryc Courmac's iPhone].sendPushNotification (14ms)
+626ms ║║Comparison (time) 54050093 is_after (time) 1573162380000 = false (5ms)
+627ms ║║Condition #8 evaluated false (24ms)
+628ms ║║Condition group #7 evaluated false (state did not change) (25ms)
+630ms ║╚Execution stage complete. (562ms)
+631ms ╚Event processed successfully (631ms)
11/7/2019, 1:51:28 PM +461ms
+1ms ╔Starting piston... (v0.3.110.20191009)
+408ms ║╔Subscribing to devices...
+419ms ║║Subscribing to Driveway.contact...
+526ms ║║Subscribing to Small Speaker...
+528ms ║║Subscribing to Eryc Courmac's iPhone...
+530ms ║║Subscribing to Basement Door Light...
+531ms ║║Subscribing to Driveway Light...
+532ms ║╚Finished subscribing (140ms)
+606ms ║Comparison (time) 49889030 is_after (time) 1573162380000 = false (8ms)
+620ms ║Comparison (time) 49889069 is_before (time) 1573126260000 = false (10ms)
+629ms ╚Piston successfully started (629ms)

#2

Try inverting and combining lines 30-33 to something like this:


You may also need to click on the WITH (line 35), and set TCP to Never.
(otherwise, the lights will not turn back off after the WAIT)


#3

So - this? I have to admit, that TCP thing, I’ve never used that before, can you go into a bit of detail on it please?


#4

That looks perfect!!

Normally, when the piston returns from a WAIT, it re-checks the conditions, and aborts if it is no longer true… But… Setting TCP to Never means the Task will no longer Cancel if the conditions change midway thru the execution.

In your case, after 5 minutes, Sensor 2’s contact is no longer “changing to closed”


There is a quick overview in the Wiki.


#5

Your time comparisons are failing because the Sunrise and Sunset presets are not updated until midnight and so your comparisons are always with ‘todays’ times. It should work fine as a single Time is between 20 minutes to sunset and 20 minutes past sunrise because the code for ‘is between’ is written for just this eventuality and adjusts accordingly.

I believe you may also need to change the Task Cancellation Policy for the last ‘wait’. If the Contact Sensor changes back to open during the five minute wait the piston will be executed from the top again and that will mean the time condition is never reached, which in my book is the same as the condition changing and that means the pending wake-up will be cancelled. You can find the TCP by clicking on the last ‘with’ and hitting the settings cog. You want it to never cancel.

Update: Sorry, the previous answers simply weren’t showing up for me when I started typing this answer. No idea why not as they are hours old.

Second update: I was dubious about my TCP comment when I wrote it. The wait is not cancelled when the top ‘if’ condition changes because the bottom ‘if’ condition is not re-evaluated.

Much later third update: Actually I think I was right in the first place, at least that is how it works for me now.


#6

Hey, thanks to both of you for the explanations! And yes, when I came home last night - it worked perfectly!