Complex Light Control


#1

1) Give a description of the problem
I need some help setting up the following light rule. How do I implement the info in bold with webcore?

IF

  • Any of Front Door, Gate, Garage is open
    AND

  • Entry Light Switch is Off
    AND

  • Time is between sunset and sunrise

Then

  • Using Entry Lights -> Turn On

  • Wait 8 minutes

  • However, if Front Door, Gate, or Garage is Open -> Restart the 8 minute wait

  • Using Entry Lights->Turn Off

Also, is it possible to add this to the rule? If Foyer lights is off then also turn on foyer lights and if garage lights is off also turn on garage lights and then turn them both off in 8 minutes?

Thanks


#2

I would probably split it into two separate IFs and change to a precise trigger:
(otherwise it could come on for a bit at sunset)

IF
    Any of Front Door, Gate, Garage CHANGES TO open  <-- Trigger
    AND
    Time is between sunset and sunrise               <-- Condition
Then
    Using Entry Lights -> Turn On
END IF

IF
    All of Front Door, Gate, Garage's contact stays closed for 8 min  <-- Trigger
Then
    Using Entry Lights -> Turn Off
END IF

#3

Thanks but I don’t want this to run initially if the lights are already on.
Say if I turn on a light switch manually and then later open the door. I don’t want the lights to turn off within 8 minutes after the door is closed.


#4

In that case, I would use a variable… This slightly modified version should do the trick:

define
    boolean timer
end define

IF
    Any of Front Door, Gate, Garage CHANGES TO open  <-- Trigger
    AND
    Entry Light Switch is Off                        <-- Condition
    AND
    Time is between sunset and sunrise               <-- Condition
Then
    Set variable timer = true
    Using Entry Lights -> Turn On
END IF

IF
    All of Front Door, Gate, Garage's contact stays closed for 8 min  <-- Trigger
    AND
    variable manual = true                                            <-- Condition
Then
    Using Entry Lights -> Turn Off
    Set variable timer = false
END IF

#5

Thanks! Just set it up. Will try it out tonight!