Vera Issues since switching to PLEG

I was using a lot of scenes and Timers before and switched over to using PLEG which is much nicer and more organized but ever since I have been having issues with Vera’s stability.

Now I may be using PLEG more than I should so this could be a user error. I have moved all my timers into a AutoLights & Timers PLEG instance since I wanted to move all NOW statements into one instance. Below is my PLEG:

Triggers

Name	Description	Last Trigger	State
babyLightOn	 Baby Light Dimmer is turned on	2013-12-10 12:11:25.971	true
isNightTime	 DayNightPlugin indicates Night time.	2013-12-07 17:23:53.123	false
laundryLightOn	 Laundry Room Light is turned on	2013-12-10 07:08:22.424	false
masterToiletLightOn	 Master Bath Toilet Light is turned on	2013-12-08 00:10:50.673	false
masterClosetLightOn	 Master Bath Closet Light is turned on	2013-12-10 07:27:58.725	false
kidsBathLightOn	 Bathroom (kids) - Light is turned on	2013-12-10 07:30:52.245	false
babyLightOff	 Baby Light Dimmer is turned off	2013-12-10 09:36:53.527	false
entryDoorOpen	 Z1 - Entry Doors armed is tripped	2013-12-10 12:12:00.039	true
patioDoorOpen	 Z2 - Patio Door armed is tripped	2013-12-10 12:10:37.016	false
isDayTime	 DayNightPlugin indicates Day time.	2013-12-10 07:07:56.124	true
motionGameRoom	 Game Room Camera Motion Sensor armed is tripped	2013-12-10 12:19:15.396	true
motionBabyRoom	 Baby Camera Motion Sensor armed is tripped	2013-12-10 12:20:49.571	true
patioDoorClosed	 Z2 - Patio Door armed is not tripped	2013-12-10 12:10:42.021	true
motionLivingRoom	 Living Room Camera Motion Sensor armed is tripped	2013-12-10 12:18:52.269	true
livingRoomLightOn	 Living Room Light is turned on	2013-12-10 07:02:30.626	false
breakfastLightOn	 Breakfast Room Light is turned on	2013-12-10 07:02:30.887	false
kitchenLightOn	 Kitchen Light is turned on	2013-12-10 06:53:52.256	false
stairsLightOn	 Living Room Light is turned on	2013-12-10 07:02:30.627	false
motionFrontDoor	 Front Door Camera Motion Sensor armed is tripped	2013-12-10 12:18:44.006	true
Conditions

Name	Expression	Last True	State
turnOffLaundryLight	laundryLightOn;NOW > 300	2013-12-10 07:13:53.102	true
turnOffKidsBathLight	kidsBathLightOn;NOW > 3600	2013-12-10 08:30:53.103	true
turnOffMasterToiletLight	masterToiletLightOn;NOW > 300	2013-12-08 00:16:50.104	true
turnOffMasterCloset	masterClosetLightOn;NOW > 300	2013-12-10 07:33:53.105	true
turnOnBabyLight	babyLightOff; motionBabyRoom > 10	2013-12-10 12:11:25.717	true
turnOffBabyLight	babyLightOn;NOW > 1200	2013-12-10 09:36:53.113	false
turnOnFrontLights	isNightTime	2013-12-07 17:23:53.134	false
turnOffFrontLights	isDayTime	2013-12-08 07:06:31.131	true
resetMotionBaby	motionBabyRoom;NOW > 60	2013-12-10 12:16:53.108	false
resetMotionGameRoom	motionGameRoom;NOW > 60	2013-12-10 12:16:53.113	false
resetMotionFrontDoor	motionFrontDoor; NOW > 120	2013-12-10 08:22:53.110	false
resetMotionLivingRoom	motionLivingRoom; NOW > 120	2013-12-10 12:04:53.113	false
alertEntryDoor	entryDoorOpen AND (entryDoorOpen; NOW > 120)	2013-12-10 12:14:53.113	true
alertBackDoor	patioDoorOpen AND (patioDoorOpen; NOW > 60)	2013-12-05 11:34:33.114	false
alertDogReminder	patioDoorClosed; NOW > 600	2013-12-10 08:59:53.122	false
livingAreaLightsOff	NOT livingRoomLightOn AND NOT kitchenLightOn AND NOT breakfastLightOn AND NOT stairsLightOn	2013-12-10 07:40:34.024	true
autoLivingAreaLightsOn	livingAreaLightsOff AND (motionLivingRoom AND isNightTime)	2013-12-06 19:55:43.514	false
turnOnLivingArea	autoLivingAreaLightsOn	2013-12-06 19:55:43.517	false
turnOffLivingAreaLights	turnOnLivingArea; NOW > 600	2013-12-07 01:11:16.237	true

You can see from the attached image that Vera is always stuck loading this last plugin and is constantly switching from the screen shoot to “Unit is Busy”.

My Vera is a Vera Lite so I may also be pushing the limit of the Vera Lite. Is there a way to find out how many devices you have? I have all lights in my house automated except 3 with ceiling fans, considering using the Insteon FanLink for these.

I do not have a USB Thumbdrive attached for logging but I have unchecked all logging options. Richard, any ideas of what I can do or am I just pushing my Vera Lite to much.

When you say all … I hope you did not uncheck:

Store logs on USB device*

How many Z-Wave device ?
Which Plugins and how many of each ?

[quote=“RichardTSchaefer, post:2, topic:178213”]When you say all … I hope you did not uncheck:

Store logs on USB device*

How many Z-Wave device ?
Which Plugins and how many of each ?[/quote]

I do not have a USB Thumb drive attached to store my logs there so yes it is also unchecked. I am trying to find a spare USB drive to attach to see if it will make any difference, what is the minimum size recommended for the USB drive?

Devices:
I went to http://VeraIP:3480/data_request?id=user_data2&output_format=xml and counted the Device’s under the tree and come up with 68. Is there a better way to get an actually count of all devices, virtual and real?

My Plugins:
1 - Wunderground Weather Plugin
0 - Countdown timer
1 - DSC Alarm Panel Plugin
1 - Wake-on-LAN
1 - System Monitor
2 - Garage Door
1 - Ping Sensor
0 - PLC
3 - PLEG
0 - PLTS
1 - Day or Night
1 - VeraAlerts
1 - OpenSprinkler
1 - VistaCam SD, PT & HD Plugin
1 - VistaCam SD&PT
4 - Foscam IP Camera

You can use an old one … I think it will only use 500MB … no matter what size you install.
When you first start having instability this is the first thing to do.

OK, I found an old 1GB thumb drive from an expo. I will plug it in this evening and report back the results.

Richard

Is there any pro/con to using multiple PLEG for functions, for example one per “room”, as a opposed to a single PLEG to do all the functions?

Right now I’ve been converting Scenes to PLEG for managing motion sensor functions and I’ve used a separate one for each room to make it “easier” to know whats happening rather than a single PLEG for all the motion sensor management.

There are always memory-performance trade offs.
Vera is mostly restricted by memory … So I worry about it more.

There is a significant memory consumption per plugin … this is mostly independent of what the plugin does. (Z-Wave and Insteon devices do not have this cost). So the more plugin instances you have the more memory you use.

However, the more Conditions you put in a PLEG, the more wasted compute cycles each time it has to evaluate the conditions, because many will not participate in the current trigger.

I tend to side on the side of memory (fewer PLEG instances). But If the number of conditions gets large > 30 … than I might consider another PLEG. I also tend to group by functionalitly … i.e. Lighting, Security, Water Management, …

[quote=“RichardTSchaefer, post:7, topic:178213”]There are always memory-performance trade offs.
Vera is mostly restricted by memory … So I worry about it more.

There is a significant memory consumption per plugin … this is mostly independent of what the plugin does. (Z-Wave and Insteon devices do not have this cost). So the more plugin instances you have the more memory you use.

However, the more Conditions you put in a PLEG, the more wasted compute cycles each time it has to evaluate the conditions, because many will not participate in the current trigger.

I tend to side on the side of memory (fewer PLEG instances). But If the number of conditions gets large > 30 … than I might consider another PLEG. I also tend to group by functionalitly … i.e. Lighting, Security, Water Management, …[/quote]

Good information, thanks

OK, I installed the 1GB USB Drive and the logging screen now reads:
Enabled
Mounted: read-write
Usage: 8%
Errors log:
2013-12-11_17:25:00 CHECKDISK: Starting to check device: /dev/sda1 with: /usr/sbin/e2fsck
2013-12-11_17:25:01 (/dev/sda1) : Successfully checked

But the top of my screen is still showing:
“AutoLights & Timers[110] : Running Lua Startup” then after a little while switches back to “unit busy” and the same all over again.

Any ideas?

Can you attach your log ?
Do you have the energy plugin enabled ?

OK, when I woke up this morning Vera was stuck and I couldn’t turn on any lights (The wife was not impressed). I unplugged Vera and replugged it back in and now for the first time the top of the screen is not showing “Running Lua Startup” or “unit busy”. When checking the Log tab it now reads:
Enabled
Mounted: read-write
Usage: 5%
Errors log:
1999-12-31_18:00:01 CHECKDISK: Starting to check device: /dev/sda1 with: /usr/sbin/e2fsck
1999-12-31_18:00:05 (/dev/sda1) : Successfully checked

I’m a little concerned because the year is wrong on the date for the logs. I tried to ssh into /dev/sda1 but I can’t seem to get into the sda1 directory.

And no I do not have the Energy Plugin enabled

Sounds like you have network problems … and that can cause things to backup in Vera as things try to access the network.

i.e. On Vera Boot it gets the Date from Network
It tries to contact the MCV servers for various reasons.
On Vera Startup (Reload)
It tries to contact the MCV servers to see if Any Plugins need to be updated.
It Also sends events out to the MCV Servers

 In addition the Network is needed for Such things as:
      Vera Alerts, Push, Prowl, ...
       Nest
      Weather Underground
      Goolgle Calendar Plugin
      iPhone Location Plugin
      Ping Plugins

It could be that enough of these things are waiting to timeout … that Vera itself gives up.

Make sure you Power Cycle the Vera while the NETWORK is UP!
That’s one reason why people put Vera, Router, Cable Modem … on a UPS.

If you bypass the PLEGs … do the problems go away ?
Can you also email me your status reports.
I want to make sure you do not have any event cycles.

So here is the current status:

  1. Added 1GB USB Drive last night and Vera was frozen this morning.
  2. Rebooted (physically Unplugged) Vera this morning and everything cleared up. Logs had bad dates.
  3. Rebooted (remotely) and everything is clear including correct date on logs.

I will continue to monitor to see what happens. Maybe if I would have Physically rebooted Vera after installing the USB drive last night it would of worked ok.

Edit - 2013.12.12: Another thing I just noticed is that before System Monitor was showing CPU at 50%-70% and today is at 20%.

Edit - 2013.12.13: Its’ now been more than 24 hours since I did the physical reboot then remote reboot and Vera is running better than she has in a long time. System Monitor is showing CPU at 18%, the status menu at the top of the screen is clear and everything is responding quickly. Could this be the improvement in performance you were talking about by using the USB drive for logging?

Edit - 2013.12.15: It looks like I spoke to soon. Yesterday Vera started doing the same thing again. I unplugged Vera and plugged it back in and it worked ok for a while then back to the same. My PLEG still gets stuck on the Running Lua Startup then Unit Busy. I tried to disable the PLEG but it just comes up and says device not ready yet. Any more ideas?

[quote=“Chris H., post:1, topic:178213”]alertBackDoor patioDoorOpen AND (patioDoorOpen; NOW > 60) 2013-12-05 11:34:33.114 false
alertDogReminder patioDoorClosed; NOW > 600 2013-12-10 08:59:53.122 false[/quote]

Sorry if im thread jacking but this seems to be the only active place that my question might get answered

Chris it looks like you might already have done what I want to do since i ran a search for pleg and Dog and you’re the only one that came up. I want to have my patio lights come on when i let my dogs outside after dark (1st door opening) and then turn off when i let the dogs back in (2nd Door opening). Im not familiar with programing or logics so hopefully you already have this setup and can tell me how to do it. Any help is appreciated, thanks

[quote=“Willard311, post:15, topic:178213”][quote=“Chris H., post:1, topic:178213”]alertBackDoor patioDoorOpen AND (patioDoorOpen; NOW > 60) 2013-12-05 11:34:33.114 false
alertDogReminder patioDoorClosed; NOW > 600 2013-12-10 08:59:53.122 false[/quote]

Sorry if im thread jacking but this seems to be the only active place that my question might get answered

Chris it looks like you might already have done what I want to do since i ran a search for pleg and Dog and you’re the only one that came up. I want to have my patio lights come on when i let my dogs outside after dark (1st door opening) and then turn off when i let the dogs back in (2nd Door opening). Im not familiar with programing or logics so hopefully you already have this setup and can tell me how to do it. Any help is appreciated, thanks[/quote]

This could get very confused. Once way I can think is to have it toggle the light each time the door is closed. This way if the light is off and you open the door and close it the PLEG checks to see if the light is off, if so then turn it on. The next time it runs that condition is false so it hits the next one that says if the light is on, turn it off.

[quote=“Chris H., post:14, topic:178213”]So here is the current status:

  1. Added 1GB USB Drive last night and Vera was frozen this morning.
  2. Rebooted (physically Unplugged) Vera this morning and everything cleared up. Logs had bad dates.
  3. Rebooted (remotely) and everything is clear including correct date on logs.

I will continue to monitor to see what happens. Maybe if I would have Physically rebooted Vera after installing the USB drive last night it would of worked ok.

Edit - 2013.12.12: Another thing I just noticed is that before System Monitor was showing CPU at 50%-70% and today is at 20%.

Edit - 2013.12.13: Its’ now been more than 24 hours since I did the physical reboot then remote reboot and Vera is running better than she has in a long time. System Monitor is showing CPU at 18%, the status menu at the top of the screen is clear and everything is responding quickly. Could this be the improvement in performance you were talking about by using the USB drive for logging?

Edit - 2013.12.15: It looks like I spoke to soon. Yesterday Vera started doing the same thing again. I unplugged Vera and plugged it back in and it worked ok for a while then back to the same. My PLEG still gets stuck on the Running Lua Startup then Unit Busy. I tried to disable the PLEG but it just comes up and says device not ready yet. Any more ideas?[/quote]

See above update. I’m wondering if I have to many devices. My next test I guess is to start pulling stuff out of that PLEG and see how Vera runs. I hate to do it since I put a lot of time into getting it working.

How many PLEG/PLTS do you have ?

I just released Version 5.5 … it cuts down on resources needed at startup.

I have no PLTS (uninstalled it) and 3 PLEG, 1 long one that it gets stuck on and 2 small ones. I see my PLEG is now at 5.5.

Is the Long one also the one with the highest Vera Device ID ?
If so you might want to put an Empty PLEG that has a higher Device ID.
Add a simple Input and Condition.
See if it now stops at this one.

If it does … it means it is stopping AFTER all plugins are initialized.