Light Piston loops


#1

1) Give a description of the problem
The piston starts fine and runs through the scenario but at the end, 11:30pm, it starts over at the 10:00pm settings.

2) What is the expected behavior?
The piston starts at 1 hour past sunset, then at 10:00pm, the lights starts to dim and shut off for the night at 11:30pm.

3) What is happening/not happening?
The lights dim at 10:00pm then at 11:30, it restarts at the 10:00pm dimming again.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)
11/25/2018, 11:32:09 PM +923ms
+81ms ╔Stopping piston…
+201ms ╚Piston successfully stopped (121ms)
11/25/2018, 11:29:59 PM +87ms
+1ms ╔Received event [Home].time = 1543206600000 with a delay of -913ms
+85ms ║Runtime (40404 bytes) successfully initialized in 44ms (v0.3.108.20180906) (83ms)
+86ms ║╔Execution stage started
+359ms ║║Executed [Porch Light Left].setLevel (14ms)
+372ms ║║Executed [Porch Light Right].setLevel (12ms)
+377ms ║║Executed virtual command [Porch Light Left, Porch Light Right].wait (1ms)
+378ms ║║Requesting a wake up for Sun, Nov 25 2018 @ 11:59:59 PM EST (in 1800.0s)
+982ms ║║Executed [Porch Light Left].setLevel (10ms)
+994ms ║║Executed [Porch Light Right].setLevel (10ms)
+998ms ║║Executed virtual command [Porch Light Left, Porch Light Right].wait (1ms)
+1000ms ║║Requesting a wake up for Mon, Nov 26 2018 @ 12:00:00 AM EST (in 1800.0s)
+1009ms ║╚Execution stage complete. (923ms)
+1013ms ║Setting up scheduled job for Sun, Nov 25 2018 @ 11:59:59 PM EST (in 1799.367s), with 5 more jobs pending
+1034ms ╚Event processed successfully (1034ms)
11/25/2018, 10:59:56 PM +59ms
+1ms ╔Received event [Home].time = 1543204797211 with a delay of -1152ms
+63ms ║Runtime (40402 bytes) successfully initialized in 30ms (v0.3.108.20180906) (61ms)
+65ms ║╔Execution stage started
+106ms ║║Executed [Porch Light Left].setLevel (10ms)
+118ms ║║Executed [Porch Light Right].setLevel (10ms)
+145ms ║╚Execution stage complete. (81ms)
+148ms ║Setting up scheduled job for Sun, Nov 25 2018 @ 11:30:00 PM EST (in 1803.794s), with 2 more jobs pending
+156ms ╚Event processed successfully (156ms)
11/25/2018, 10:44:57 PM +58ms
+0ms ╔Received event [Home].time = 1543203898285 with a delay of -1228ms
+85ms ║Runtime (40402 bytes) successfully initialized in 45ms (v0.3.108.20180906) (84ms)
+86ms ║╔Execution stage started
+132ms ║║Executed [Porch Light Left].setLevel (15ms)
+146ms ║║Executed [Porch Light Right].setLevel (13ms)
+151ms ║║Executed virtual command [Porch Light Left, Porch Light Right].wait (0ms)
+152ms ║║Requesting a wake up for Sun, Nov 25 2018 @ 10:59:57 PM EST (in 900.0s)
+160ms ║╚Execution stage complete. (74ms)
+163ms ║Setting up scheduled job for Sun, Nov 25 2018 @ 10:59:57 PM EST (in 899.991s), with 3 more jobs pending
+172ms ╚Event processed successfully (171ms)
11/25/2018, 10:29:58 PM +64ms
+1ms ╔Received event [Home].time = 1543202999718 with a delay of -1654ms
+126ms ║Runtime (40402 bytes) successfully initialized in 66ms (v0.3.108.20180906) (123ms)
+128ms ║╔Execution stage started
+191ms ║║Executed [Porch Light Left].setLevel (18ms)
+210ms ║║Executed [Porch Light Right].setLevel (16ms)
+218ms ║║Executed virtual command [Porch Light Left, Porch Light Right].wait (1ms)
+220ms ║║Requesting a wake up for Sun, Nov 25 2018 @ 10:44:58 PM EST (in 900.0s)
+231ms ║╚Execution stage complete. (104ms)
+236ms ║Setting up scheduled job for Sun, Nov 25 2018 @ 10:44:58 PM EST (in 899.986s), with 3 more jobs pending
+246ms ╚Event processed successfully (245ms)
11/25/2018, 9:59:59 PM +122ms
+0ms ╔Received event [Home].time = 1543201200000 with a delay of -879ms
+101ms ║Runtime (40404 bytes) successfully initialized in 46ms (v0.3.108.20180906) (99ms)
+103ms ║╔Execution stage started
+212ms ║║Executed [Porch Light Left].setLevel (23ms)
+223ms ║║Executed [Porch Light Right].setLevel (8ms)
+441ms ║║Executed [Porch Light Left].setColorTemperature (211ms)
+468ms ║║Executed [Porch Light Right].setColorTemperature (25ms)
+476ms ║║Executed [Porch Light Left].on (5ms)
+490ms ║║Executed [Porch Light Right].on (12ms)
+500ms ║║Executed virtual command [Porch Light Left, Porch Light Right].setVariable (3ms)
+575ms ║║Executed [Porch Light Left].setLevel (22ms)
+588ms ║║Executed [Porch Light Right].setLevel (11ms)
+594ms ║║Executed virtual command [Porch Light Left, Porch Light Right].wait (1ms)
+595ms ║║Requesting a wake up for Sun, Nov 25 2018 @ 10:29:59 PM EST (in 1800.0s)
+615ms ║╚Execution stage complete. (513ms)
+619ms ║Setting up scheduled job for Sun, Nov 25 2018 @ 10:29:59 PM EST (in 1799.978s), with 3 more jobs pending
+629ms ╚Event processed successfully (628ms)

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


#2

Try using every day at 10:00 PM instead of Time is after. I believe it will loop since after 11:30 PM when the time changes it is still after 10:00PM so the statement becomes true and then it performs your tasks.


#3

Makes sense. I’ll try that tonight.


#4

ok, silly question. Is that Time happens daily at 10:00 PM? If not, how do i get that statement?


#5

There’s another one… I think it’s under Timer? Will verify.

Edit: Like this one…


#6

So I changed the statement to every day and now the first statement doesn’t run. It starts with the every day statement. So in this example, it starts at 2:11 PM not 2:10 PM.

11/26/2018, 2:10:59 PM +45ms
+0ms ╔Received event [Home].time = 1543259460000 with a delay of -956ms
+87ms ║RunTime Analysis CS &gt; 17ms &gt; PS &gt; 43ms &gt; PE &gt; 27ms &gt; CE
+90ms ║Runtime (40457 bytes) successfully initialized in 43ms (v0.3.108.20180906) (89ms)
+92ms ║╔Execution stage started
+129ms ║║Cancelling statement #18's schedules...
+151ms ║║Executed physical command [Porch Light Left].setLevel([60]) (14ms)
+153ms ║║Executed [Porch Light Left].setLevel (16ms)
+168ms ║║Executed physical command [Porch Light Right].setLevel([60]) (13ms)
+169ms ║║Executed [Porch Light Right].setLevel (15ms)
+174ms ║║Executed virtual command [Porch Light Left, Porch Light Right].wait (1ms)
+176ms ║║Requesting a wake up for Mon, Nov 26 2018 @ 2:40:59 PM EST (in 1800.0s)
+183ms ║╚Execution stage complete. (91ms)
+185ms ║Setting up scheduled job for Mon, Nov 26 2018 @ 2:40:59 PM EST (in 1799.993s), with 1 more job pending
+195ms ╚Event processed successfully (195ms)
11/26/2018, 2:07:45 PM +128ms
+1ms ╔Starting piston... (v0.3.108.20180906)
+268ms ║╔Subscribing to devices...
+333ms ║║Subscribing to Porch Light Left...
+335ms ║║Subscribing to Porch Light Right...
+336ms ║╚Finished subscribing (76ms)
+379ms ║Comparison (time) 50865488 is_between (time) 51000000 .. (time) 54000000 = false (15ms)
+449ms ║Comparison (time) 50865563 is_after (time) 61200000 = false (10ms)
+470ms ║Setting up scheduled job for Mon, Nov 26 2018 @ 2:11:00 PM EST (in 194.403s)
+484ms ╚Piston successfully started (483ms)

#7

You can change the first statement to the everyday at Sunset (and corresponding offset). Also, if your bulbs turn on when the set level is sent, you can drop the Turn on task.


#8

That seems to work… I actually just changed all if statements to every day. Thanks for the help eibyer.