What causes "times happens daily at" to NOT get rescheduled?


#1

1) Give a description of the problem
Piston is not being rescheduled at the daily time

2) What is the expected behavior?
I expect the piston to fire daily at a particular time.

3) What is happening/not happening?
Not firing. I’m guessing the problem is that the “time happens daily at…” statement is embedded within a complex if statement, but I thought that should not matter for purposes of scheduling.

Log shows a scheduling as expected on 11/16 (to fire on the 17th around 8am). The final firing of the piston on the 16th did not reschedule anything for the 17th, and the piston stops firing at 8am going forwards.

I have set the “time” statement to always subscribe. Does that time statement get skipped if the first if condition (cleaning day test) is not satisfied?

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
11/19/2018, 9:31:58 AM +197ms
+1ms ╔Received event [HayekHome].mode = Away with a delay of 73ms
+170ms ║Runtime (42972 bytes) successfully initialized in 124ms (v0.3.108.20180906) (168ms)
+171ms ║╔Execution stage started
+187ms ║╚Execution stage complete. (15ms)
+188ms ╚Event processed successfully (188ms)
11/17/2018, 12:00:29 PM +734ms
+1ms ╔Received event [HayekHome].mode = Home with a delay of 67ms
+160ms ║Runtime (42971 bytes) successfully initialized in 115ms (v0.3.108.20180906) (158ms)
+162ms ║╔Execution stage started
+177ms ║╚Execution stage complete. (16ms)
+179ms ╚Event processed successfully (179ms)
11/17/2018, 11:08:31 AM +184ms
+1ms ╔Received event [HayekHome].mode = Away with a delay of 51ms
+133ms ║Runtime (42970 bytes) successfully initialized in 92ms (v0.3.108.20180906) (131ms)
+134ms ║╔Execution stage started
+151ms ║╚Execution stage complete. (17ms)
+152ms ╚Event processed successfully (152ms)
11/17/2018, 7:59:44 AM +66ms
+1ms ╔Received event [HayekHome].time = 1542470385000 with a delay of -935ms
+160ms ║Runtime (42979 bytes) successfully initialized in 113ms (v0.3.108.20180906) (157ms)
+162ms ║╔Execution stage started
+188ms ║╚Execution stage complete. (26ms)
+190ms ╚Event processed successfully (190ms)
11/16/2018, 9:07:28 PM +925ms
+0ms ╔Received event [HayekHome].mode = Home with a delay of 89ms
+169ms ║Runtime (42968 bytes) successfully initialized in 122ms (v0.3.108.20180906) (168ms)
+171ms ║╔Execution stage started
+213ms ║╚Execution stage complete. (42ms)
+215ms ║Setting up scheduled job for Sat, Nov 17 2018 @ 7:59:45 AM PST (in 39135.861s)
+230ms ╚Event processed successfully (230ms)
11/16/2018, 6:24:15 PM +175ms
+1ms ╔Received event [HayekHome].mode = Away with a delay of 61ms
+164ms ║Runtime (42968 bytes) successfully initialized in 123ms (v0.3.108.20180906) (162ms)
+165ms ║╔Execution stage started
+229ms ║╚Execution stage complete. (64ms)
+231ms ║Setting up scheduled job for Sat, Nov 17 2018 @ 7:59:45 AM PST (in 48929.595s)
+243ms ╚Event processed successfully (242ms)
11/16/2018, 11:29:59 AM +52ms
+1ms ╔Received event [HayekHome].time = 1542396600003 with a delay of -951ms
+125ms ║Runtime (42977 bytes) successfully initialized in 89ms (v0.3.108.20180906) (123ms)
+126ms ║╔Execution stage started
+169ms ║║Executed virtual command setVariable (3ms)
+172ms ║╚Execution stage complete. (46ms)
+174ms ║Setting up scheduled job for Sat, Nov 17 2018 @ 7:59:45 AM PST (in 73785.775s)
+183ms ╚Event processed successfully (182ms)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

I usually put my triggers top level (un-indented on the extreme left)
and my conditions right below and indented.

(Basically, the opposite of what you have)

Every day at X time               <-- Trigger
Then
    IF location mode is Away      <-- Condition
    and
    variables match               <-- Condition
    Then Do stuff
    END IF
END EVERY

IF Location mode changes to Away  <-- Trigger
Then
    IF Time is between Y & Z      <-- Condition
    and
    variables match               <-- Condition
    Then Do Stuff
    END IF
END IF

The triggers are concrete events that are consistent. At time of execution, the conditions are checked before any action takes place.


#3

Now I remember that tip. Guess since the time event was subscribed to in my code I thought it would work OK (limited testing seemed to confirm that at the time). I had collapsed the code to current form for efficiency, but will expand it back out again keeping all time event triggers at the top level. Thanks again.