Outdoor lighting on a schedule


#1

1) Give a description of the problem
The time trigger is not turning off the lights

2) What is the expected behaviour?
Lights turn off in the day light

3) What is happening/not happening?
It’s just staying on.

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

5) Attach logs after turning logging level to Full
12/16/2019, 4:16:59 PM +92ms
+0ms ╔Received event [Home].time = 1576534620000 with a delay of -908ms
+89ms ║Runtime (40812 bytes) successfully initialized in 9ms (v0.3.110.20191009) (87ms)
+89ms ║╔Execution stage started
+184ms ║║Executed [Front door lights].on (43ms)
+206ms ║║Executed [garage outside lights].on (21ms)
+238ms ║║Executed [Front Door Outlet].on (28ms)
+262ms ║║Executed [Gate Lights].on (23ms)
+265ms ║╚Execution stage complete. (176ms)
+267ms ║Setting up scheduled job for Tue, Dec 17 2019 @ 12:00:00 AM CST (in 27780.642s), with 1 more job pending
+275ms ╚Event processed successfully (275ms)
12/16/2019, 6:25:59 AM +76ms
+0ms ╔Received event [Home].time = 1576499160000 with a delay of -924ms
+73ms ║Runtime (40814 bytes) successfully initialized in 6ms (v0.3.110.20191009) (72ms)
+74ms ║╔Execution stage started
+153ms ║║Executed [Front door lights].off (24ms)
+172ms ║║Executed [garage outside lights].off (18ms)
+194ms ║║Executed [Front Door Outlet].off (18ms)
+214ms ║║Executed [Gate Lights].off (19ms)
+217ms ║╚Execution stage complete. (143ms)
+218ms ║Setting up scheduled job for Mon, Dec 16 2019 @ 4:17:00 PM CST (in 35460.707s), with 1 more job pending
+224ms ╚Event processed successfully (224ms)


#2

consider using two timer blocks.

every day at 20 minutes after sunset
with
switch 10 and 29
do
turn on
end with

every day at 20 minutes before sunrise
with
switch 10 and 29
do
turn off
end with


#3

You could also change the second condition from and else if to a separate if block. I believe this or @jkp’s suggestion will work for you.


#4

Do I need to have an end time? Does groovy just know when I say 20 minutes to sunset, that if it’s after sunrise that does not count as 20 minutes after sunset?


#5

If your trigger is:
Every day at 20 minutes after sunset
It only fires once a day, at that precise moment…

but if your condition is:
pic
then it will be true from 12AM until shortly after sunset


Also:

  • IF Time is before sunrise = 12AM until sunrise
  • IF Time is after sunrise = sunrise until 11:59:59PM
  • IF Time is before sunset = 12AM until sunset
  • IF Time is after sunset = sunset until 11:59:59PM