Outdoor light automation


1) Give a description of the problem
my outdoor lights turns on but does not turn off

2) What is the expected behaviour?
outdoor lights should turn on 1 hour after sunset and turns off 1 hour before sunrise

3) What is happening/not happening?
outdoor lights turn on 1 hour after sunset, as designed BUT does not turn off (1 hour before sunrise) as designed.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
4/27/2021, 2:27:31 PM +567ms
+1ms ╔Received event [The House].test = 1619548051564 with a delay of 3ms
+59ms ║RunTime Analysis CS > 23ms > PS > 7ms > PE > 29ms > CE
+62ms ║Runtime (38654 bytes) successfully initialized in 7ms (v0.3.113.20210203) (60ms)
+63ms ║╔Execution stage started
+96ms ║║Comparison (time) 52051635 is_before (time) 1619569620000 = true (7ms)
+98ms ║║Time restriction check passed
+100ms ║║Condition #2 evaluated true (31ms)
+104ms ║║Cancelling statement #2’s schedules…
+109ms ║║Requesting time schedule wake up at Tue, Apr 27 2021 @ 9:27:00 PM EDT
+112ms ║║Condition group #1 evaluated true (state did not change) (44ms)
+115ms ║║Cancelling statement #7’s schedules…
+129ms ║║Executed physical command [Back light Left].on() (9ms)
+130ms ║║Executed [Back light Left].on (11ms)
+138ms ║║Skipped execution of physical command [Back light Right].on([]) because it would make no change to the device. (5ms)
+139ms ║║Executed [Back light Right].on (7ms)
+151ms ║║Executed physical command [Front Light Left].on() (9ms)
+153ms ║║Executed [Front Light Left].on (12ms)
+165ms ║║Executed physical command [Front light Right].on() (9ms)
+166ms ║║Executed [Front light Right].on (12ms)
+179ms ║║Executed physical command [Garage light left].on() (10ms)
+180ms ║║Executed [Garage light left].on (12ms)
+192ms ║║Executed physical command [Garage light right].on() (9ms)
+193ms ║║Executed [Garage light right].on (11ms)
+205ms ║║Executed physical command [Side light].on() (9ms)
+206ms ║║Executed [Side light].on (11ms)
+295ms ║║Executed physical command [Back light Left].setLevel([100]) (44ms)
+296ms ║║Executed virtual command [Back light Left].adjustLevel (86ms)
+320ms ║║Executed virtual command [Back light Right].adjustLevel (22ms)
+337ms ║║Executed physical command [Front Light Left].setLevel([100]) (8ms)
+338ms ║║Executed virtual command [Front Light Left].adjustLevel (17ms)
+355ms ║║Executed physical command [Front light Right].setLevel([100]) (7ms)
+356ms ║║Executed virtual command [Front light Right].adjustLevel (17ms)
+375ms ║║Executed physical command [Garage light left].setLevel([100]) (10ms)
+376ms ║║Executed virtual command [Garage light left].adjustLevel (19ms)
+392ms ║║Executed physical command [Garage light right].setLevel([99]) (7ms)
+393ms ║║Executed virtual command [Garage light right].adjustLevel (15ms)
+413ms ║║Executed physical command [Side light].setLevel([100]) (10ms)
+414ms ║║Executed virtual command [Side light].adjustLevel (20ms)
+445ms ║╚Execution stage complete. (382ms)
+448ms ║Setting up scheduled job for Tue, Apr 27 2021 @ 9:27:00 PM EDT (in 25167s), with 1 more job pending
+459ms ╚Event processed successfully (459ms)


You need two separate triggers here. Currently the 2nd IF for sunrise is buried under the Else. It will never trigger. Moving the 2nd IF to its own block will fix that.
Also, the triggers themselves look odd. Consider using If time happens daily at one hour past sunset/sunrise.


will this work?


Here is what I was referring to, moving the IF out of the ELSE
(I selected random devices when importing your piston, ignore the device types listed)


yup the one i did, did not work. i’ll refine to what you have and hopefully it works.


YUP still a no go. :frowning:


I suggest using TIMERs — perfect for this application. Just think of them as the software equivalent of the common mechanical landscape timer. Just add two TIMERs to your piston:


… then move the existing WITH blocks within the appropriate TIMER … and delete the empty IF-END-IF statements.