Piston stops prematurely


#1

1) Give a description of the problem
I have a piston that should loop a specific number of times. It works, but erratically. Sometimes the piston will loop 4 times, sometimes 7, sometimes 3 before it stops executing. The piston should stop when a counter reaches 21, and while the variable is incrementing correctly the piston stops executing well before the variable gets set to 21.

I watched the piston run many times and it was accurately scheduling the next iteration of the loop but then crapped out each time. Each time it stops, I see the following message in the log but don’t know what it means or if it’s indicative of something I did wrong when I created the piston:

Received event [Home].execute = recovery with a delay of 202ms

2) What is the expected behavior?
Piston should execute a loop for a specific number of times and then stop.

3) What is happening/not happening?
The piston stops executing even though the variable that controls the loop has not been reached. The number of times the loop is executed before the piston ends varies each time the piston executes.

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

**5) Attach any logs (From [ST IDE]

9/7/2018, 10:02:55 AM +233ms
+0ms â•”Received event [Home].execute = recovery with a delay of 78ms
+10193ms â•‘RunTime Analysis CS > 23ms > PS > 10141ms > PE > 31ms > CE
+10195ms â•‘Piston waited at a semaphore for 10095ms
+10197ms â•‘Runtime (44770 bytes) successfully initialized in 10141ms (v0.3.108.20180906) (10196ms)
+10198ms â•‘â•”Execution stage started
+10212ms â•‘â•‘Condition #2 evaluated false (8ms)
+10213ms â•‘â•‘Condition group #1 evaluated false (state did not change) (9ms)
+10223ms â•‘â•‘Condition #18 evaluated false (7ms)
+10225ms â•‘â•‘Condition group #17 evaluated false (state did not change) (8ms)
+10227ms â•‘â•šExecution stage complete. (29ms)
+10229ms â•šEvent processed successfully (10230ms)

9/7/2018, 10:02:55 AM +507ms
+1ms â•”Received event [Home].execute = recovery with a delay of 190ms
+121ms â•‘RunTime Analysis CS > 22ms > PS > 68ms > PE > 30ms > CE
+123ms â•‘Runtime (44691 bytes) successfully initialized in 68ms (v0.3.108.20180906) (121ms)
+125ms â•‘â•”Execution stage started
+142ms â•‘â•‘Condition #2 evaluated false (10ms)
+143ms â•‘â•‘Condition group #1 evaluated false (state did not change) (11ms)
+152ms â•‘â•‘Condition #18 evaluated false (6ms)
+154ms â•‘â•‘Condition group #17 evaluated false (state did not change) (7ms)
+157ms â•‘â•šExecution stage complete. (32ms)
+158ms â•šEvent processed successfully (158ms)

9/7/2018, 10:02:55 AM +121ms
+0ms â•”Received event [Home].execute = recovery with a delay of 211ms
+95ms â•‘RunTime Analysis CS > 17ms > PS > 53ms > PE > 25ms > CE
+97ms â•‘Runtime (44683 bytes) successfully initialized in 53ms (v0.3.108.20180906) (96ms)
+98ms â•‘â•”Execution stage started
+113ms ║║Cancelling condition #2’s schedules…
+114ms â•‘â•‘Condition #2 evaluated false (10ms)
+115ms ║║Cancelling condition #1’s schedules…
+118ms â•‘â•‘Condition group #1 evaluated false (state changed) (12ms)
+128ms ║║Cancelling condition #18’s schedules…
+130ms â•‘â•‘Condition #18 evaluated false (7ms)
+131ms ║║Cancelling condition #17’s schedules…
+132ms â•‘â•‘Condition group #17 evaluated false (state changed) (11ms)
+136ms â•‘â•šExecution stage complete. (38ms)
+137ms â•šEvent processed successfully (137ms)

9/7/2018, 9:59:56 AM +138ms
+1ms â•”Received event [Home].time = 1536335997470 with a delay of -1332ms
+107ms â•‘RunTime Analysis CS > 19ms > PS > 59ms > PE > 29ms > CE
+110ms â•‘Runtime (44688 bytes) successfully initialized in 59ms (v0.3.108.20180906) (108ms)
+111ms â•‘â•”Execution stage started
+140ms â•‘â•‘Calculating (string) Door to garage is open. Message + (string) 6 >> (string) Door to garage is open. Message 6
+144ms â•‘â•‘Calculating (string) Door to garage is open. Message 6 + (string) of 20. >> (string) Door to garage is open. Message 6 of 20.
+259ms â•‘â•‘Executed virtual command sendPushNotification (110ms)
+274ms â•‘â•‘Comparison (enum) open is (string) open = true (2ms)
+276ms â•‘â•‘Condition #22 evaluated true (12ms)
+282ms â•‘â•‘Comparison (integer) 6 is_less_than (integer) 21 = true (2ms)
+284ms â•‘â•‘Condition #23 evaluated true (6ms)
+285ms â•‘â•‘Condition group #21 evaluated true (state did not change) (23ms)
+293ms â•‘â•‘Comparison (integer) 6 is_less_than_or_equal_to (integer) 19 = true (2ms)
+295ms â•‘â•‘Condition #25 evaluated true (7ms)
+297ms â•‘â•‘Condition group #24 evaluated true (state did not change) (10ms)
+300ms ║║Cancelling statement #30’s schedules…
+308ms â•‘â•‘Calculating (integer) 6 + (integer) 1 >> (integer) 7
+315ms â•‘â•‘Executed virtual command setVariable (4ms)
+322ms â•‘â•‘Executed virtual command wait (1ms)
+336ms â•‘â•‘Requesting a wake up for Fri, Sep 7 2018 @ 10:00:56 AM MDT (in 60.0s)
+350ms â•‘â•šExecution stage complete. (239ms)
+353ms â•‘Setting up scheduled job for Fri, Sep 7 2018 @ 10:00:56 AM MDT (in 59.992s)
+363ms â•šEvent processed successfully (363ms)

9/7/2018, 9:58:57 AM +136ms
+1ms â•”Received event [Home].time = 1536335938261 with a delay of -1126ms
+193ms â•‘RunTime Analysis CS > 89ms > PS > 77ms > PE > 28ms > CE
+196ms â•‘Runtime (44688 bytes) successfully initialized in 77ms (v0.3.108.20180906) (194ms)
+198ms â•‘â•”Execution stage started
+230ms â•‘â•‘Calculating (string) Door to garage is open. Message + (string) 5 >> (string) Door to garage is open. Message 5
+235ms â•‘â•‘Calculating (string) Door to garage is open. Message 5 + (string) of 20. >> (string) Door to garage is open. Message 5 of 20.
+263ms â•‘â•‘Executed virtual command sendPushNotification (22ms)
+278ms â•‘â•‘Comparison (enum) open is (string) open = true (2ms)
+280ms â•‘â•‘Condition #22 evaluated true (13ms)
+287ms â•‘â•‘Comparison (integer) 5 is_less_than (integer) 21 = true (2ms)
+289ms â•‘â•‘Condition #23 evaluated true (8ms)
+291ms â•‘â•‘Condition group #21 evaluated true (state did not change) (24ms)
+301ms â•‘â•‘Comparison (integer) 5 is_less_than_or_equal_to (integer) 19 = true (2ms)
+303ms â•‘â•‘Condition #25 evaluated true (7ms)
+304ms â•‘â•‘Condition group #24 evaluated true (state did not change) (10ms)
+308ms ║║Cancelling statement #30’s schedules…
+318ms â•‘â•‘Calculating (integer) 5 + (integer) 1 >> (integer) 6
+324ms â•‘â•‘Executed virtual command setVariable (3ms)
+331ms â•‘â•‘Executed virtual command wait (1ms)
+333ms â•‘â•‘Requesting a wake up for Fri, Sep 7 2018 @ 9:59:57 AM MDT (in 60.0s)
+342ms â•‘â•šExecution stage complete. (144ms)
+344ms â•‘Setting up scheduled job for Fri, Sep 7 2018 @ 9:59:57 AM MDT (in 59.991s)
+356ms â•šEvent processed successfully (355ms)

9/7/2018, 9:57:57 AM +153ms
+1ms â•”Received event [Home].time = 1536335878333 with a delay of -1181ms
+922ms â•‘RunTime Analysis CS > 149ms > PS > 746ms > PE > 27ms > CE
+925ms â•‘Runtime (44691 bytes) successfully initialized in 746ms (v0.3.108.20180906) (921ms)
+926ms â•‘â•”Execution stage started
+959ms â•‘â•‘Calculating (string) Door to garage is open. Message + (string) 4 >> (string) Door to garage is open. Message 4
+964ms â•‘â•‘Calculating (string) Door to garage is open. Message 4 + (string) of 20. >> (string) Door to garage is open. Message 4 of 20.
+1037ms â•‘â•‘Executed virtual command sendPushNotification (67ms)
+1052ms â•‘â•‘Comparison (enum) open is (string) open = true (3ms)
+1054ms â•‘â•‘Condition #22 evaluated true (13ms)
+1062ms â•‘â•‘Comparison (integer) 4 is_less_than (integer) 21 = true (3ms)
+1064ms â•‘â•‘Condition #23 evaluated true (9ms)
+1066ms â•‘â•‘Condition group #21 evaluated true (state did not change) (24ms)
+1074ms â•‘â•‘Comparison (integer) 4 is_less_than_or_equal_to (integer) 19 = true (2ms)
+1077ms â•‘â•‘Condition #25 evaluated true (7ms)
+1078ms â•‘â•‘Condition group #24 evaluated true (state did not change) (10ms)
+1082ms ║║Cancelling statement #30’s schedules…
+1090ms â•‘â•‘Calculating (integer) 4 + (integer) 1 >> (integer) 5
+1097ms â•‘â•‘Executed virtual command setVariable (4ms)
+1105ms â•‘â•‘Executed virtual command wait (1ms)
+1107ms â•‘â•‘Requesting a wake up for Fri, Sep 7 2018 @ 9:58:58 AM MDT (in 60.0s)
+1115ms â•‘â•šExecution stage complete. (190ms)
+1117ms â•‘Setting up scheduled job for Fri, Sep 7 2018 @ 9:58:58 AM MDT (in 59.992s)
+1135ms â•šEvent processed successfully (1136ms)

9/7/2018, 9:56:57 AM +244ms
+1ms â•”Received event [Home].time = 1536335818168 with a delay of -924ms
+905ms â•‘RunTime Analysis CS > 131ms > PS > 733ms > PE > 40ms > CE
+909ms â•‘Runtime (44690 bytes) successfully initialized in 733ms (v0.3.108.20180906) (907ms)
+911ms â•‘â•”Execution stage started
+947ms â•‘â•‘Calculating (string) Door to garage is open. Message + (string) 3 >> (string) Door to garage is open. Message 3
+953ms â•‘â•‘Calculating (string) Door to garage is open. Message 3 + (string) of 20. >> (string) Door to garage is open. Message 3 of 20.
+1017ms â•‘â•‘Executed virtual command sendPushNotification (58ms)
+1033ms â•‘â•‘Comparison (enum) open is (string) open = true (3ms)
+1035ms â•‘â•‘Condition #22 evaluated true (14ms)
+1042ms â•‘â•‘Comparison (integer) 3 is_less_than (integer) 21 = true (2ms)
+1044ms â•‘â•‘Condition #23 evaluated true (8ms)
+1045ms â•‘â•‘Condition group #21 evaluated true (state did not change) (25ms)
+1055ms â•‘â•‘Comparison (integer) 3 is_less_than_or_equal_to (integer) 19 = true (2ms)
+1057ms â•‘â•‘Condition #25 evaluated true (8ms)
+1058ms â•‘â•‘Condition group #24 evaluated true (state did not change) (10ms)
+1062ms ║║Cancelling statement #30’s schedules…
+1070ms â•‘â•‘Calculating (integer) 3 + (integer) 1 >> (integer) 4
+1078ms â•‘â•‘Executed virtual command setVariable (5ms)
+1086ms â•‘â•‘Executed virtual command wait (1ms)
+1088ms â•‘â•‘Requesting a wake up for Fri, Sep 7 2018 @ 9:57:58 AM MDT (in 60.0s)
+1096ms â•‘â•šExecution stage complete. (186ms)
+1099ms â•‘Setting up scheduled job for Fri, Sep 7 2018 @ 9:57:58 AM MDT (in 59.991s)
+1112ms â•šEvent processed successfully (1112ms)
9/7/2018, 9:55:57 AM +606ms
+1ms â•”Received event [Home].time = 1536335757542 with a delay of 64ms
+353ms â•‘RunTime Analysis CS > 169ms > PS > 155ms > PE > 28ms > CE
+356ms â•‘Runtime (44688 bytes) successfully initialized in 155ms (v0.3.108.20180906) (353ms)
+358ms â•‘â•”Execution stage started
+401ms â•‘â•‘Calculating (string) Door to garage is open. Message + (string) 2 >> (string) Door to garage is open. Message 2
+407ms â•‘â•‘Calculating (string) Door to garage is open. Message 2 + (string) of 20. >> (string) Door to garage is open. Message 2 of 20.
+479ms â•‘â•‘Executed virtual command sendPushNotification (65ms)
+496ms â•‘â•‘Comparison (enum) open is (string) open = true (4ms)
+499ms â•‘â•‘Condition #22 evaluated true (15ms)
+506ms â•‘â•‘Comparison (integer) 2 is_less_than (integer) 21 = true (2ms)
+509ms â•‘â•‘Condition #23 evaluated true (8ms)
+510ms â•‘â•‘Condition group #21 evaluated true (state did not change) (27ms)
+519ms â•‘â•‘Comparison (integer) 2 is_less_than_or_equal_to (integer) 19 = true (2ms)
+521ms â•‘â•‘Condition #25 evaluated true (7ms)
+523ms â•‘â•‘Condition group #24 evaluated true (state did not change) (9ms)
+527ms ║║Cancelling statement #30’s schedules…
+536ms â•‘â•‘Calculating (integer) 2 + (integer) 1 >> (integer) 3
+548ms â•‘â•‘Executed virtual command setVariable (8ms)
+558ms â•‘â•‘Executed virtual command wait (1ms)
+561ms â•‘â•‘Requesting a wake up for Fri, Sep 7 2018 @ 9:56:58 AM MDT (in 60.0s)
+572ms â•‘â•šExecution stage complete. (215ms)
+575ms â•‘Setting up scheduled job for Fri, Sep 7 2018 @ 9:56:58 AM MDT (in 59.988s)
+587ms â•šEvent processed successfully (586ms)
9/7/2018, 9:54:57 AM +352ms
+1ms â•”Received event [Door to Garage].contact = open with a delay of 107ms
+87ms â•‘RunTime Analysis CS > 21ms > PS > 47ms > PE > 19ms > CE
+89ms â•‘Runtime (44696 bytes) successfully initialized in 47ms (v0.3.108.20180906) (87ms)
+90ms â•‘â•”Execution stage started
+101ms â•‘â•‘Comparison (enum) open changes_to (string) open = true (1ms)
+103ms ║║Cancelling condition #2’s schedules…
+104ms â•‘â•‘Condition #2 evaluated true (8ms)
+105ms ║║Cancelling condition #1’s schedules…
+106ms â•‘â•‘Condition group #1 evaluated true (state changed) (10ms)
+109ms ║║Cancelling statement #7’s schedules…
+116ms â•‘â•‘Executed virtual command setVariable (3ms)
+131ms â•‘â•‘Executed virtual command sendPushNotification (10ms)
+141ms â•‘â•‘Comparison (enum) open is (string) open = true (2ms)
+143ms â•‘â•‘Condition #22 evaluated true (7ms)
+148ms â•‘â•‘Comparison (integer) 1 is_less_than (integer) 21 = true (2ms)
+150ms â•‘â•‘Condition #23 evaluated true (6ms)
+152ms â•‘â•‘Condition group #21 evaluated true (state did not change) (17ms)
+160ms â•‘â•‘Comparison (integer) 1 is_less_than_or_equal_to (integer) 19 = true (2ms)
+162ms â•‘â•‘Condition #25 evaluated true (7ms)
+163ms â•‘â•‘Condition group #24 evaluated true (state did not change) (9ms)
+167ms ║║Cancelling statement #30’s schedules…
+174ms â•‘â•‘Calculating (integer) 1 + (integer) 1 >> (integer) 2
+180ms â•‘â•‘Executed virtual command setVariable (3ms)
+187ms â•‘â•‘Executed virtual command wait (1ms)
+189ms â•‘â•‘Requesting a wake up for Fri, Sep 7 2018 @ 9:55:57 AM MDT (in 60.0s)
+196ms â•‘â•šExecution stage complete. (106ms)
+198ms â•‘Setting up scheduled job for Fri, Sep 7 2018 @ 9:55:57 AM MDT (in 59.993s)
+209ms â•šEvent processed successfully (209ms)
9/7/2018, 9:54:56 AM +102ms
+1ms â•”Received event [Home].time = 1536335697770 with a delay of -1669ms
+223ms â•‘RunTime Analysis CS > 116ms > PS > 87ms > PE > 20ms > CE
+226ms â•‘Runtime (44696 bytes) successfully initialized in 87ms (v0.3.108.20180906) (224ms)
+227ms â•‘â•”Execution stage started
+228ms â•‘â•šExecution stage complete. (2ms)
+230ms â•šEvent processed successfully (230ms)

Clear

Full Nothing selected None Minimal Medium Full

Logging level

Variables

Local variables

integertimesToWarn 7

integerintervalToWarn1

Global variables

boolean@firstTimeThroughtrue

boolean@holdMotionNotificationsfalse

boolean@sendSetpointChangeMessagetrue

boolean@sendSpeakNotificationstrue

dynamic@timeDogWasFedDayFriday

time@timeDogWasFedTime3:03:00 PM

boolean@turnPatioLightsOntrue

System variables

dynamic$argsnull

integer$day7

integer$dayOfWeek5

string$dayOfWeekNameFriday

device$deviceLocation

device$devicesLocation

integer$hour9

integer$hour249

string$httpContentType

integer$httpStatusCode

boolean$httpStatusOk

integer$iftttStatusCode

boolean$iftttStatusOk

dynamic$incidentsnull

decimal$index

dynamic$jsonnull

datetime$localNow1536313772031

device$locationLocation

string$locationModeHome

integer$mediaSize0

string$meridianAM

string$meridianWithDotsA.M.

datetime$midnight9/7/2018, 12:00:00 AM

integer$minute49

integer$month9

string$monthNameSeptember

string$nameSide Gate is Open

datetime$nextMidnight9/8/2018, 12:00:00 AM

datetime$nextNoon9/7/2018, 12:00:00 PM

datetime$nextScheduledTimeInvalid Date

datetime$nextSunrise9/8/2018, 6:33:00 AM

datetime$nextSunset9/7/2018, 7:21:00 PM

dynamic$nflnull

datetime$noon9/7/2018, 12:00:00 PM

datetime$now9/7/2018, 9:49:32 AM

dynamic$placesnull


#2

I believe there’s a scheduling issue with the ST platform right now so today is probably not a good day to figure this out.

Edit: I did get to 6 count when I imported your piston, then it went overdue by about 45 seconds and then it went to recovery.


#3

It looks like schedules are working again. I made a few minor changes to your original and changed to Logging only so I don’t flood my users with notices :slight_smile: