PLEG for Alarm Disarm by Kwikset PIN

I’m trying to configure a PLEG to send the DSC DISARM based on one of several acceptable PIN codes being entered on a KwikSet Lock. The KwikSet Lock and the DSC Alarm Panel are on separate Vera3 units so I’m using LUUP code on the KwikSet Vera to set the DISARM switch on the DSC Vera

I’ve configures a set of TRIGGERS on the KwikSet Vera:
… LockPIN1
… LockPIN2
…etc
… LockPIN9

and a CONDITION
… UnlockByPIN (LocLPIN1 OR LockPIN3 OR LockPIN7) AND AlarmStateArmed

and an Action
… luup.inet.wget(“http://<DSC_VERA_IP_ADDR>:3480/data_request?id=lu_action&DeviceNum=&serviceId=urn:dcineco-com:serviceId:MSwitch1&action=SetStatus8&newStatus8=1”)

The ACTION sets the same MultiSwitch that is set to DISARM the alarm locally and the LUUP works because I can see the switch being set in the UI

Everything appears to work but it sends the DISARM to the other Vera as soon as the ALARM is ARMED, NOT when the PIN code is entered, it appears to be retaining the last time the PIN was entered so when the ARMED is detected it fires. How do I get rid of the “old” PIN code entries so that it will fire off a new entry.

How do I get rid of the "old" PIN code entries so that it will fire off a new entry.

I don’t know that but maybe you don’t need to. You can probably fix it by checking the timing. Something like:

Conditions
AnyPin LockPIN1 OR LockPIN3 OR LockPIN7
UnlockByPin AlarmStateArmed and (AlarmStateArmed; AnyPin)

Also you will want to set “Repeats” for the AnyPin condition.

Rex/Richard

Thanks, you guys are just a plethora of information :slight_smile:

John

Rex/Richard

The good news is your solution did work exactly as intended. The bad news is the whole process is sooooo slow that I can be in the house in front of the TV with a cold one by the time the DISARM command get processed … listening to the alarm going off of course but hey …

So while the solution works it “fails to achieve its intended purpose.” :o Back to the drawing board.

[quote=“clippermiami, post:5, topic:185422”]Rex/Richard

The good news is your solution did work exactly as intended. The bad news is the whole process is sooooo slow that I can be in the house in front of the TV with a cold one by the time the DISARM command get processed … listening to the alarm going off of course but hey …

So while the solution works it “fails to achieve its intended purpose.” :o Back to the drawing board.[/quote]
I also wanted my DSC system to disarm when punching in a code on my Kwikset lock, but I accomplished it using a simple scene rather than PLEG (yes, you can do everything with PLEG, but should you? :slight_smile: ). I don’t know how much overhead the second Vera introduces into your system, but on my Vera lite the delay between punching in my code on the Kwikset and the system disarming is only about five seconds. For what that is worth.

I suspect your issue is that you have separate Vera units. I have been using PLEG to identify a User Code and then act on them depending on the code. It is only 2-3 seconds delay usually. I have each separate User Code be a separate Condition since I act upon them each differently.

I suspect you are right. The actual PIN detection is close to instantaneous, but transferring that to the Alarm Control Vera takes time. I’ve done some further testing and sometimes is very quick, a few seconds, other times it takes over a minute for the transfer and action … by which time the Alarm is tripped :slight_smile: So the only safe thing to do is assume it’s not going to happen quickly enough and manually disarm. So this for not appear to be a viable solution

Agreed, I ran into this issue also two days ago .
where is the timing issue is… Vera itself or when using PLEG?

I will test by creating a separate PLEG device only for door locks to see if the response time becomes constant

[quote=“Aaron, post:9, topic:185422”]Agreed, I ran into this issue also two days ago .
where is the timing issue is… Vera itself or when using PLEG?

I will test by creating a separate PLEG device only for door locks to see if the response time becomes constant[/quote]

I suspect the problem is simply the time to transfer the status. Because its on another Vera the Pleg has to send a LUUP HTTP command to change the status of the DISARM trigger in the “other” Vera and it takes time for that to happen and for the Alarm control PLEG to recognize that the switch has been set.

All in all not a workable solution.

I only have one vera.

[quote=“ibrewster, post:6, topic:185422”][quote=“clippermiami, post:5, topic:185422”]Rex/Richard

The good news is your solution did work exactly as intended. The bad news is the whole process is sooooo slow that I can be in the house in front of the TV with a cold one by the time the DISARM command get processed … listening to the alarm going off of course but hey …

So while the solution works it “fails to achieve its intended purpose.” :o Back to the drawing board.[/quote]
I also wanted my DSC system to disarm when punching in a code on my Kwikset lock, but I accomplished it using a simple scene rather than PLEG (yes, you can do everything with PLEG, but should you? :slight_smile: ). I don’t know how much overhead the second Vera introduces into your system, but on my Vera lite the delay between punching in my code on the Kwikset and the system disarming is only about five seconds. For what that is worth.[/quote]

+1 for simple scene. I extensively use PLEG, but use a simple scene to disarm the alarm after a valid PIN is entered. My disarm is instantaneous.

[quote=“wilme2, post:12, topic:185422”][quote=“ibrewster, post:6, topic:185422”][quote=“clippermiami, post:5, topic:185422”]Rex/Richard

The good news is your solution did work exactly as intended. The bad news is the whole process is sooooo slow that I can be in the house in front of the TV with a cold one by the time the DISARM command get processed … listening to the alarm going off of course but hey …

So while the solution works it “fails to achieve its intended purpose.” :o Back to the drawing board.[/quote]
I also wanted my DSC system to disarm when punching in a code on my Kwikset lock, but I accomplished it using a simple scene rather than PLEG (yes, you can do everything with PLEG, but should you? :slight_smile: ). I don’t know how much overhead the second Vera introduces into your system, but on my Vera lite the delay between punching in my code on the Kwikset and the system disarming is only about five seconds. For what that is worth.[/quote]

+1 for simple scene. I extensively use PLEG, but use a simple scene to disarm the alarm after a valid PIN is entered. My disarm is instantaneous.[/quote]

Your suggestion points me in the direction of a probably better solution.

The core problem I have is that the :KwikSet and the DSC are on two different Veras. So I’ve been using LUUP in the KwikSet Vera to set a semaphore in the DSC Vera using HTTP, in fact the same semaphore that is set by the local disarm from my Imperihome control panel. The ImperiHome disarm is works fine because the ImperiHome talks directly to the DSC Vera. I suspect the major problem is in the transfer of the command between the two Veras.

So it occurs to me to use the LUUP from the KwikSet Vera to disarm the DSC directly. But I don’t know the HTTP commands for DISARM to the DSC device. Can anyone point me to them?

luup.inet.wget(“http://3480/data_request?id=lu_action&DeviceNum=&serviceId=urn:schemas-micasaverde-com:device:AlarmPartition:2&action=???”)

State=Disarmed
PINCode=NNNNNNN

Thanks

I have zero experience with bridged veras, but if you can see the DSC device on the vera with the locks, in the scene you would go to Advanced tab, select the device, and then RequestArmMode, and then you get a box to fill in state “Disarmed” as well as the PIN to use. No Lua/Luup needed…

If your Veras are not bridged, I am not sure how to send the disarm via HTTP…

They are not bridged, I beat that horse to death for several months and finally gave up.

So now all the communication between them use LUUP to send HTTP commands to set switches, semaphore, etc. Hence the idea of using a semaphore to solve this problem. But the idea of sending the command directly to the DSC device rather than a semaphore might just improve the execution time to the point where it would be usable.

[quote=“clippermiami, post:1, topic:185422”]I’m trying to configure a PLEG to send the DSC DISARM based on one of several acceptable PIN codes being entered on a KwikSet Lock. The KwikSet Lock and the DSC Alarm Panel are on separate Vera3 units so I’m using LUUP code on the KwikSet Vera to set the DISARM switch on the DSC Vera

I’ve configures a set of TRIGGERS on the KwikSet Vera:
… LockPIN1
… LockPIN2
…etc
… LockPIN9

and a CONDITION
… UnlockByPIN (LocLPIN1 OR LockPIN3 OR LockPIN7) AND AlarmStateArmed

and an Action
… luup.inet.wget(“http://<DSC_VERA_IP_ADDR>:3480/data_request?id=lu_action&DeviceNum=&serviceId=urn:dcineco-com:serviceId:MSwitch1&action=SetStatus8&newStatus8=1”)

The ACTION sets the same MultiSwitch that is set to DISARM the alarm locally and the LUUP works because I can see the switch being set in the UI

Everything appears to work but it sends the DISARM to the other Vera as soon as the ALARM is ARMED, NOT when the PIN code is entered, it appears to be retaining the last time the PIN was entered so when the ARMED is detected it fires. How do I get rid of the “old” PIN code entries so that it will fire off a new entry.[/quote]

ClipperMiami:

Can you expand on how you accomplished this with the kwikset Pin codes and PLEG, I would like to also do this. Thanks!

[quote=“MrAutomate, post:16, topic:185422”][quote=“clippermiami, post:1, topic:185422”]I’m trying to configure a PLEG to send the DSC DISARM based on one of several acceptable PIN codes being entered on a KwikSet Lock. The KwikSet Lock and the DSC Alarm Panel are on separate Vera3 units so I’m using LUUP code on the KwikSet Vera to set the DISARM switch on the DSC Vera

I’ve configures a set of TRIGGERS on the KwikSet Vera:
… LockPIN1
… LockPIN2
…etc
… LockPIN9

and a CONDITION
… UnlockByPIN (LocLPIN1 OR LockPIN3 OR LockPIN7) AND AlarmStateArmed

and an Action
… luup.inet.wget(“http://<DSC_VERA_IP_ADDR>:3480/data_request?id=lu_action&DeviceNum=&serviceId=urn:dcineco-com:serviceId:MSwitch1&action=SetStatus8&newStatus8=1”)

The ACTION sets the same MultiSwitch that is set to DISARM the alarm locally and the LUUP works because I can see the switch being set in the UI

Everything appears to work but it sends the DISARM to the other Vera as soon as the ALARM is ARMED, NOT when the PIN code is entered, it appears to be retaining the last time the PIN was entered so when the ARMED is detected it fires. How do I get rid of the “old” PIN code entries so that it will fire off a new entry.[/quote]

ClipperMiami:

Can you expand on how you accomplished this with the kwikset Pin codes and PLEG, I would like to also do this. Thanks![/quote]

I gave it up, it just wasn’t fast enough to disarm the alarm in time

ClipperMiami - Thanks. I hear that . Lag with Multiple vera’s is an issue.

Can anyone tell me more about how the PIN codes work in PLEG . I am not spanning multiple Vera’s for my lock, and will use the pin codes for voice alerts / non critical functions. Thanks All.

Here is what intrigued me, but need some more details using PLEG…Was this actual Luup coding, or an example

"I’ve configures a set of TRIGGERS on the KwikSet Vera:
… LockPIN1
… LockPIN2
…etc
… LockPIN9

and a CONDITION
… UnlockByPIN (LocLPIN1 OR LockPIN3 OR LockPIN7) AND AlarmStateArmed

and an Action
… luup.inet.wget(“http://<DSC_VERA_IP_ADDR>:3480/data_request?id=lu_action&DeviceNum=&serviceId=urn:dcineco-com:serviceId:MSwitch1&action=SetStatus8&newStatus8=1”) "

I attached a pic, there are numerous properties available, and wondered if this is how it might be done, or do I need to set a trigger for each pin code.

There is a problem with LockPins … The last one always stays true until a new one is entered.

How I solve this is I have a condition:

AnyLockPin LockPin1 OR LockPin2 OR … LockPinN
UnLockByPin AnyLockPin and AlarmStateArmed

For the Actions for AnyLockPin … I have a 1 minute delayed action that uses a PLEG action.
Create a 1 minute delayed action, and select it.
Goto the Advanced Tab and add:
Device: Your PLEG
Action: SetVariable
ServiceId: urn:micasaverde-com:serviceId:DoorLock1
VariableName: sl_UserCode
Value:
Device: 49

Value is BLANK, Device is the DeviceID of your Lock

[quote=“RichardTSchaefer, post:19, topic:185422”]There is a problem with LockPins … The last one always stays true until a new one is entered.

How I solve this is I have a condition:

AnyLockPin LockPin1 OR LockPin2 OR … LockPinN
UnLockByPin AnyLockPin and AlarmStateArmed

For the Actions for AnyLockPin … I have a 1 minute delayed action that uses a PLEG action.
Create a 1 minute delayed action, and select it.
Goto the Advanced Tab and add:
Device: Your PLEG
Action: SetVariable
ServiceId: urn:micasaverde-com:serviceId:DoorLock1
VariableName: sl_UserCode
Value:
Device: 49

Value is BLANK, Device is the DeviceID of your Lock[/quote]

Yes, I should note that Richard noticed this problem in my initial configuration and proposed this as a solution which I subsequently used. It worked perfectly but as I said the delay to actually disarm was simply too long so I dropped it.