[PLEG] Need assitance with Occupancy & Security scene

I’m trying to create a single PLEG to handle Occupancy & Security - all variations

Likely my misunderstanding of how PLEG works is causing me issues.

  1. I have multiple conditions… when I set Actions, if I’ve used a Device in another action it will not allow me to use it again? Event when trying to use Advanced. It does not save anything I add.

I’m using a few Variable Containers to store the states of occupancy. I will use Virtual Switches (and later Scenes) to be triggered by NFC to tell Vera when we are entering/exiting and by what entryway (LR, FD, etc)

Sorry I am not able to duplicate …
I am able to put the same device (using the advanced TAB) in the same action
and in other actions.

Richard,
I fixed it, but it was strange.

Out of the 5 Conditions only two had a problem. After a reboot, only one had a problem. The Action would not add ANY device - but the other Actions were fine.

I deleted the Action and re-added it… it now works.

I suspect this is not a PLEG issue… Vera OS is just crappy.

Sorry to post a false alarm.

I’m working on the syntax now… I think I’m getting the hang of it but I may have some questions soon.

thx

Richard,
I ran into this again on a brand new, never used, PLEG device.

I have almost nothing in it…

Reset NFC vSwitches Device ID: 1772013-11-09 13:44:29.338 PLC Version: 5.2 Triggers Name Description Last Trigger State Aaron_nfc_FD Aaron_nfc_FD is turned on 2013-11-09 12:50:21.513 false Aaron_nfc_LR Aaron_nfc_LR is turned on 0 false Conditions Name Expression Last True State ON Aaron_nfc_FD or Aaron_nfc_LR 2013-11-09 12:50:21.514 false

… when I try to add Actions nothing saves when I select Finished.

I tried it 4 times… only after I selected the 2 original devices (not related to any devices I had problems with in the other PLEG device), selected Finished, went back into Actions and selected another different device did it save the devices in the config.

There is some sort of bug is going on here…

Can you use Chrome ?
Before saving …
Put mouse in Window.
Type “Control Shift I” at the same time.
This opens the developers tools. Select the console tab.
Now do your “finished” and see if there are any error messages there.

Next time I need to build a PLEG device I will since I spent 3 hours today, on 30 minutes of actual work) getting this one going. I had to create the device 3 times… the first one had a bug I could not kill (would not set a Variable Container value to true) - I built another and after re inputting everything, it only saved the triggers! The third one finally worked properly.

I’m quickly tiring of the all the Vera issues - and I don’t do anything that complex.

Made a small addition to the PLEG, and used Chrome. The Action itself is being saved when created, no problem.

Problem: new Actions added are only partly being competed. Setting a virtual device works fine, setting a Variable Container variable value is not being set - by either action. The PLEG state/status is accurate, looks like the settings are failing.

console output…

triggering the Action programtically…

2013-11-10 18:56:47: start parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:47: Starting parseLu. cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:47: 11:56:47:890 end parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:49: start parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:49: Starting parseLu. cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:49: 11:56:49:215 end parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:53: start parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:53: Starting parseLu. cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:53: setting icon error: TypeError: Cannot read property 'Service' of undefined cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:53: 11:56:53:486 end parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:54: start parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:54: Starting parseLu. cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:54: setting icon error: TypeError: Cannot read property 'Service' of undefined cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:54: setting icon error: TypeError: Cannot read property 'Service' of undefined cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:56:54: 11:56:54:651 end parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:57:01: start parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:57:01: Starting parseLu. cpanel_data.js?*1.5.622-1-07054035*:13652 2013-11-10 18:57:01: 11:57:1:603 end parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652

Manually changing (vera web page) the variable value…

2013-11-10 19:01:17: add keep cpanel_data.js?*1.5.622-1-07054035*:13652
2013-11-10 19:01:25: start parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652
2013-11-10 19:01:25: Starting parseLu. cpanel_data.js?*1.5.622-1-07054035*:13652
2013-11-10 19:01:25: 12:1:25:867 end parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652
Uncaught TypeError: Cannot read property 'style' of null J_VContainer.js:74
2013-11-10 19:01:26: start parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652
2013-11-10 19:01:26: Starting parseLu. cpanel_data.js?*1.5.622-1-07054035*:13652
2013-11-10 19:01:26: setting icon error: TypeError: Cannot read property 'Service' of undefined cpanel_data.js?*1.5.622-1-07054035*:13652
2013-11-10 19:01:26: 12:1:26:960 end parsing lu_status cpanel_data.js?*1.5.622-1-07054035*:13652

PLEG device status report (Occupancy Logic)…

Device ID: 1822013-11-10 12:03:30.622 PLC Version: 5.2

Triggers

Name	Description	Last Trigger	State
Aaron_NFC_FD	 Aaron_NFC_FD is turned on	2013-11-09 16:10:58.029	false
Aaron_NFC_LR	 Aaron_NFC_LR is turned on	2013-11-09 17:29:39.063	false
Robyn_NFC_FD	 Robyn_NFC_FD is turned on	0	false
Robyn_BT_Home	 Robyn_BT_home is turned on	2013-11-10 12:03:52.109	true
Robyn_BT_Car	 Robyn_BT_Car is turned on	2013-11-10 11:57:38.072	false
Robyn_NFC_LR	 Robyn_NFC_LR is turned on	0	false
Robyn_BT_Home_off	 Robyn_BT_home is turned off	2013-11-10 11:57:37.993	false
Device Properties

Name	Device Name	Device Variable	Last Change	Value
Occupied	Occupancy variables	Variable1	2013-11-09 16:09:58.826	yes
Aaron	Occupancy variables	Variable2	2013-11-09 17:29:39.430	home
Robyn	Occupancy variables	Variable3	2013-11-10 12:02:08.943	away
Guests	Occupancy variables	Variable4	0	false
Family	Occupancy variables	Variable5	0	false
Conditions

Name	Expression	Last True	State
WhoIsHome	(Aaron eq 'home') or (Robyn eq 'home')	2013-11-09 17:29:39.449	true
Aaron_exitLR	(Aaron eq 'home') and Aaron_NFC_LR	2013-11-09 16:33:44.345	false
Aaron_exitFD	(Aaron eq 'home') and Aaron_NFC_FD	2013-11-09 16:10:06.943	false
Aaron_enterFD	(Aaron eq 'away') and Aaron_NFC_FD	2013-11-09 16:10:58.048	false
Aaron_enterLR	(Aaron eq 'away') and Aaron_NFC_LR	2013-11-09 17:29:39.075	false
Robyn_Away	Robyn_BT_Home_off	2013-11-10 11:57:38.010	false
Robyn_Home	Robyn_BT_Home	2013-11-10 12:03:52.124	true
All_Away	(Aaron eq 'away') and (Robyn eq 'away')	0	false
Actions

Actions for Condition: All_Away

Immediate

Device	Action	Arguments
Occupancy Logic	RunScene	 SceneNameOrNumber=Away
Occupancy variables	SetVariable1	 newVariable1=no
Actions for Condition: Aaron_exitFD

Immediate

Device	Action	Arguments
Front Door Lock	SetTarget	 newTargetValue=1
Occupancy variables	SetVariable2	 newVariable2=away
Actions for Condition: Aaron_exitLR

Immediate

Device	Action	Arguments
Occupancy variables	SetVariable2	 newVariable2=away
Laundry Door Lock	SetTarget	 newTargetValue=1
Actions for Condition: Aaron_enterFD

Immediate

Device	Action	Arguments
Front Door Lock	SetTarget	 newTargetValue=0
Occupancy Logic	RunScene	 SceneNameOrNumber=Stay Non-Secure
Occupancy variables	SetVariable2	 newVariable2=home
Actions for Condition: Aaron_enterLR

Immediate

Device	Action	Arguments
Laundry Door Lock	SetTarget	 newTargetValue=0
Occupancy Logic	RunScene	 SceneNameOrNumber=Stay Non-Secure
Occupancy variables	SetVariable2	 newVariable2=home
Actions for Condition: WhoIsHome

Immediate

Device	Action	Arguments
Occupancy variables	SetVariable1	 newVariable1=yes
Actions for Condition: Robyn_Home

Immediate

Device	Action	Arguments
Robyn_BT_Car	SetTarget	 newTargetValue=0
Occupancy variables	SetVariable3	 newVariable3=home
Actions for Condition: Robyn_Away

Immediate

Device	Action	Arguments
Robyn_BT_Car	SetTarget	 newTargetValue=1
Occupancy variables	SetVariable3	 newVariable3=away