Simple Holiday Lights


#1

1) Give a description of the problem
It is not running during the scheduled time.

2) What is the expected behavior?
This is a very simplified version of Bangali’s Holiday Lights piston. This piston should first check the time of day and then check the date. At 30 minutes to sunset, it should start cycling through the list of colors until midnight. I have adjusted the time and date range for it to run now. I know there is a more efficient way to have it cycle through the colors but I’m learning and haven’t figured it out yet.

3) What is happening/not happening?
All of the time and date checks are showing false in the logs.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full

11/19/2019, 9:38:59 AM +108ms
+1ms ╔Received event [Home].time = 1574174340000 with a delay of -892ms
+290ms ║RunTime Analysis CS > 22ms > PS > 240ms > PE > 28ms > CE
+293ms ║Runtime (46389 bytes) successfully initialized in 240ms (v0.3.110.20191009) (292ms)
+294ms ║╔Execution stage started
+309ms ║║Comparison (time) 34739407 is_between (time) 34740000 .. (time) 1574139600000 = true (7ms)
+310ms ║║Time restriction check passed
+312ms ║║Cancelling condition #34's schedules...
+312ms ║║Condition #34 evaluated true (13ms)
+313ms ║║Cancelling statement #34's schedules...
+320ms ║║Requesting time schedule wake up at Wed, Nov 20 2019 @ 12:00:00 AM EST
+322ms ║║Cancelling condition #33's schedules...
+323ms ║║Condition group #33 evaluated true (state changed) (24ms)
+331ms ║║Calculating (string) 07/04/ + (string) 2019 >> (string) 07/04/2019
+336ms ║║Calculating (decimal) 0.0 - (decimal) 7.0 >> (decimal) -7.0
+343ms ║║Calculating (string) 07/04/ + (string) 2019 >> (string) 07/04/2019
+350ms ║║Comparison (date) 1574139600000 is_between (datetime) 1561608000000 .. (datetime) 1562299200000 = false (4ms)
+352ms ║║Condition #38 evaluated false (26ms)
+357ms ║║Cancelling statement #38's schedules...
+364ms ║║Calculating (string) 07/04/ + (string) 2019 >> (string) 07/04/2019
+369ms ║║Calculating (decimal) 0.0 - (decimal) 7.0 >> (decimal) -7.0
+378ms ║║Calculating (string) 07/04/ + (string) 2019 >> (string) 07/04/2019
+383ms ║║Condition group #35 evaluated false (state did not change) (58ms)
+391ms ║║Calculating (string) 10/01/ + (string) 2019 >> (string) 10/01/2019
+399ms ║║Calculating (string) 10/31/ + (string) 2019 >> (string) 10/31/2019
+406ms ║║Comparison (date) 1574139600000 is_between (datetime) 6512360418207478181 .. (datetime) 1572580800000 = false (4ms)
+407ms ║║Condition #39 evaluated false (23ms)
+408ms ║║Cancelling statement #39's schedules...
+415ms ║║Calculating (string) 10/01/ + (string) 2019 >> (string) 10/01/2019
+424ms ║║Calculating (string) 10/31/ + (string) 2019 >> (string) 10/31/2019
+429ms ║║Requesting time schedule wake up at Tue, May 9 206370456 @ 5:37:58 AM EDT
+431ms ║║Condition group #36 evaluated false (state did not change) (48ms)
+438ms ║║Calculating (string) 11/01/ + (string) 2019 >> (string) 11/01/2019
+446ms ║║Calculating (string) 12/31/ + (string) 2019 >> (string) 12/31/2019
+452ms ║║Comparison (date) 1574139600000 is_between (datetime) 6743774178207478229 .. (datetime) 7191982818207478237 = false (4ms)
+454ms ║║Condition #51 evaluated false (22ms)
+455ms ║║Cancelling statement #51's schedules...
+461ms ║║Calculating (string) 11/01/ + (string) 2019 >> (string) 11/01/2019
+470ms ║║Calculating (string) 12/31/ + (string) 2019 >> (string) 12/31/2019
+474ms ║║Requesting time schedule wake up at Fri, Jun 25 213703666 @ 5:37:58 AM EDT
+476ms ║║Condition group #37 evaluated false (state did not change) (45ms)
+481ms ║╚Execution stage complete. (187ms)
+483ms ║Setting up scheduled job for Wed, Nov 20 2019 @ 12:00:00 AM EST (in 51660.409s), with 5 more jobs pending
+491ms ╚Event processed successfully (491ms)

#2

Since you are not actually adding any days to the last set of dates, try removing ‘addDays’ from that comparison to see if that is causing a problem. or insert ‘,0’ into the function. I see whenever you are missing the second parameter you get a bade date number (way out of range compared to the rest).

In general, you can’t just leave a required input tot a function out as WC will fill in a random number. That is your problem.


#3

Thank you. Once I added ‘,0’ to the functions, it worked.