We have moved at community.getvera.com

Author Topic: PLEG Basics - An Introduction to the Program Logic Event Generator  (Read 154509 times)

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Program Logic Event Generator (PLEG) is an amazingly powerful and flexible tool that can be used to implement almost any automation scenario on Vera. This forum has many examples of creative and ingenious PLEG applications. Once you learn to use PLEG, you will wonder how you managed without it - and why you didn't try it sooner!  ;D

PLEG Basics is intended to provide newcomers with an explanation of how PLEG works and how to use its many features. Each feature is described in detail with examples of how it may be used. The guide is in the form of a pdf document with bookmarks to help with navigation.

Edit: 24/01/2014 09:30 New version attached. Updated to include new features of PLEG V5.6
Edit: 29/01/2014 13:40 New version attached. Updated to include new features of PLEG V5.7
Edit: 12/02/2014 18:00 New version attached. Updated to include new features of PLEG V5.9
Edit: 05/03/2014 11:25 New version attached. Updated to include new features of PLEG V6.2
Edit: 29/01/2015 16:42 New version attached. Updated to include new features of PLEG V7.35
« Last Edit: January 29, 2015, 11:42:42 am by RexBeckett »

Offline flyveleder

  • Full Member
  • ***
  • Posts: 191
  • Karma: +5/-14
Re: PLEG Basics - An Introduction to PLEG
« Reply #1 on: January 02, 2014, 06:14:42 am »
Beautiful work! This is how documentation should be done - always ;-)

Brgds,
Martin

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: PLEG Basics - An Introduction to PLEG
« Reply #2 on: January 02, 2014, 06:30:43 am »
Could not agree more with @flyveleder

Great work, very good manual, even for someone like me who has some understanding of PLEG, it is great just to be able and check things I have not used for a while.

This should be made sticky

Offline Vreo

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +6/-4
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #3 on: January 02, 2014, 11:51:27 am »
Hey Rex, nice PDF! Thanx! I only one to make sure of one thing.
Quote
Remember that PLEG will only perform an evaluation cycle when some Trigger, Device Property or
Schedule has changed and is used in one of the Condition expressions. When an evaluation cycle is
triggered every minute because the special term Now has been used in a sequence expression, the
information displayed by the Status report will not be updated. It is updated when an evaluation
cycle is triggered by a change in a Trigger, Device Property or Schedule.

Does this means that if I have in a PLEG, say a 100 triggers. And in the conditions, I am only using 2 of those, it will only run when any of those two works?? If this is entirely true, it is a very good new, I thought that it run anytime any trigger changes regardless if it is or not in a condition.

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #4 on: January 02, 2014, 06:24:46 pm »
Thanks for the feedback, guys. I appreciate it.   :D

Quote
Does this means that if I have in a PLEG, say a 100 triggers. And in the conditions, I am only using 2 of those, it will only run when any of those two works?? If this is entirely true, it is a very good new, I thought that it run anytime any trigger changes regardless if it is or not in a condition.
PLEG will have to perform some processing when any of its Triggers occur even if it doesn't result in some/any Conditions being evaluated.

I have to ask why you have 100 Triggers defined if you only need two of them?

Offline Vreo

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +6/-4
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #5 on: January 02, 2014, 06:37:46 pm »
I was putting an exagerated example, but let me elaborate more my escenario:

I started with one PLEG and basic stuff months ago. PLEG is so great that now I have 80 conditions that come from like 40 triggers, 5 schedules and 10 properties, all this in one single instance of PLEG. I am going to split those into two or three instances, the way I am planning to do it is explained in this post:

http://forum.micasaverde.com/index.php/topic,18221.msg141083.html#msg141083.

The thing is that when I am done, I will have triggers in each pleg that are not used in that instance, but in the other, and viceversa. So... if the previous quote is true, then I don't have to worry, else, I have to take time to explicitly check wich ones are not used in each instance and delete them.

Thanks!

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #6 on: January 02, 2014, 07:14:08 pm »
You will want to delete them!

Offline Vreo

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +6/-4
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #7 on: January 02, 2014, 07:40:12 pm »
Thansk Richard, I will.

Offline Jeff Lacy

  • Newbie
  • *
  • Posts: 6
  • Karma: +1/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #8 on: January 02, 2014, 08:39:52 pm »
Rex,
     First, just a big Thank You! for taking the time to put the documentation together. As someone new to HA I had been anxious to try PLEG plug ins but felt that I needed some additional understanding of what it could and would do and more so, how to "think like PLEG".  I believe I speak for many who, though they may not bother to mention it, nonetheless feel this was a welcome endeavor.

Richard,
     Again, as someone new to the world of HA and to the forums here on MicasaVerde (MiOS) I want to thank you as well, it doesn't take a long time member to see how much time and effort you spend on the various plug ins and applications as well as being so involved in the forums with helping to answer the many questions uses have, etc.

Offline spudjr

  • Full Member
  • ***
  • Posts: 133
  • Karma: +2/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #9 on: January 02, 2014, 09:33:47 pm »
Thanks for the great write up. Makes some of the fog disappear  :)

Offline aboyer

  • Sr. Newbie
  • *
  • Posts: 45
  • Karma: +0/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #10 on: January 02, 2014, 09:49:59 pm »
Rex,
Just finished reading the PDF. This is great, just finished using it to do some more automation and I planning on implementing the example you have for the Simple Heater Timer. Right now, I have schedules defined using scenes and I was going to  try to figure out how to enable/disable the scenes using PLEG and a virtual switch. Now I don't need to as the that will do exactly what I want.

Thanks for your work on the documentation and Richard's work on the PLEG PlugIn automation is becoming easier (at least for me).
Antonio

Offline bucko

  • Hero Member
  • *****
  • Posts: 659
  • Karma: +27/-9
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #11 on: January 03, 2014, 09:26:49 pm »
@REXBECKETT

Nice work there! I thank you for all your work making this pdf. This is a big help and a great reference tool.

Vera 3, 40+ Fibaro relays & dimmers, IPUX cams, Elk M1 Gold, M1XEP, M1SP, XVOR, M1RB, Elk124, Monoprice HDMI matrix & 6 zone amp, Denon AVR, Panasonic A8000, BI DV,On Controls

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #12 on: January 05, 2014, 08:16:50 am »
Rex,

Just wanted to say great work on the documentation. Hopefully this will help people starting out with pleg and those who did not know some things were possible with pleg.

- Garrett

Offline Theduck38

  • Full Member
  • ***
  • Posts: 124
  • Karma: +7/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #13 on: January 05, 2014, 12:43:49 pm »
I am adding my voice to the multitude saying "great work" !!! This tutorial is very well made and the examples very clear. So thank you very much for this document.

... and once again, thank you Richard for creating such a great plugin !
-- TD38 --
MacPro OSX10.6.8 -- MCV Vera3 - Rfxcom Rfxtrx433 -- Foscam FI8910W - Vision Security ZP-3102 -- Oregon BTHR918 / THGR810(x4) / THN132N - AeonLabs 4in1(x2) - Owl CM180 -- Duwi 05439(x7) -- ARC Plugs Diagral (x3) - Everspring AN157 - Fibaro FGD-211 -- Eaton 650 & 1200 + APC UPS PRO 900

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #14 on: January 05, 2014, 06:45:04 pm »
Quote
... and once again, thank you Richard for creating such a great plugin !
You really must admire a guy who creates a plugin that is so powerful that it takes twenty pages to describe how it works!  8)