Set light level based on time of day


#1

1) Give a description of the problem
Currently when my lights are activated by motion they turn on to 100% brightness during the day, but after 8:00 and before 11:00 they will only turn on to 20%. I would like for them to turn on at 100% unless it is between sunset and sunrise, then I would like it to be 20%. Right now is it just a static time and I can’t figure out how to make it based on sunset and sunrise.

4) Post a Green Snapshot of the pistonimage

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)

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


#2

Since you only have two goals, there is no need for the formula on line 35.
I would slightly alter lines 21-37 to something like this:

IF Sensor's motion changes to active
   and
   RGB's are all off
   and
   Keypad's switch is off
Then
   With location = Set variable {programatic} = true
   IF Time is between sunrise and sunset
   Then
      Set level to 100%
   ELSE
      Set level to 20%
   END IF
END IF

(notice the second IF is indented)