Help with Piston - Time Related


#1

I have a piston to turn on my TV, that is supposed to work like this:

  • Weekends -> Turn On at 8:30
  • Workdays -> Turn On at 17:30
  • On Workays that are holidays or I’m in Vacation -> Turn On at 08:30

Problem: Not working on Holidays (like today that is a Portuguese Holiday)

LOG:

20/06/2019, 08:30:13 +997ms
+0ms ╔Received event [Home].time = 1561015800000 with a delay of 13996ms
+371ms ║RunTime Analysis CS > 131ms > PS > 190ms > PE > 50ms > CE
+374ms ║Runtime (40315 bytes) successfully initialized in 190ms (v0.3.10c.20190522) (373ms)
+376ms ║╔Execution stage started
+388ms ║║Comparison (time) 30614382 happens_daily_at (time) 30600000 = true (1ms)
+390ms ║║Time restriction check failed
+392ms ║║Condition #21 evaluated false (6ms)
+393ms ║║Cancelling statement #21's schedules...
+399ms ║║Requesting time schedule wake up at Fri, Jun 21 2019 @ 8:30:00 AM WEST
+402ms ║║Condition group #20 evaluated false (state did not change) (18ms)
+410ms ║║Comparison (time) 30614404 happens_daily_at (time) 30600000 = false (1ms)
+412ms ║║Condition #12 evaluated false (5ms)
+414ms ║║Cancelling statement #12's schedules...
+419ms ║║Requesting time schedule wake up at Fri, Jun 21 2019 @ 8:30:00 AM WEST
+422ms ║║Condition group #11 evaluated false (state did not change) (16ms)
+423ms ║║Condition group #10 evaluated false (state did not change) (18ms)
+434ms ║║Comparison (time) 30614427 happens_daily_at (time) 61200000 = false (0ms)
+437ms ║║Condition #7 evaluated false (6ms)
+440ms ║║Cancelling statement #7's schedules...
+447ms ║║Requesting time schedule wake up at Thu, Jun 20 2019 @ 5:00:00 PM WEST
+451ms ║║Condition group #6 evaluated false (state did not change) (21ms)
+453ms ║║Condition group #5 evaluated false (state did not change) (25ms)
+459ms ║╚Execution stage complete. (84ms)
+463ms ║Setting up scheduled job for Thu, Jun 20 2019 @ 5:00:00 PM WEST (in 30585.541s), with 2 more jobs pending
+472ms ╚Event processed successfully (472ms)

It seems that it failed on Time verification, on the 2nd IF (condition #12), that was checking for Time = 08:30, and for some reason Failed.

Can anyone help me?


#2

I’m guessing by the time the piston gets to the second IF, it’s already past the time trigger… how about formatting it like this… (needs testing)


#3

" it’s already past the time trigger" -> That is my thought…
Ok, I understand your alternative and I will try it out.
Only one repair: On condition #21 instead of “Time happens daily at 8:30 but only on Sundays or Saturdays”, I changed it to "“Time happens daily at 8:30”. Otherwise, the IF of condition #26 only works on Weekends :slight_smile:


#4

Good catch, I forgot to remove that restriction :slight_smile: