Turn Lights on and off at specific times


#1

1) Give a description of the problem
I am trying to create a simple piston to turn on Christmas Lights in the yard at 5:00AM, turn them off after sunrise, turn them back on right before sunset and then turn them off at 1:00 AM. This doesn’t seem to be working to turn the lights on or off at any time. I’m not sure what I am doing wrong here

2) What is the expected behaviour?
Turn Christmas lights on and off at specific times

3) What is happening/not happening?
Based on the logs it seems like something is running at the selected times, but it isn’t turning the lights on or off

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

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)
12/22/2019, 12:59:59 AM +196ms
+1ms ╔Received event [Home].time = 1576994400000 with a delay of -805ms
+221ms ║RunTime Analysis CS > 117ms > PS > 71ms > PE > 34ms > CE
+225ms ║Runtime (38494 bytes) successfully initialized in 71ms (v0.3.110.20191009) (223ms)
+226ms ║╔Execution stage started
+291ms ║╚Execution stage complete. (66ms)
+294ms ║Setting up scheduled job for Sun, Dec 22 2019 @ 5:00:00 AM EST (in 14400.511s), with 3 more jobs pending
+304ms ╚Event processed successfully (304ms)
12/21/2019, 5:02:59 PM +73ms
+0ms ╔Received event [Home].time = 1576965780000 with a delay of -928ms
+83ms ║RunTime Analysis CS > 21ms > PS > 45ms > PE > 18ms > CE
+86ms ║Runtime (38492 bytes) successfully initialized in 45ms (v0.3.110.20191009) (85ms)
+87ms ║╔Execution stage started
+124ms ║╚Execution stage complete. (38ms)
+126ms ║Setting up scheduled job for Sun, Dec 22 2019 @ 1:00:00 AM EST (in 28620.801s), with 3 more jobs pending
+140ms ╚Event processed successfully (140ms)
12/21/2019, 8:09:59 AM +59ms
+0ms ╔Received event [Home].time = 1576933800000 with a delay of -942ms
+108ms ║RunTime Analysis CS > 30ms > PS > 58ms > PE > 20ms > CE
+110ms ║Runtime (38493 bytes) successfully initialized in 58ms (v0.3.110.20191009) (109ms)
+111ms ║╔Execution stage started
+170ms ║╚Execution stage complete. (58ms)
+172ms ║Setting up scheduled job for Sat, Dec 21 2019 @ 5:03:00 PM EST (in 31980.77s), with 3 more jobs pending
+182ms ╚Event processed successfully (182ms)
12/21/2019, 4:59:59 AM +65ms
+1ms ╔Received event [Home].time = 1576922400000 with a delay of -935ms
+233ms ║RunTime Analysis CS > 78ms > PS > 132ms > PE > 22ms > CE
+235ms ║Runtime (38495 bytes) successfully initialized in 132ms (v0.3.110.20191009) (234ms)
+236ms ║╔Execution stage started
+270ms ║╚Execution stage complete. (34ms)
+273ms ║Setting up scheduled job for Sat, Dec 21 2019 @ 8:10:00 AM EST (in 11400.663s), with 3 more jobs pending
+348ms ╚Event processed successfully (348ms)

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


#2

The body of the piston looks OK… but I would try deleting that empty ONLY WHEN block… (lines 16-18) since it can never be true… It may be blocking the rest of the piston from running.


On an unrelated note, there is no reason to mess with Task Cancellation Policy in this piston.
(the default setting should work)


#3

It will not let me delete that initial “only when” statement.

I didn’t think it would require changing the TCP, but I was searching for what the problem could be.


#4

I imported your piston, and that block was ‘stuck’ for me as well…

Sooo… I created your piston from scratch… With a few extra LOG commands which will help troubleshooting.

Please pause your current piston, and import and test this new one.

It should work right out of the box.

(if it gives you any trouble, please turn on Trace and set Log Level to full)


#5

Thanks WCmore. After your comment I did the same thing and recreated the piston from scratch making sure I didn’t have any hanging “open with” statements and it seems to be working well. Not sure why that command was hanging things up, but I won’t worry too much about it now that I have the new one working.


#6

Glad we got it working…