Ten minute warning


#1

1) Give a description of the problem
I’m trying to create a piston that gives a 10 minute warning to help get my daughter out of the house in the morning.

2) What is the expected behavior?
At 7:10 AM on weekdays it should first flash all the lights on and off, then with my Echos state that we are leaving in 10 minutes. Then 5 minutes later state that we are leaving in 5 minutes. Then 5 minutes later state that it is time to go. Then every 2 minutes it should state that it is time to go, we are going to be late UNTIL the front door contact sensor opens. Then it should say goodbye.

3) What is happening/not happening?
It’s mostly working except for the last part with canceling the repeating text and saying goodbye. It’s not stopping the repeating text and the goodbye is never happening. I would like the contact sensor opening to cancel the repeating text, and then say the goodbye.

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)

4/9/2019, 7:22:07 AM +83ms
+89ms ╔Stopping piston...
+171ms ╚Piston successfully stopped (83ms)
4/9/2019, 7:20:13 AM +100ms
+1ms ╔Received event [Home].time = 1554812414563 with a delay of -1464ms
+487ms ║RunTime Analysis CS > 158ms > PS > 283ms > PE > 46ms > CE
+490ms ║Runtime (43365 bytes) successfully initialized in 283ms (v0.3.10a.20190223) (488ms)
+492ms ║╔Execution stage started
+1041ms ║║Executed physical command [Echo - Bathroom].playText([Ivy, it is time to go.]) (514ms)
+1043ms ║║Executed [Echo - Bathroom].playText (517ms)
+1128ms ║║Executed physical command [Echo - Living Room].playText([Ivy, it is time to go.]) (80ms)
+1130ms ║║Executed [Echo - Living Room].playText (82ms)
+1201ms ║║Executed physical command [Echo - Playroom].playText([Ivy, it is time to go.]) (65ms)
+1202ms ║║Executed [Echo - Playroom].playText (69ms)
+1217ms ║║Comparison (enum) closed is (string) closed = true (2ms)
+1220ms ║║Condition #21 evaluated true (13ms)
+1221ms ║║Condition group #20 evaluated true (state did not change) (16ms)
+1224ms ║║Cancelling statement #22's schedules...
+1232ms ║║Executed virtual command [Echo - Bathroom, Echo - Living Room, Echo - Playroom].wait (1ms)
+1234ms ║║Requesting a wake up for Tue, Apr 9 2019 @ 7:22:14 AM CDT (in 120.0s)
+1243ms ║╚Execution stage complete. (751ms)
+1246ms ║Setting up scheduled job for Tue, Apr 9 2019 @ 7:22:14 AM CDT (in 119.99s), with 1 more job pending
+1255ms ╚Event processed successfully (1255ms)
4/9/2019, 7:15:11 AM +101ms
+1ms ╔Received event [Home].time = 1554812112602 with a delay of -1502ms
+371ms ║RunTime Analysis CS > 145ms > PS > 178ms > PE > 48ms > CE
+374ms ║Runtime (43365 bytes) successfully initialized in 178ms (v0.3.10a.20190223) (372ms)
+376ms ║╔Execution stage started
+974ms ║║Executed physical command [Echo - Bathroom].playText([Attention!]) (568ms)
+976ms ║║Executed [Echo - Bathroom].playText (571ms)
+1058ms ║║Executed physical command [Echo - Living Room].playText([Attention!]) (78ms)
+1060ms ║║Executed [Echo - Living Room].playText (81ms)
+1129ms ║║Executed physical command [Echo - Playroom].playText([Attention!]) (64ms)
+1130ms ║║Executed [Echo - Playroom].playText (66ms)
+1135ms ║║Executed virtual command [Echo - Bathroom, Echo - Living Room, Echo - Playroom].wait (0ms)
+1136ms ║║Requesting a wake up for Tue, Apr 9 2019 @ 7:15:13 AM CDT (in 1.0s)
+1144ms ║║Fast executing schedules, waiting for 994ms to sync up
+2206ms ║║Executed physical command [Echo - Bathroom].playText([Five minute warning.]) (39ms)
+2207ms ║║Executed [Echo - Bathroom].playText (42ms)
+2252ms ║║Executed physical command [Echo - Living Room].playText([Five minute warning.]) (42ms)
+2253ms ║║Executed [Echo - Living Room].playText (45ms)
+2294ms ║║Executed physical command [Echo - Playroom].playText([Five minute warning.]) (39ms)
+2295ms ║║Executed [Echo - Playroom].playText (41ms)
+2300ms ║║Executed virtual command [Echo - Bathroom, Echo - Living Room, Echo - Playroom].wait (1ms)
+2302ms ║║Requesting a wake up for Tue, Apr 9 2019 @ 7:15:14 AM CDT (in 1.0s)
+2311ms ║║Fast executing schedules, waiting for 993ms to sync up
+3372ms ║║Executed physical command [Echo - Bathroom].playText([Ivy, we are leaving in five minutes.]) (41ms)
+3373ms ║║Executed [Echo - Bathroom].playText (43ms)
+3413ms ║║Executed physical command [Echo - Living Room].playText([Ivy, we are leaving in five minutes.]) (37ms)
+3414ms ║║Executed [Echo - Living Room].playText (39ms)
+3453ms ║║Executed physical command [Echo - Playroom].playText([Ivy, we are leaving in five minutes.]) (36ms)
+3454ms ║║Executed [Echo - Playroom].playText (38ms)
+3459ms ║║Executed virtual command [Echo - Bathroom, Echo - Living Room, Echo - Playroom].wait (1ms)
+3461ms ║║Requesting a wake up for Tue, Apr 9 2019 @ 7:20:14 AM CDT (in 300.0s)
+3468ms ║╚Execution stage complete. (3093ms)
+3470ms ║Setting up scheduled job for Tue, Apr 9 2019 @ 7:20:14 AM CDT (in 299.993s), with 1 more job pending
+3479ms ╚Event processed successfully (3479ms)
4/9/2019, 7:10:11 AM +93ms
+1ms ╔Received event [Home].time = 1554811811496 with a delay of -403ms
+394ms ║RunTime Analysis CS > 169ms > PS > 180ms > PE > 44ms > CE
+397ms ║Runtime (43364 bytes) successfully initialized in 180ms (v0.3.10a.20190223) (395ms)
+398ms ║╔Execution stage started
+415ms ║║Executed physical command [Hall Bulb 1].off() (9ms)
+419ms ║║Fast executing schedules, waiting for 3ms to sync up
+435ms ║║Executed physical command [Hall Bulb 2].off() (8ms)
+439ms ║║Fast executing schedules, waiting for 1ms to sync up
+453ms ║║Executed physical command [Hall Bulb 3].off() (8ms)
+456ms ║║Fast executing schedules, waiting for 3ms to sync up
+472ms ║║Executed physical command [Hall Bulb 4].off() (8ms)
+475ms ║║Fast executing schedules, waiting for 3ms to sync up
+491ms ║║Executed physical command [Hall Bulb 5].off() (8ms)
+494ms ║║Fast executing schedules, waiting for 3ms to sync up
+510ms ║║Executed physical command [Jeff's Lamp].on() (7ms)
+512ms ║║Fast executing schedules, waiting for 2ms to sync up
+527ms ║║Executed physical command [Jenny's Lamp].on() (8ms)
+530ms ║║Fast executing schedules, waiting for 2ms to sync up
+544ms ║║Executed physical command [K Bulb 2].off() (7ms)
+547ms ║║Fast executing schedules, waiting for 3ms to sync up
+563ms ║║Executed physical command [K Bulb 3].on() (7ms)
+565ms ║║Fast executing schedules, waiting for 3ms to sync up
+580ms ║║Executed physical command [Kitchen Light].on() (8ms)
+613ms ║║Executed physical command [Hall Bulb 1].on() (9ms)
+615ms ║║Executed virtual command [Hall Bulb 1].setSwitch (11ms)
+625ms ║║Executed physical command [Hall Bulb 2].on() (8ms)
+626ms ║║Executed virtual command [Hall Bulb 2].setSwitch (10ms)
+637ms ║║Executed physical command [Hall Bulb 3].on() (9ms)
+638ms ║║Executed virtual command [Hall Bulb 3].setSwitch (11ms)
+649ms ║║Executed physical command [Hall Bulb 4].on() (8ms)
+650ms ║║Executed virtual command [Hall Bulb 4].setSwitch (10ms)
+661ms ║║Executed physical command [Hall Bulb 5].on() (9ms)
+663ms ║║Executed virtual command [Hall Bulb 5].setSwitch (10ms)
+668ms ║║Skipped execution of physical command [Jeff's Lamp].on([]) because it would make no change to the device. (3ms)
+670ms ║║Executed virtual command [Jeff's Lamp].setSwitch (5ms)
+675ms ║║Skipped execution of physical command [Jenny's Lamp].on([]) because it would make no change to the device. (3ms)
+677ms ║║Executed virtual command [Jenny's Lamp].setSwitch (5ms)
+688ms ║║Executed physical command [K Bulb 2].on() (8ms)
+689ms ║║Executed virtual command [K Bulb 2].setSwitch (10ms)
+694ms ║║Skipped execution of physical command [K Bulb 3].on([]) because it would make no change to the device. (3ms)
+696ms ║║Executed virtual command [K Bulb 3].setSwitch (5ms)
+701ms ║║Skipped execution of physical command [Kitchen Light].on([]) because it would make no change to the device. (3ms)
+702ms ║║Executed virtual command [Kitchen Light].setSwitch (5ms)
+706ms ║║Cancelling statement #7's schedules...
+1196ms ║║Executed physical command [Echo - Bathroom].setVolumeAndSpeak([60, Attention!]) (478ms)
+1197ms ║║Executed [Echo - Bathroom].setVolumeAndSpeak (481ms)
+1286ms ║║Executed physical command [Echo - Living Room].setVolumeAndSpeak([60, Attention!]) (85ms)
+1288ms ║║Executed [Echo - Living Room].setVolumeAndSpeak (87ms)
+1374ms ║║Executed physical command [Echo - Playroom].setVolumeAndSpeak([60, Attention!]) (82ms)
+1376ms ║║Executed [Echo - Playroom].setVolumeAndSpeak (84ms)
+1426ms ║║Executed physical command [Echo - Bathroom].playText([Ivy, we are leaving in ten minutes.]) (45ms)
+1427ms ║║Executed [Echo - Bathroom].playText (48ms)
+1461ms ║║Executed physical command [Echo - Living Room].playText([Ivy, we are leaving in ten minutes.]) (32ms)
+1462ms ║║Executed [Echo - Living Room].playText (34ms)
+1500ms ║║Executed physical command [Echo - Playroom].playText([Ivy, we are leaving in ten minutes.]) (35ms)
+1501ms ║║Executed [Echo - Playroom].playText (37ms)
+1506ms ║║Executed virtual command [Echo - Bathroom, Echo - Living Room, Echo - Playroom].wait (1ms)
+1508ms ║║Requesting a wake up for Tue, Apr 9 2019 @ 7:15:12 AM CDT (in 300.0s)
+1515ms ║╚Execution stage complete. (1117ms)
+1518ms ║Setting up scheduled job for Tue, Apr 9 2019 @ 7:15:12 AM CDT (in 299.992s), with 1 more job pending
+1527ms ╚Event processed successfully (1527ms)
4/9/2019, 7:10:08 AM +122ms
+1ms ╔Received event [Home].time = 1554811808396 with a delay of -274ms
+268ms ║RunTime Analysis CS > 81ms > PS > 130ms > PE > 57ms > CE
+271ms ║Runtime (43363 bytes) successfully initialized in 130ms (v0.3.10a.20190223) (269ms)
+272ms ║╔Execution stage started
+296ms ║║Executed physical command [Hall Bulb 1].off() (12ms)
+319ms ║║Executed physical command [Hall Bulb 2].off() (10ms)
+343ms ║║Executed physical command [Hall Bulb 3].off() (10ms)
+363ms ║║Executed physical command [Hall Bulb 4].off() (10ms)
+384ms ║║Executed physical command [Hall Bulb 5].off() (11ms)
+404ms ║║Executed physical command [Jeff's Lamp].on() (9ms)
+422ms ║║Executed physical command [Jenny's Lamp].on() (9ms)
+442ms ║║Executed physical command [K Bulb 2].off() (10ms)
+460ms ║║Executed physical command [K Bulb 3].on() (10ms)
+481ms ║║Executed physical command [Kitchen Light].on() (10ms)
+486ms ║╚Execution stage complete. (214ms)
+495ms ║Setting up scheduled job for Tue, Apr 9 2019 @ 7:10:11 AM CDT (in 2.881s), with 11 more jobs pending
+503ms ╚Event processed successfully (503ms)
4/9/2019, 7:10:05 AM +269ms
+1ms ╔Received event [Home].time = 1554811805396 with a delay of -128ms
+329ms ║RunTime Analysis CS > 135ms > PS > 142ms > PE > 52ms > CE
+332ms ║Runtime (43364 bytes) successfully initialized in 142ms (v0.3.10a.20190223) (330ms)
+334ms ║╔Execution stage started
+356ms ║║Executed physical command [Hall Bulb 1].on() (8ms)
+377ms ║║Executed physical command [Hall Bulb 2].on() (9ms)
+399ms ║║Executed physical command [Hall Bulb 3].on() (9ms)
+420ms ║║Executed physical command [Hall Bulb 4].on() (9ms)
+443ms ║║Executed physical command [Hall Bulb 5].on() (10ms)
+465ms ║║Executed physical command [Jeff's Lamp].off() (10ms)
+488ms ║║Executed physical command [Jenny's Lamp].off() (11ms)
+509ms ║║Executed physical command [K Bulb 2].on() (10ms)
+530ms ║║Executed physical command [K Bulb 3].off() (9ms)
+550ms ║║Executed physical command [Kitchen Light].off() (10ms)
+558ms ║╚Execution stage complete. (225ms)
+570ms ║Setting up scheduled job for Tue, Apr 9 2019 @ 7:10:08 AM CDT (in 2.558s), with 21 more jobs pending
+578ms ╚Event processed successfully (579ms)
4/9/2019, 7:10:02 AM +157ms
+1ms ╔Received event [Home].time = 1554811802395 with a delay of -239ms
+446ms ║RunTime Analysis CS > 203ms > PS > 201ms > PE > 43ms > CE
+449ms ║Runtime (43364 bytes) successfully initialized in 201ms (v0.3.10a.20190223) (446ms)
+451ms ║╔Execution stage started
+476ms ║║Executed physical command [Hall Bulb 1].off() (10ms)
+499ms ║║Executed physical command [Hall Bulb 2].off() (8ms)
+522ms ║║Executed physical command [Hall Bulb 3].off() (9ms)
+544ms ║║Executed physical command [Hall Bulb 4].off() (9ms)
+567ms ║║Executed physical command [Hall Bulb 5].off() (9ms)
+590ms ║║Executed physical command [Jeff's Lamp].on() (9ms)
+612ms ║║Executed physical command [Jenny's Lamp].on() (10ms)
+633ms ║║Executed physical command [K Bulb 2].off() (9ms)
+655ms ║║Executed physical command [K Bulb 3].on() (10ms)
+676ms ║║Executed physical command [Kitchen Light].on() (9ms)
+688ms ║╚Execution stage complete. (237ms)
+700ms ║Setting up scheduled job for Tue, Apr 9 2019 @ 7:10:05 AM CDT (in 2.54s), with 31 more jobs pending
+709ms ╚Event processed successfully (709ms)
4/9/2019, 7:09:59 AM +174ms
+1ms ╔Received event [Home].time = 1554811800000 with a delay of -826ms
+152ms ║RunTime Analysis CS > 30ms > PS > 51ms > PE > 71ms > CE
+155ms ║Runtime (43361 bytes) successfully initialized in 51ms (v0.3.10a.20190223) (153ms)
+156ms ║╔Execution stage started
+176ms ║║Comparison (string) :a9d2281e3476d4060655eaa948fac8a0: is_not (string) :fd9909ea4f362e3ba1bc120a41961f1b: = true (2ms)
+178ms ║║Condition #3 evaluated true (7ms)
+180ms ║║Condition group #2 evaluated true (state did not change) (8ms)
+183ms ║║Cancelling statement #4's schedules...
+209ms ║║Executed physical command [Hall Bulb 1].on() (8ms)
+224ms ║║Executed virtual command [Hall Bulb 1].flash (27ms)
+238ms ║║Executed physical command [Hall Bulb 2].on() (9ms)
+242ms ║║Executed virtual command [Hall Bulb 2].flash (17ms)
+256ms ║║Executed physical command [Hall Bulb 3].on() (8ms)
+260ms ║║Executed virtual command [Hall Bulb 3].flash (16ms)
+274ms ║║Executed physical command [Hall Bulb 4].on() (8ms)
+280ms ║║Executed virtual command [Hall Bulb 4].flash (18ms)
+294ms ║║Executed physical command [Hall Bulb 5].on() (8ms)
+299ms ║║Executed virtual command [Hall Bulb 5].flash (17ms)
+313ms ║║Executed physical command [Jeff's Lamp].off() (8ms)
+317ms ║║Executed virtual command [Jeff's Lamp].flash (15ms)
+330ms ║║Executed physical command [Jenny's Lamp].off() (8ms)
+334ms ║║Executed virtual command [Jenny's Lamp].flash (16ms)
+348ms ║║Executed physical command [K Bulb 2].on() (8ms)
+352ms ║║Executed virtual command [K Bulb 2].flash (15ms)
+366ms ║║Executed physical command [K Bulb 3].off() (7ms)
+369ms ║║Executed virtual command [K Bulb 3].flash (16ms)
+383ms ║║Executed physical command [Kitchen Light].off() (8ms)
+387ms ║║Executed virtual command [Kitchen Light].flash (16ms)
+389ms ║║Requesting a wake up for Tue, Apr 9 2019 @ 7:10:11 AM CDT (in 12.1s)
+432ms ║╚Execution stage complete. (276ms)
+448ms ║Setting up scheduled job for Tue, Apr 9 2019 @ 7:10:02 AM CDT (in 2.774s), with 41 more jobs pending
+456ms ╚Event processed successfully (456ms)

Thanks!


#2

I think all you need to do is move that last WITH block (lines 54-58) down a hair right below the WHILE block. (and delete the empty IFs afterwards)