Newbie at PLEG Question

So, I am fairly new with VERA and PLEG. Currently, I have a scene that turns on a set of lights at the front off the house based on the DAY Night plugin. In deciding that I need to learn PLEG I have decided to try to create the scene in PLEG instead. What I would like to happen is to have the Front Lights (Door Light and Lamp Post Light) turn on 20 minutes after sunset (20 minute is configured in Day or Night plugin) and then turn off at 9:30pm everyday of the week. Probably a pretty standard and simple PLEG, but I thought I would reach out to the group to get confirmation on my PLEG below and suggestions. Thanks!

TRIGGERS:
tIsNight --Night has arrived
tFrontLampPostLightOn --Lights are turned on
tFronDoorLightsOn --Lights are turned on

SCHEDULES:
sFrontLightsTimer Off: All Days of the Week at 9:30pm

CONDITIONS:
cFrontLightsAutoOn --!tFrontLampPostLightOn OR !tFronDoorLightsOn AND tIsNight
cFrontLightsAutoOff --tFrontLampPostLightOn OR tFronDoorLightsOn AND sFrontLightsTimer

ACTIONS:
cFrontLightsAutoOn --Turn on Front Lamp Post Light and Front Door Lights
cFrontLightsAutoOff --Turn off Front Lamp Post Light and Front Door Lights

That’s a pretty good start @pmusselman. Just a couple of points:

You need to have sFrontLightsTimer come On at 21:30. Set the OffType to Interval of, say, 00:00:10 (ten seconds).

In logic evaluation, AND has precedence over OR. You can use parentheses to control this. I suspect that you really want:

cFrontLightsAutoOn (!tFrontLampPostLightOn OR !tFronDoorLightsOn) AND tIsNight
cFrontLightsAutoOff (tFrontLampPostLightOn OR tFronDoorLightsOn) AND sFrontLightsTimer

Note: If it’s night and you manually either OFF … the logic will turn them back on.

If you only want the lights to come on when Night happens … but still want manual control then:

EitherOff !tFrontLampPostLightOn OR !tFronDoorLightsOn
cFrontLightsAutoOn EitherOff and (EitherOff; tIsNight)

ANd set the repeats on the EitherOff conditions.

Thank you both very much. I created the PLEG in Vera and have also attached the report of the PLEG to this post. Hopefully everything runs as it should.

Updated with text of PLEG because attachment cut-off.

TRIGGERS:
tIsNight --Night has arrived
tFrontLampPostLightOn --Lights are turned on
tFronDoorLightsOn --Lights are turned on

SCHEDULES:
sFrontLightsTimer On at 21:30. Set the OffType to Interval of, say, 00:00:10

CONDITIONS:
cFrontLightsEitherOff --!tFrontLampPostLightOn OR !tFronDoorLightsOn --Provides manual control off lights without auto on
cFrontLightsAutoOn --cFrontLightsEitherOff and (cFrontLightsEitherOff; tIsNight)
cFrontLightsAutoOff --(tFrontLampPostLightOn OR tFronDoorLightsOn) AND sFrontLightsTimer

ACTIONS:
cFrontLightsEitherOff
cFrontLightsAutoOn --Turn on Front Lamp Post Light and Front Door Lights
cFrontLightsAutoOff --Turn off Front Lamp Post Light and Front Door Lights

You should be able to find a FREE PDF printer driver. Then you can print the file to a PDF file and attach.