Having trouble with "While" piston..How to end it?


#1

1) Give a description of the problem
If either fridge door is left open, the piston should send me a warning - This part works. However, I can’t get it to tell me when the door closes. I’ve put the “closed” part at the end of the “While” section, and after the “While” section, but this part never triggers. In fact, the part after the “While” triggers after the warning. I assumed the piston would stay within the “While” section while the door was open, and would leave this section to run the next section afterwards. I don’t understand why it runs the whole piston while the “While” part is still running.

2) What is the expected behaviour?
The 2 minute warning works (I knocked it down to 10 seconds for testing in the piston.)

3) What is happening/not happening?
I can’t figure out where to put the announcement telling me when the door is closed.

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

5) Attach logs after turning logging level to Full

+4ms ╔Received event [Refrigerator 1 - main].contact = closed with a delay of 40ms, canQueue: true, calledMyself: false
+12ms ║Runtime (13607 bytes) initialized 7 LockT > 0ms > r9T > 3ms > pistonT > 2ms (first state access 0 m:4 4 3) (v0.3.114.20240115_HE)
+13ms ║╔Execution stage started
+65ms ║║Reinitializing preset variable: FridgeCheck
+77ms ║║Comparison (enum) closed stays (string) open = false (0ms)
+78ms ║║Comparison (enum) closed stays (string) open = false (1ms)
+103ms ║║Cancel any timed trigger schedule stays device did not match cancel any timers for device :b2079466eb276c305e3e048063a5dafc: for condition 2
+104ms ║║Cancel any timed trigger schedule stays device did not match cancel any timers for device :efaa2fbc987911945afd4ab759f545b1: for condition 2
+107ms ║║Condition #2 evaluated false (40ms)
+109ms ║║Cancel condition #1’s schedules…11 (st:12)
+109ms ║║Condition group #1 evaluated false (condition changed) (43ms)
+112ms ║║Condition #32 evaluated false (1ms)
+113ms ║║Condition group #31 evaluated false (condition did not change) (2ms)
+134ms ║╚Execution stage complete. (121ms)
+175ms ╚Event processed successfully (172ms)
9/18/2026, 10:40:38 PM +903ms
+4ms ╔Received event [Home].time = 1789796438877 with a delay of 26ms, canQueue: true, calledMyself: false
+11ms ║Runtime (13589 bytes) initialized 7 LockT > 0ms > r9T > 3ms > pistonT > 1ms (first state access 0 m:4 4 3) (v0.3.114.20240115_HE)
+62ms ║╔Execution stage started
+71ms ║║set Variable ‘FridgeCheck’ changing initialized variable
+91ms ║║Executed virtual command setVariable (21ms)
+98ms ║║Calculating (string) The + (string)Kitchen Refrigerator >> (string) The Kitchen Refrigerator
+99ms ║║Calculating (string) The Kitchen Refrigerator + (string) was left >> (string) The Kitchen Refrigerator was left
+100ms ║║Calculating (string) The Kitchen Refrigerator was left + (string) OPEN >> (string) The Kitchen Refrigerator was left OPEN
+102ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN + (string) at >> (string) The Kitchen Refrigerator was left OPEN at
+103ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN at + (string)10:40 P.M. >> (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M.
+104ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. + (string) on >> (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on
+105ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on + (string)Fri, 9/18/2026 >> (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on Fri, 9/18/2026
+106ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on Fri, 9/18/2026 + (string) >> (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on Fri, 9/18/2026
+125ms ║║Executed virtual command setVariable (18ms)
+128ms ║║Executed virtual command setState (0ms)
+131ms ║║ The Kitchen Refrigerator was left OPEN at 10:40 P.M. on Fri, 9/18/2026
+133ms ║║Executed virtual command log (3ms)
+136ms ║║Calculating (string)The + (string)Kitchen Refrigerator >> (string)The Kitchen Refrigerator
+138ms ║║Calculating (string)The Kitchen Refrigerator + (string) has been open for 2 minutes >> (string)The Kitchen Refrigerator has been open for 2 minutes
+156ms ║║Executed virtual command setVariable (18ms)
+160ms ║║Executed virtual command setVariable (2ms)
+163ms ║║Executed virtual command setVariable (1ms)
+167ms ║║Executed virtual command setVariable (2ms)
+171ms ║║Executed virtual command setVariable (1ms)
+175ms ║║Comparison (enum) open is (string) open = true (0ms)
+176ms ║║Condition #10 evaluated true (4ms)
+177ms ║║Condition group #9 evaluated true (condition did not change) (4ms)
+180ms ║║Executed virtual command wait [10000] (1ms)
+182ms ║║Requesting wake up at Fri, Sep 18 2026 @ 10:40:49 PM PDT (in 9999ms) for 11 (st:12)
+202ms ║╚Execution stage complete. (140ms)
+358ms ║Setting up scheduled job for Fri, Sep 18 2026 @ 10:40:49 PM PDT (in 9958ms)
+361ms ╚Event processed successfully (357ms)
9/18/2026, 10:40:28 PM +589ms
+4ms ╔Received event [Home].time = 1789796428568 with a delay of 21ms, canQueue: true, calledMyself: false
+11ms ║Runtime (13603 bytes) initialized 7 LockT > 0ms > r9T > 3ms > pistonT > 1ms (first state access 0 m:4 4 3) (v0.3.114.20240115_HE)
+55ms ║╔Execution stage started
+63ms ║║set Variable ‘FridgeCheck’ changing initialized variable
+80ms ║║Executed virtual command setVariable (18ms)
+87ms ║║Calculating (string) The + (string)Kitchen Refrigerator >> (string) The Kitchen Refrigerator
+88ms ║║Calculating (string) The Kitchen Refrigerator + (string) was left >> (string) The Kitchen Refrigerator was left
+90ms ║║Calculating (string) The Kitchen Refrigerator was left + (string) OPEN >> (string) The Kitchen Refrigerator was left OPEN
+91ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN + (string) at >> (string) The Kitchen Refrigerator was left OPEN at
+92ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN at + (string)10:40 P.M. >> (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M.
+93ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. + (string) on >> (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on
+94ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on + (string)Fri, 9/18/2026 >> (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on Fri, 9/18/2026
+95ms ║║Calculating (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on Fri, 9/18/2026 + (string) >> (string) The Kitchen Refrigerator was left OPEN at 10:40 P.M. on Fri, 9/18/2026
+232ms ║║Executed virtual command setVariable (136ms)
+235ms ║║Piston state changed
+235ms ║║Executed virtual command setState (1ms)
+238ms ║║ The Kitchen Refrigerator was left OPEN at 10:40 P.M. on Fri, 9/18/2026
+241ms ║║Executed virtual command log (3ms)
+244ms ║║Calculating (string)The + (string)Kitchen Refrigerator >> (string)The Kitchen Refrigerator
+245ms ║║Calculating (string)The Kitchen Refrigerator + (string) has been open for 2 minutes >> (string)The Kitchen Refrigerator has been open for 2 minutes
+261ms ║║Executed virtual command setVariable (15ms)
+264ms ║║Executed virtual command setVariable (2ms)
+268ms ║║Executed virtual command setVariable (1ms)
+271ms ║║Executed virtual command setVariable (2ms)
+275ms ║║Executed virtual command setVariable (2ms)
+283ms ║║Comparison (enum) open is (string) open = true (1ms)
+284ms ║║Condition #10 evaluated true (8ms)
+285ms ║║Condition group #9 evaluated true (condition did not change) (8ms)
+288ms ║║Executed virtual command wait [10000] (1ms)
+291ms ║║Requesting wake up at Fri, Sep 18 2026 @ 10:40:38 PM PDT (in 9998ms) for 11 (st:12)
+308ms ║╚Execution stage complete. (253ms)
+394ms ║Setting up scheduled job for Fri, Sep 18 2026 @ 10:40:38 PM PDT (in 9946ms)
+396ms ╚Event processed successfully (392ms)
9/18/2026, 10:40:18 PM +387ms
+4ms ╔Received event [Home].time = 1789796418360 with a delay of 27ms, canQueue: true, calledMyself: false
+11ms ║Runtime (13589 bytes) initialized 7 LockT > 0ms > r9T > 3ms > pistonT > 1ms (first state access 0 m:4 4 3) (v0.3.114.20240115_HE)
+145ms ║╔Execution stage started
+153ms ║║Comparison (dynamic) Refrigerator 1 - main is_equal_to (dynamic) Refrigerator 1 - main = true (0ms)
+154ms ║║Condition #4 evaluated true (4ms)
+154ms ║║Condition group #3 evaluated true (condition did not change) (5ms)
+169ms ║║Executed virtual command setVariable (12ms)
+171ms ║║Condition #2 evaluated true (22ms)
+172ms ║║Condition group #1 evaluated true (condition changed) (24ms)
+176ms ║║Comparison (enum) open is (string) open = true (0ms)
+177ms ║║Condition #10 evaluated true (3ms)
+177ms ║║Condition group #9 evaluated true (condition did not change) (4ms)
+181ms ║║Executed virtual command wait [10000] (0ms)
+183ms ║║Requesting wake up at Fri, Sep 18 2026 @ 10:40:28 PM PDT (in 9999ms) for 11 (st:12)
+197ms ║╚Execution stage complete. (53ms)
+270ms ║Setting up scheduled job for Fri, Sep 18 2026 @ 10:40:28 PM PDT (in 9968ms)
+272ms ╚Event processed successfully (268ms)
9/18/2026, 10:40:08 PM +177ms
+3ms ╔Received event [Refrigerator 1 - main].contact = open with a delay of 39ms, canQueue: true, calledMyself: false
+18ms ║Runtime (13467 bytes) initialized 12 LockT > 0ms > r9T > 9ms > pistonT > 1ms (first state access 0 m:3 3 9) (v0.3.114.20240115_HE)
+22ms ║╔Execution stage started
+47ms ║║Comparison (enum) open stays (string) open = true (1ms)
+49ms ║║Comparison (enum) closed stays (string) open = false (0ms)
+185ms ║║Adding a timed trigger schedule stays match in list scheduling timer for device :b2079466eb276c305e3e048063a5dafc: for condition 2 wake up at Fri, Sep 18 2026 @ 10:40:18 PM PDT (in 9999ms) for 2 (st:2 / :b2079466eb276c305e3e048063a5dafc:)
+186ms ║║Cancel any timed trigger schedule stays device did not match cancel any timers for device :efaa2fbc987911945afd4ab759f545b1: for condition 2
+188ms ║║Condition #2 evaluated false (147ms)
+189ms ║║Condition group #1 evaluated false (condition did not change) (149ms)
+194ms ║║Comparison (enum) open is (string) closed = false (1ms)
+195ms ║║Condition #32 evaluated false (3ms)
+196ms ║║Condition group #31 evaluated false (condition did not change) (5ms)
+209ms ║╚Execution stage complete. (186ms)
+258ms ║Setting up scheduled job for Fri, Sep 18 2026 @ 10:40:18 PM PDT (in 9960ms)
+261ms ╚Event processed successfully (258ms)