[quote=“thetwc, post:1, topic:175329”]I’ve been reading through all these posts on here and I can’t work it, I’m being thick.
How do you get these plugin to do anything?
I’ve installed the 3 elements from the App Store, all good.
I’ve got a PLEG device in bypass. Going into the spanner gets the options.
Inputs, triggers I get.
Conditions and actions just don’t click in my head.
Can someone do a walk through with some more detail?
Thank you.[/quote]
Thetwc,
I am a “dummy” and spent a while trying to get the “simulate smartswitch” example you linked to working too.
I eventually worked out there was a spelling mistake in a variable name (MulitOn) and some brackets were in the wrong places - just put there to test us newbies I’m sure Richard LOL
I’m not trying to hijack here but the title is PLEG for dummies and I consider this right along those lines… I just started with PLEG today and I’m slowly understanding the commands. I’ve read the basic guide written by RexBeckett, it’s a lot to take in but I’m getting there. My question is simple, when I installed PLEG, it created the PLEG icon that I have written my first PLEG sequence in. Now that I want to write another one, do I continue in the same place adding more inputs and conditions below the first sequence or should I be creating a new “icon” for each individual sequence. (I’m used to creating new scenes and having each one be separate in VERA UI)
Generally speaking, you can add your additional logic to the same PLEG device. One PLEG can handle many Conditions. Each Condition has a fairly small impact on both CPU load and memory so it is more efficient to do this than to create extra PLEGs. Consider splitting to separate PLEG devices if you are approaching forty Conditions.
Many of us partition our logic into separate PLEGs according to function. e.g. Heating, Lighting, Security, etc.
RexBecket says…Many of us partition our logic into separate PLEGs according to function. e.g. Heating, Lighting, Security, etc.
Along these lines, I have a question for you.
I have 2 PLEGs. One is for lighting, and another I call Control PLEG is for various other things such as security settings or other device control.
On my Control PLEG I have a set up whereby all my lights will start blinking if I have an alarm trip. Now in the Lighting PLEG I have my lights with motion trip turn on light, auto on, auto off, etc.
My question is that if a lighting scenario conflicts with each other, how does PLEG handle that? Example, If my lights are blinking, the other PLEG is seeing lights come on and starts timing for auto off, or it is seeing the <15 sec manual off for over riding the auto functions…whatever. Is this effecting the PLEGs together and screwing up my system performance?
If I am armed away, and my lights go into an on/off lived in look, is my other PLEG fighting to auto turn off these lights, when in fact I want them to stay on?
[quote=“RichardTSchaefer, post:2, topic:175329”]You might start with something simpler …
That example uses Sequence Conditions, and they are the most complicated.
Start with something simple like turning on a light with motion at night.[/quote][quote=“thetwc, post:1, topic:175329”]I’ve been reading through all these posts on here and I can’t work it, I’m being thick.
How do you get these plugin to do anything?
I’ve installed the 3 elements from the App Store, all good.
I’ve got a PLEG device in bypass. Going into the spanner gets the options.
Inputs, triggers I get.
Conditions and actions just don’t click in my head.
That's entirely down to how you write the expressions. There is no automatic communication between PLEG devices. If one PLEG turns a light on, another one would see it as a trigger just as if you had hit the wall-switch.
If you have two PLEG devices controlling the same lights, you may want to add some logic to prevent interference. You could add a term to your normal lighting conditions that ignores on/off/on if the alarm is tripped. Another approach would be to put the light-flashing logic in the lighting PLEG and use a trigger fired from the Control PLEG to enable it. The trigger could be a VirtualSwitch or Condition is satisfied from the Control PLEG.
Generally speaking, you can add your additional logic to the same PLEG device. One PLEG can handle many Conditions. Each Condition has a fairly small impact on both CPU load and memory so it is more efficient to do this than to create extra PLEGs. Consider splitting to separate PLEG devices if you are approaching forty Conditions.
Many of us partition our logic into separate PLEGs according to function. e.g. Heating, Lighting, Security, etc.[/quote]
Rex-
I’m all for organization and naming so I can find individual problems. I’m having a hard time figuring out how to create separate PLEGs. The first one was created when I installed the PLEG application but how do I create more?
I'm having a hard time figuring out how to create separate PLEGs. The first one was created when I installed the PLEG application but how do I create more?
Click on Vera's [b]APPS[/b] tab. In the list of plugins, click on the text [b]Program Logic Event Generator[/b]. Click the [b]Create another[/b] button. Restart Vera and refresh your browser page. Voila: a new PLEG.
Thanks… that was what I needed. Next question… I’m started to write my logic and looking at the examples, could you tell me what the statement in red is actually doing?
night and B_OHD and (night; B_OHD)
I understand that I am "and"ing the night and B_OHD triggers together but I don’t know why I’m "and"ing the “(night; B_OHD)” with the other two or what that function is actually doing.
SO essentially if I wanted my lights to come on when ever it is night on my day/night toggle (night) and my garage door is open (B_OHD), then the “(night; B_OHD)” statement is not needed?
If I understand correctly, PLEG is always polling the inputs and so the “night and B_OHD” command should always trigger when night and B_OHD are high at the same time?
[quote=“copekyle, post:16, topic:175329”]SO essentially if I wanted my lights to come on when ever it is night on my day/night toggle (night) and my garage door is open (B_OHD), then the “(night; B_OHD)” statement is not needed?
If I understand correctly, PLEG is always polling the inputs and so the “night and B_OHD” command should always trigger when night and B_OHD are high at the same time?[/quote]
If you are using Day/Night app, you create an input called IsNight you will use that a lot so go ahead.
Another Action is B_OHD which you will creat an input trigger Garage Sensor Is Tripped
so you want to create a condition
TurnGarageLightON = IsNight AND B_OHD
If you then want to turn it off after the sensor is no longer triggered (no more motion)
Create the condition:
TurnGarageLightOff = Isnight AND !B_OHD
or IsNight AND Not B_OHD
PLEG is not polling the inputs, rather ‘noticing’ and recording when their status changes. You are looking for that status (or combination of different status) to change to TRUE to fire your desired Action.
I’m sure I could just wait until I get home tonight to try this but I’m coding everything while at work… (just can’t wait). How does PLEG handle the manual operation of switches. So lets say I have the lights set to shut off when the garage is closed at night but then after this happens, can I just turn on the lights manually and PLEG won’t shut them off?
Does PLEG only trigger on status changes or does it constantly monitor the status and make sure things are always operating according to the programmed conditions?