PLEG action execution delay?

All, I have a door sensor that triggers lights to turn on when opened. The logic works fine BUT often there is a lengthy delay (from 10-50 seconds or so) before the lights turn on. I have dug through the logs and I think the following is true:

  1. Door Trigger is in the log at the time the door is opened.
  2. PLEG picks it up seconds later and the appropriate condition is true (I also checked the UI and the true time is about the same time as the door sensor trigger).
  3. Seems like PLEG runs the appropriate action(s) [There are two actions – turn on light, and set timer]
  4. 13 seconds later, the job for the PLEG device is actually run – and the lights are turned on.

I have several plugins including vera alerts, iPhone locator, virtual switch and about 15 PLEG logic instances. Is my Vera PLUS just slow?

Another anecdotal observation is it SEEMS that other trigger events (motion) result in the lights turning on instantly (well – a second or two). I also have a similar PLEG setup for another area that behaves the same – the door trigger is delayed but the motion and garage door opener are almost instant.

Attached what I think are the important logs for this scenario. Also attached the full log snippet if anyone feels like digging!

Any ideas on what to look at? I will keep digging but getting a bit beyond my understanding of Vera/PLEG.

Cheers, Tony.

P.S. Love this plugin :-).

So possibly this might be due to overloading PLEG – the door sensor triggers several actions in several PLEGs. I did a grep on the ‘seconds delayed’ message and got the set of PLEG devices the door sensor triggers. There is a fair number all triggered at the same time. Could this be the cause?

Following are all in the logs right after I trigger the door open … The device numbers are all PLEGs that have the door as a trigger.

02 09/26/17 21:31:20.210 JobHandler::Run job#39 : dev:56 (0x24d4ac0) P:50 S:0 Id: 39 is 16.756654000 seconds old <0x77090320>
02 09/26/17 21:31:20.213 JobHandler::Run job#40 : dev:87 (0x22cee68) P:50 S:0 Id: 40 is 16.705344000 seconds old <0x77090320>
02 09/26/17 21:31:20.233 JobHandler::Run job#41 : dev:87 (0x22f6cb0) P:50 S:0 Id: 41 is 16.720027000 seconds old <0x77090320>
02 09/26/17 21:31:20.237 JobHandler::Run job#42 : dev:56 (0x23f4de0) P:50 S:0 Id: 42 is 9.544231000 seconds old <0x77090320>
02 09/26/17 21:31:20.240 JobHandler::Run job#43 : dev:87 (0x1c4e418) P:50 S:0 Id: 43 is 9.165686000 seconds old <0x77090320>
02 09/26/17 21:31:20.251 JobHandler::Run job#44 : dev:87 (0x2340ce0) P:50 S:0 Id: 44 is 9.172489000 seconds old <0x77090320>
02 09/26/17 21:31:20.254 JobHandler::Run job#45 : dev:48 (0x20d55e0) P:50 S:0 Id: 45 is 8.146606000 seconds old <0x77090320>
02 09/26/17 21:31:36.876 JobHandler::Run job#46 : dev:56 (0x1e92b68) P:50 S:0 Id: 46 is 24.748037000 seconds old <0x77090320>
02 09/26/17 21:31:36.879 JobHandler::Run job#47 : dev:56 (0x2402160) P:50 S:0 Id: 47 is 16.667562000 seconds old <0x77090320>
02 09/26/17 21:31:36.910 JobHandler::Run job#48 : dev:87 (0x21d1be0) P:50 S:0 Id: 48 is 16.695604000 seconds old <0x77090320>
02 09/26/17 21:31:36.928 JobHandler::Run job#52 : dev:87 (0x215a8b0) P:50 S:0 Id: 52 is 16.692930000 seconds old <0x77090320>
02 09/26/17 21:31:36.956 JobHandler::Run job#53 : dev:56 (0x217d500) P:50 S:0 Id: 53 is 16.717875000 seconds old <0x77090320>
02 09/26/17 21:31:36.983 JobHandler::Run job#54 : dev:87 (0x212df40) P:50 S:0 Id: 54 is 16.741698000 seconds old <0x77090320>
02 09/26/17 21:31:37.004 JobHandler::Run job#58 : dev:87 (0x213f318) P:50 S:0 Id: 58 is 16.750751000 seconds old <0x77090320>

Chances are that you have a switch that has marginal Z-Wave connectivity and slows everything down … waiting for it to go.

In that case you need to move it to the last … so not others have to wait for it.

Could be. The Vera is in the basement and both switches are at the edge of the house – however, why is there a delay from the switch trigger to the execution of the action? The logs report the open door trigger as soon as I open the door. So I am not sure that there is a delay in the switch reporting a trigger (Can this marginal zwave cause issues in Vera somehow). Am I missing something here.

I am planning on moving the Vera up to the main floor this weekend just to be sure – and anyhow it’ll be a better location for it. I’ll see if it helps at all.

Cheers, Tony.

So I did a quick test and switched to using a Vera scene to turn on lights from the same sensor. The lights turn on the instant the door is opened. Zero delay. Again more pointers to something in PLEG or that PLEG uses that is delayed/queued up.

I can’t do without PLEG but I think for these ‘user visible’ events I’ll switch over to scenes/LUA code for the login I need. Once the lights are on then I’ll manage turning off etc by PLEG.

If anyone has ideas on how to speed up my PLEG setup let me know. I may try using LUA in PLEG instead of the device GUI. Not sure if LUA is a job also or called directly as part of the action … IF directly it may fix the issue?

Cheers, Tony.

You can run a scene from PLEG.

OMG I had no idea until I just saw this that I could trigger a scene directly via PLEG action. #lifechanging hahaha ;D :o

[quote=“twiseva, post:5, topic:197271”]I can’t do without PLEG but I think for these ‘user visible’ events I’ll switch over to scenes/LUA code for the login I need. Once the lights are on then I’ll manage turning off etc by PLEG.
If anyone has ideas on how to speed up my PLEG setup let me know.[/quote]

I sure wouldn’t move them out of PLEG. I would start by optimizing your PLEGs. This can be a bit tricky, but since you are used to looking at the log, that is where you can see how the actions are processing. You seem to have only three PLEGs that have an action associated with the front door - that is an OK number, but I prefer a single trigger only only call one PLEG if possible, a max of two. In my setup, I would only hit two PLEGs when the front door opened, one simply starting a timer for security purposes while the other turned on the light. That said, you have an awful lot of jobs for a single trigger - I would have only two as described. I can see three if you need to start a second timer specific to the light. Timers take virtually no resources, so they don’t really count - if you are really running that many z-wave or IP actions based solely on the door opening, you might need to restructure…

I too am experiencing delays within Pleg when executing actions.
Sorry for threadjacking, but is there a walkthru on how to have PLEG execute a scene?

You must have UI7.
Select PLEG as /The device to be added to the current inteval.
In the Advanced tab you will find RunScene as one of the possible actions.
Scene name or scene number as argument