Alarm stops before finishing all tasks


#1
  1. Give a description of the problem
    Need to figure out what went wrong

  2. What is the expected behavior?
    Sonos plays, light comes on, delay, another light comes on, delay, both lights go to 90%, delay, sonos stops, delay, sonos states time X2

  3. What is happening/not happening?
    Today, the Sonos came on, the light came on, and no other actions took place after Delay_10M.

  4. Post a Green Snapshot of the piston

  5. Attach any logs (From ST IDE 1 and by turning logging level to Full)
    Turned to Full today, might have logs tomorrow.

I would also like to insert some kind of a cancel function, so that I can pause it if I forget to turn it off on holidays.


#2
5/31/2018, 6:10:32 AM +675ms
+0ms	╔Received event [Home].execute = recovery with a delay of 110ms
+199ms	║RunTime Analysis CS > 22ms > PS > 102ms > PE > 76ms > CE
+202ms	║Runtime (46506 bytes) successfully initialized in 102ms (v0.3.104.20180323) (201ms)
+203ms	║╔Execution stage started
+213ms	║║Condition #34 evaluated false (5ms)
+214ms	║║Condition group #33 evaluated false (state did not change) (7ms)
+222ms	║║Comparison (enum) on is (string) on = true (1ms)
+223ms	║║Condition #9 evaluated true (6ms)
+227ms	║║Comparison (time) 22232899 happens_daily_at (time) 21600000 = false (0ms)
+229ms	║║Cancelling condition #10's schedules...
+229ms	║║Condition #10 evaluated false (5ms)
+230ms	║║Cancelling statement #10's schedules...
+235ms	║║Requesting time schedule wake up at Fri, Jun 1 2018 @ 6:00:00 AM CDT
+237ms	║║Cancelling condition #1's schedules...
+237ms	║║Condition group #1 evaluated false (state changed) (21ms)
+240ms	║╚Execution stage complete. (38ms)
+242ms	║Setting up scheduled job for Fri, Jun 1 2018 @ 6:00:00 AM CDT (in 85767.084s)
+256ms	╚Event processed successfully (256ms)
5/31/2018, 6:10:22 AM +58ms
+0ms	╔Received event [Home].time/recovery = 1527765022057 with a delay of 1ms
+172ms	║RunTime Analysis CS > 13ms > PS > 81ms > PE > 77ms > CE
+174ms	║Runtime (46513 bytes) successfully initialized in 81ms (v0.3.104.20180323) (173ms)
+175ms	║╔Execution stage started
+10285ms	║║Executed physical command [Bedroom Ceiling].setLevel([2]) (10088ms)
+10286ms	║║Executed [Bedroom Ceiling].setLevel (10090ms)
+10416ms	║║Executed physical command [Bedroom Ceiling].on() (129ms)
+10417ms	║║Executed [Bedroom Ceiling].on (130ms)
+10420ms	║║Cancelling statement #48's schedules...
+10426ms	║║Calculating (time) 21600000 + (integer) 1800000 >> (time) 23400000
+10430ms	║║Executed virtual command [Bedroom Ceiling, Under Bed].waitForTime (1ms)
+10431ms	║║Requesting a wake up for Thu, May 31 2018 @ 6:30:00 AM CDT (in 1167.512s)
+10435ms	║╚Execution stage complete. (10260ms)
+10437ms	║Setting up scheduled job for Thu, May 31 2018 @ 6:30:00 AM CDT (in 1167.508s), with 1 more job pending
+10447ms	╚Event processed successfully (10446ms)
5/31/2018, 5:59:59 AM +72ms
+0ms	╔Received event [Home].time = 1527764400000 with a delay of -929ms
+208ms	║RunTime Analysis CS > 18ms > PS > 107ms > PE > 83ms > CE
+211ms	║Runtime (46513 bytes) successfully initialized in 107ms (v0.3.104.20180323) (210ms)
+212ms	║╔Execution stage started
+222ms	║║Condition #34 evaluated false (4ms)
+223ms	║║Condition group #33 evaluated false (state did not change) (5ms)
+233ms	║║Comparison (enum) on is (string) on = true (2ms)
+234ms	║║Condition #9 evaluated true (8ms)
+239ms	║║Comparison (time) 21599307 happens_daily_at (time) 21600000 = true (0ms)
+240ms	║║Time restriction check passed
+242ms	║║Cancelling condition #10's schedules...
+242ms	║║Condition #10 evaluated true (7ms)
+243ms	║║Cancelling statement #10's schedules...
+249ms	║║Requesting time schedule wake up at Fri, Jun 1 2018 @ 6:00:00 AM CDT
+255ms	║║Comparison (string) :6142893e9629263369d21adc26d29be8: is_not (string) :240fa85186f81809dcb54e6565862f72: = true (2ms)
+257ms	║║Condition #52 evaluated true (5ms)
+263ms	║║Comparison (datetime) 1527764399330 is_not_between (datetime) 1526187600000 .. (datetime) 1526792400000 = true (3ms)
+264ms	║║Time restriction check passed
+266ms	║║Condition #53 evaluated true (9ms)
+267ms	║║Cancelling condition #1's schedules...
+268ms	║║Condition group #1 evaluated true (state changed) (41ms)
+270ms	║║Cancelling statement #42's schedules...
+332ms	║║Executed physical command [Bedroom Sonos].setTrack([x-rincon-mp3radio://http://crystalout.surfernetwork.com:8001/WHVE_MP3]) (56ms)
+333ms	║║Executed [Bedroom Sonos].setTrack (58ms)
+416ms	║║Executed physical command [Bedroom Sonos].setLevel([35]) (79ms)
+417ms	║║Executed [Bedroom Sonos].setLevel (81ms)
+454ms	║║Executed physical command [Bedroom Sonos].play() (35ms)
+455ms	║║Executed [Bedroom Sonos].play (37ms)
+457ms	║║Cancelling statement #4's schedules...
+752ms	║║Executed physical command [Under Bed].setColor([[hex:    #140a05, hue:6, saturation:60, level:5]]) (288ms)
+753ms	║║Executed [Under Bed].setColor (290ms)
+756ms	║║Executed virtual command [Under Bed].wait (1ms)
+756ms	║║Waiting for 4000ms
+4858ms	║║Executed physical command [Under Bed].setLevel([10]) (98ms)
+4859ms	║║Executed [Under Bed].setLevel (100ms)
+4862ms	║║Cancelling statement #6's schedules...
+4868ms	║║Calculating (time) 21600000 + (integer) 600000 >> (time) 22200000
+4873ms	║║Executed virtual command [Bedroom Ceiling].waitForTime (1ms)
+4874ms	║║Requesting a wake up for Thu, May 31 2018 @ 6:10:00 AM CDT (in 596.055s)
+4879ms	║╚Execution stage complete. (4667ms)
+4881ms	║Setting up scheduled job for Thu, May 31 2018 @ 6:10:00 AM CDT (in 596.05s), with 1 more job pending
+4891ms	╚Event processed successfully (4890ms)

#3

I would create a virtual switch which you can toggle, this would let you choose if the alarm should be on or not.

As for it not running, I can see it gets to the 10 minutes wait and then schedules the piston to run again in ten minutes from the beginning. When it gets back to there all the original conditions at the top of the piston are no longer true and hence it doesn’t run anything else.


#4

New Development, Friday and today it has decided to work as expected again.

I’m not sure what on earth made it confused for a couple of days, but maybe it will act accordingly now.


#5

For every WITH statement that has a wait in it, click on the WITH statement, then the gear cog at the bottom to expand settings. Change your Task Cancellation Policy to “never cancel tasks”.

After any wait (longer than 3 seconds I think, usually) the IF condition is evaluated again. If it evaluates false, all pending tasks are cancelled. By changing your task cancellation policy, your piston will continue to run regardless of how the IF condition re-evaluates.