I guess i am very very basic

I read through the PDF and watched the YouTube video…

I have to go to the absolute basic before i can start playing with PLEG… I guess even more basic than the PDF…

I installed Program Logic Event Generator and Program Logic Core.

now what?? Where do i get started? Do i edit the items in Program Logic Even Generator?? Do i save that created PLEG somewhere? what if i want to make another? Does a “PLEG” turn into a scene in the UI?? ::slight_smile: ::slight_smile:

Thanks

Read the very first part of the PDF it explains it quite well and watch the youtube videos again.
I take it as you are new that you use UI7, so i go from that when i try to explain.

First you need to create a "device with the app “Program Logic Event Generator”, or you might already have one dont quite remember if one were automagically created. To check Click “my apps”, and Program Logic Event Generator, details.

If you dont see anything under “This plugin has created the following devices:” then u need to press, create another.
You should now or already have a “PLEG” under devices named “Program Logic Event Generator”

Open this device, you can choose to name it under options if you wish. I have named two of mine to Alarm System and General House Tasks.

Now you have to make a trigger a condition and a action.

For example:

Trigger1 = SceneController1 = true (a button, remote, motionsensor or whatever)

Condition = Cond1ON - “SceneController1” (state of the trigger SceneController1 is true which makes the condition true)
Condition = Cond1OFF - “NOT SceneController1”(state of the trigger SceneController1 is false which makes the condition true, you can make a ! infront of the triggername that would be the same as NOT for example !SceneController1)

Action - Cond1ON= Action for condition1 is turn on light.
Action - Cond1OFF= Action for condition1 is turn off light.

The condition can be quite advanced and use many different expressions. I just mention the easiest example i can imagine.
So what happens in the above example?

you press button, the condition becomes true becuase the trigger becomes true. Now an action tied to the condition is executed. When button no longer is ON the second condition become true, and the action to turn off light is executed.

Read rexbeckets guide very much also check examples subforum. They will help you alot, in the beginning it is hard to think “the right way” and the conditions when trying to make something simple can be very frustrating.
i the beginning i used alot of “virtual switches” (another app) to help me get my conditions right.

Good luck, dont give up on it. It will come to you and reward your efforts with a powerfull tool.

The plegs dont become a scene in the UI. You can say that each “PLEG” you create is its own sandbox, with its won triggers and conditions. Hence i have several PLEGS.

Garden
General House Tasks
Alarm System
And for experimenting i have a pleg called “Area 51”

Thanks so much!! This pushed me in the right direction!

I’m going to play around with it.

Mrhex, thanks for your post. I’ve been trying to wrap my head around PLEG (don’t have a vera hooked up yet currently) and frankly luup scene coding has made more sense to my programmers mind, yet based on almost literally everyone heres’ recommendation, I know I need to learn it. Everyone immediatly starts talking about their PLEG logic first and I think the missing piece for me was you explaining how to actually start working and organizing the “devices”. Many thanks for your explanation.

I've been trying to wrap my head around PLEG

In programming people think of:

If  [b]X[/b] then [b]Y[/b]

[hr]

In PLEG
X is called the condition
and
Y is called the action.

X is a boolean expression of inputs or even other conditions. PLEG has lots of capabilities for various expression types.
Where inputs can be Triggers or Schedule or Device Properties. (Only he first two are available by MCV for scenes)

[hr]

MCV scenes only allows an expression of the logical OR of ALL defined inputs.
So X is Input1 OR Input2 … OR InputN
Y is the set of device actions for the scene.

A scene IN MCV can be represented as a SINGLE condition/action pair in PLEG.