Program Logic Event Generator (PLEG)
Author: RichardTSchaefer
Manufacturer: RTS Services
Price: free
License Fee may be needed. PLEG provides a SUPER SCENE capability allowing you to specify inputs, condition expressions to implement your logic, and associate actions;a set of commands to be executed, or scenes to run, with these conditions to control your other devices and plugins. You can define multiple, complex, condition expressions, and each with it's own set of actions, and/or notifications. Condition expressions may be a combination of triggers, schedules, device properties or other conditions with a full set of boolean, numeric, and string operators, a sequence (optionally ordered) of triggers, schedules, or conditions within a specified interval, a count of currently valid triggers or conditions, or multiple occurrences of the same trigger or condition within the specified interval. For details see: and on the forums at:,48.0.html UI5 and UI6 Development is frozen.
The Gold Standard for Home Automation
RexBeckett | 31.01.2013 Rating:
This plugin (PLEG) is an absolutely essential component for a home automation system. If you haven't tried it yet, invest a few minutes in reading the notes then install it and start playing. If you can conceive of a set of circumstances for which you want some action, PLEG can make it happen for you - and you don't need to learn how to write Lua.

This is a powerful plugin and, at first glance, it may seem complicated but it really isn't. You just take a few easy steps...

First you define your inputs - just about anything in your system that has a state or a value. Times, temperatures, wind-speed, battery condition, on, off, firmware version, ... You name it and it can probably be used as an input.

Then you can set up schedules and timers - by day, by date, by time, by George!

Now you specify your rules as simple but powerful condition statements that can refer to your inputs, schedules, calculations and even other conditions! Simple can be like: (Light-switch is on). More tricky could be: (PIR tripped less than 45 seconds before wind-speed exceeded 30 MPH but more than two hours after the gate was shut - but only on a Saturday unless...). You can write multiple conditions and, as each can refer to previous ones, you don't need to repeat logic and calculations which makes changes easier and can avoid many a bug!

Finally you define the actions that you want to result from a condition becoming true (or false). Actions can be set just like scenes but with many more possibilities. Actions can turn devices on or off or change a value - say the set-point of a thermostat or the polling frequency of your anemometer. You can have multiple actions for each condition and they can do amazing things. You can even specify an action to delete one of your devices but I haven't found a use for that yet. It is tempting, though, to point it at my 4 in 1 sensor. :)

PLEG's author really understands practical automation and has designed-in resilience to system restarts. If you've ever tried implementing that in normal automation logic then you'll know how valuable the feature is. If you haven't, don't worry - just use PLEG!

In case it isn't obvious yet, I think you should install this plugin and start simplifying your automation system now! Get rid of all those weird little scenes, odd timers and virtual switches. Replace them with easily understandable rules (conditions). It will make it so much easier when you add a new device or want to change some timer or sequence.

PLEG could probably encapsulate your entire home automation logic in a single instance although it may be easier to follow if you split it up and have one PLEG device for each major task. Because each instance can refer to the conditions of its brother devices, you don't need to have multiple versions of the same rule or calculation. This makes the inevitable changes so much easier and much less prone to bugs.

Install PLEG and put the fun back into automation. You will wonder how you ever managed without it!