I’m loving using PLEG for scene automation as not only can it do all the conditional logic but its also cleaner and quicker than creating a bunch of scenes. It’s great!
I have a question though - is there any limit to the number of triggers and conditions you can put in a single instance of PLEG? I am wondering for performance issues what works best. I mean, theoretically you could have a number of unrelated triggers, conditions and actions in a single PLEG.
Anyone have thoughts on this?
An example of what I mean is that I have 4 rooms that I have light timers on (RoomOn; Now > 10:00) that I have set up in a single PLEG. Before this was 2 scenes and a countdown timer for each. But might this bog down?
Scene’s are fairly light weight.
A device (Plugin or ZWave) is heavy weight … Each device eats up a lot of memory … the primary limiting performance factor on Vera.
Collapsing multiple Countdown timers into a single PLEG device will give the biggest gain.
The PLEG that runs my heating has twelve triggers, three device properties, fifteen schedules, sixteen condition statements and twelve actions. It doesn’t seem to have much impact on Vera (Lite) performance - according to SystemMonitor. The logic in this PLEG would have required a considerable amount of Luup to implement in a scene - and debugging would have been a nightmare. :o It would also have been a real challenge to program around the way that scene schedules get destroyed by Luup restarts.
FWIW, my advice is to group logic into PLEG devices according to common time schedule requirements. This means that, if you want to change the schedules, they are all in one place. I have all my heating controls in one PLEG, all my lighting controls in another, etc. I don’t think it is very likely that you’ll overload PLEG in a normal-sized house. ;D
I’m running into a problem when using multiple triggers on the same device. Specifically, if I have more that two Event Types.
For example:
On a door lock, if I create a trigger for a PIN code, a lock failure, and a PIN code change, the third one either won’t be be accepted as a trigger (it just disappears) or will be accepted but will generate an INVALID TOKEN.
On a thermostat, I create a trigger for the Energy Mode, Ambient Temperature, and Cool Mode set point. Similar issues.
Can someone else try this and see if you get the same behavior?
@RichardTSchaefer,
Can you take a look at this? I’m getting invalid token errors if I create triggers from 3 unique event types from the Kwikset lock.
Triggers
Name Description
tFront1 PIN Code #1 is entered on Front Door
tFrontFail Front Door: Lock fails to operate
tFrontPinChange Front Door: A code was changed using the lock keypad
Conditions
Name Expression
FrontUnlock tFront1
FrontLockFail tFrontFail
FrontPINChange tFrontPinChange
When I enter this into a PLEG, I get an invalid token for tFrontPinChange. If I delete that third unique trigger, I can add lots of triggers for different PIN codes being entered on the same lock. I only get the error when I use 3 different event types.
If I try using 3 unique event types with a Trane thermostat, I get a Startup Lua Failed error for this PLEG. Again, deleting the 3rd unique event type clears up the problem.
Triggers
Name Description
tMode Downstairs Thermostat is turned off
tAmbient Downstairs Thermostat ambient temperature goes above 80 degrees
tBattery Battery level for Downstairs Thermostat goes below 25%
Conditions
Name Expression
ModeOff tMode
AmbientHigh tAmbient
BatteryLow tBattery
Can you reproduce this on your end?
I tried on a Schlage lock and Trane thermostat … no problems.
Have you moved to 1.5.622 yet ? I have … this code uses some MCV code for notifications.
It may be a bug in their code.
I could not create some input events for things that my Trane or Schlage lock does not support. I used the same input names as you as well.
Please set Debug to 1 in the Advanced tab … and send me the log from a startup …
That should show the error since the conditions are evaluated at startup.
Well I guess it’s a delayed problem … I have the error this morning … So I will dig in and find out what is happening.
I don’t know if I should say that it is good news…but I am glad that it wasn’t me overlooking something simple.
Well it turns out the problem has nothing to do with 3 distinct trigger types.
It have everything to do with the type of events that were used. For Events that do NOT have any arguments like:
Front Door: A code was changed using the lock keypad
I will post a patch shortly.
Thank you for chasing this down so quickly. I’m patched and it’s now working over here. I really appreciate your work on PLxx - it’s a huge asset to the Vera community.