Step 1: Install the following plugins (From Apps Store):
Program Logic Event Generator
Program Logic Core
Day or Night Plugin.
After each install Vera will Restart.
When all are loaded … Refresh your browser (usually the Function F5 key)
Step 2:
Make sure you have set the location and timezone of your Vera up properly.
This is in the Setup → Location tab at the top of your Vera. This is so Vera can accurately determine sunrise and sunset for your location.
Step 3:
Setup the Day or Night plugin.
I use 20:00 minutes before sunrise (-20:00) for day and 20:00 after sunset for night.
Save your changes.
Step 4:
If you think about problems as IF Something then do SomethingElse.
In PLEG the Something is called a condition expression. With is a combination of one or more events in Vera. The SomethingElse are called Actions in PLEG.
Lets setup some input triggers for PLEG (Program Logic Event Generator) (Similar to setting up a trigger for a Scene). In PLEG every input has a name.
Create a trigger called NIGHT and base it on the Day or Night Plugin indicating Night.
Create a second trigger called Door and base it on a Key code (of *) on your door.
Now we will create a condition based on the inputs.
We will create a condition with a name of AutoLightOn. It’s expression is:
NIGHT and Door
Simple enough! Now lets add an action for this condition. (Similar to selecting devices for your scene). Select the light to turn on.
Step 4:
Arm your PLEG. Actions only happen when the PLEG is armed.
[hr]
Well we just got started.
Let’s add some extra credit to this example:
Maybe you want the light to go off after 15 minutes. Let’s add another condition called AutoLightOff with an expression of:
AutoLightOn; NOW > 15:00
This is a little more complex expression. It’s called a sequence expression. NOW is a like a 1 minute interval timer trigger. This statement says that when the NOW interval trigger fires … and it’s 15 minutes past the time that AutoLightOn was triggered … that this expression will be true.
Add an appropriate Action to this condition.
[hr]
You will find the Status command to be useful in understanding what is happening in your PLEG logic. Have fun … go out and tackle that next automation project!