ad2usb plugin discussion

Posted on
Fri May 25, 2018 6:37 pm
wikner offline
Posts: 173
Joined: Nov 02, 2003

Re: ad2usb plugin discussion

Sorry, I did not send all the output. Here are 2 more events with complete output.
Code: Select all
May 25, 2018 at 6:22:04 PM
   AD2USB Alarm Interface Error    panelMsgRead: Zone Event test:117
   AD2USB Alarm Interface          Zone Event test - rawData: [0000000100000000----],105,[f707000400058000080200000d0000],"FAULT 05 MOTION DINING ROOM     "

   AD2USB Alarm Interface          Zone Event test - msgBitMap: 0000000100000000----
   AD2USB Alarm Interface          Zone Event test - msgZoneNum: 105
   AD2USB Alarm Interface          Zone Event test - msgText: "FAULT 05 MOTION DINING ROOM     "

   AD2USB Alarm Interface          Zone Event test - msgKey: FAULT
   AD2USB Alarm Interface          Zone Event test - panelDevice: address : Keypad 18
batteryLevel : None
buttonGroupCount : 0
configured : True
description :
deviceTypeId : ad2usbInterface
displayStateId : displayState
displayStateImageSel : SensorOn
displayStateValRaw : faulted
displayStateValUi : Fault
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 72533294
globalProps : MetaProps : (dict)
     com.berkinet.ad2usb : (dict)
          address : Keypad 18 (string)
          isAdvanced : false (bool)
          numPartitions : 1 (integer)
          panelKeypadAddress : 18 (string)
          panelPartitionNumber : 1 (string)
id : 675649852
lastChanged : 2018-05-25 18:20:42
lastSuccessfulComm : 2018-05-25 18:20:42
model : ad2usb Keypad
name : Alarm Keypad
ownerProps : com.berkinet.ad2usb : (dict)
     address : Keypad 18 (string)
     isAdvanced : false (bool)
     numPartitions : 1 (integer)
     panelKeypadAddress : 18 (string)
     panelPartitionNumber : 1 (string)
pluginId : com.berkinet.ad2usb
pluginProps : com.berkinet.ad2usb : (dict)
     address : Keypad 18 (string)
     isAdvanced : false (bool)
     numPartitions : 1 (integer)
     panelKeypadAddress : 18 (string)
     panelPartitionNumber : 1 (string)
protocol : Plugin
remoteDisplay : True
states : States : (dict)
     LCDLine1 : FAULT 05 MOTION  (string)
     LCDLine2 : DINING ROOM      (string)
     acPower : 1 (string)
     alarmBellOn : 0 (one/zero bool)
     alarmOccurred : 0 (one/zero bool)
     alarmedZone : n/a (string)
     armedMode : unArmed (string)
     armedMode.armedAway : false (bool)
     armedMode.armedInstant : false (bool)
     armedMode.armedMax : false (bool)
     armedMode.armedStay : false (bool)
     armedMode.unArmed : true (bool)
     batteryLow : 0 (one/zero bool)
     checkZones : 0 (one/zero bool)
     chimeMode : 0 (string)
     displayState : faulted (string)
     displayState.ui : Fault (string)
     fireAlarm : 0 (one/zero bool)
     lastChgAt : 2018-05-22 19:46:10 (string)
     lastChgBy : unknown (string)
     lastChgTo : ALARM_TRIPPED (string)
     panelArmed : 0 (string)
     panelReady : 0 (string)
     panelState : Fault (string)
     panelState.Fault : true (bool)
     panelState.armedAway : false (bool)
     panelState.armedStay : false (bool)
     panelState.ready : false (bool)
     programMode : 0 (string)
     zoneFaultList : [2, 3, 4, 5, 8, 19, 29, 102, 103, 104, 105, 108] (string)
     zonesBypassed : 0 (string)
subModel :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : False
version : None
   AD2USB Alarm Interface Error    panelMsgRead: Zone Event test:117
   AD2USB Alarm Interface          Zone Event test - rawData: [1000000100000000----],005,[f70700040005801c08020000000000],"LELA AND NORMAN   READY TO ARM  "

   AD2USB Alarm Interface          Zone Event test - msgBitMap: 1000000100000000----
   AD2USB Alarm Interface          Zone Event test - msgZoneNum: 5
   AD2USB Alarm Interface          Zone Event test - msgText: "LELA AND NORMAN   READY TO ARM  "

   AD2USB Alarm Interface          Zone Event test - msgKey: LELA
   AD2USB Alarm Interface          Zone Event test - panelDevice: address : Keypad 18
batteryLevel : None
buttonGroupCount : 0
configured : True
description :
deviceTypeId : ad2usbInterface
displayStateId : displayState
displayStateImageSel : SensorTripped
displayStateValRaw : enabled
displayStateValUi : Ready
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 72533294
globalProps : MetaProps : (dict)
     com.berkinet.ad2usb : (dict)
          address : Keypad 18 (string)
          isAdvanced : false (bool)
          numPartitions : 1 (integer)
          panelKeypadAddress : 18 (string)
          panelPartitionNumber : 1 (string)
id : 675649852
lastChanged : 2018-05-25 18:22:04
lastSuccessfulComm : 2018-05-25 18:22:04
model : ad2usb Keypad
name : Alarm Keypad
ownerProps : com.berkinet.ad2usb : (dict)
     address : Keypad 18 (string)
     isAdvanced : false (bool)
     numPartitions : 1 (integer)
     panelKeypadAddress : 18 (string)
     panelPartitionNumber : 1 (string)
pluginId : com.berkinet.ad2usb
pluginProps : com.berkinet.ad2usb : (dict)
     address : Keypad 18 (string)
     isAdvanced : false (bool)
     numPartitions : 1 (integer)
     panelKeypadAddress : 18 (string)
     panelPartitionNumber : 1 (string)
protocol : Plugin
remoteDisplay : True
states : States : (dict)
     LCDLine1 : LELA AND NORMAN  (string)
     LCDLine2 :   READY TO ARM   (string)
     acPower : 1 (string)
     alarmBellOn : 0 (one/zero bool)
     alarmOccurred : 0 (one/zero bool)
     alarmedZone : n/a (string)
     armedMode : unArmed (string)
     armedMode.armedAway : false (bool)
     armedMode.armedInstant : false (bool)
     armedMode.armedMax : false (bool)
     armedMode.armedStay : false (bool)
     armedMode.unArmed : true (bool)
     batteryLow : 0 (one/zero bool)
     checkZones : 0 (one/zero bool)
     chimeMode : 0 (string)
     displayState : enabled (string)
     displayState.ui : Ready (string)
     fireAlarm : 0 (one/zero bool)
     lastChgAt : 2018-05-22 19:46:10 (string)
     lastChgBy : unknown (string)
     lastChgTo : ALARM_TRIPPED (string)
     panelArmed : 0 (string)
     panelReady : 1 (string)
     panelState : ready (string)
     panelState.Fault : false (bool)
     panelState.armedAway : false (bool)
     panelState.armedStay : false (bool)
     panelState.ready : true (bool)
     programMode : 0 (string)
     zoneFaultList : [2, 3, 4, 5, 8, 19, 29, 102, 103, 104, 105, 108] (string)
     zonesBypassed : 0 (string)
subModel :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : False
version : None

Posted on
Tue May 29, 2018 3:42 am
berkinet offline
User avatar
Posts: 3133
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: ad2usb plugin discussion

wikner wrote:
Sorry, I did not send all the output. Here are 2 more events with complete output.[code]May 25, 2018 at 6:22:04 PM
AD2USB Alarm Interface Error panelMsgRead: Zone Event test:117
AD2USB Alarm Interface Zone Event test - rawData: [0000000100000000----],105,[f707000400058000080200000d0000],"FAULT 05 MOTION DINING ROOM "...

I have looked through all your data and I really cannot find out where there are any issues in the code other than it just isn't prepared to deal with having two separate zone numbers for some of your zones. Eg. 5 and 105. The reason the test version works at all is because it is trapping the errors generated by the non-exiatant zones. But, though it traps the error, it doers not have the data necessary to track the zones.

The only thing I can suggest, other than getting your panel program fixed, is to try the Advanced mode. However, that is complicated and hard to set up. But, it might work. See this guide for instructions. Note the guide is not up to date. But, the instructions on advanced mode should still be accurate.
https://drive.google.com/open?id=1sZAvU ... wQHsH70J4v

Posted on
Tue May 29, 2018 7:01 pm
wikner offline
Posts: 173
Joined: Nov 02, 2003

Re: ad2usb plugin discussion

berkinet wrote:
The only thing I can suggest, other than getting your panel program fixed, is to try the Advanced mode. However, that is complicated and hard to set up. But, it might work. See this guide for instructions. Note the guide is not up to date. But, the instructions on advanced mode should still be accurate.
https://drive.google.com/open?id=1sZAvU ... wQHsH70J4v


Well, my problem, which seems unique to me (unless somebody else chimes in) is that either the alarm panel itself or the Alarm Decoder interface is randomly including (or not) a "1" as the first digit of the zone number. So the same zone, xx, (where "xx" is the zone number; I don't have any 3-digit zones) sometimes reads out as 0xx and sometimes as 1xx. Although advanced mode might solve this, I have my doubts. As you say ,that might be complicated. It actually seems easier for me to hack your Python code so that it ignores the first digit when looking up the zone numbers. Your code is very long, so I may miss something, but there seem to be only 5 or 6 places where you parse the zone number. I'm going to give it a try.

Posted on
Thu May 31, 2018 4:12 pm
wikner offline
Posts: 173
Joined: Nov 02, 2003

Re: ad2usb plugin discussion

Time will tell, but I believe I have had success. I spent many hours reading your code, and finally decided to do this:
After line 563 of ad2usb.py I inserted the following:
Code: Select all
         # Need to ensure that the first digit in the Zone number is a zero; this is at character position 23
            rawData = rawData[:23]+'0'+rawData[24:]

(I had the devil of a bug due to the fact that your text editor indents with spaces and mine indents, by default, with tabs. The comment and code lines, above, appear to have the same indentation in BBEdit. So I kept getting IndentationError: ('unexpected indent'... errors until I finally realized the problem and converted my tabs to spaces.)

Next I deleted 1.6.2 and bumped the version number to 1.6.2.1 so Indigo would load it. I also deleted all of the "phantom" zones with zone numbers greater than 99. For the past hour zones have been faulting and clearing as expected and there have been no "Zone Event test" errors. I did initially get several (6) of these:
Code: Select all
   AD2USB Alarm Interface Error    updateIndigoBasicMode: updateZoneGroups Error: 'key displayState.ui not found in dict'
   AD2USB Alarm Interface          Zone: 41 - Motion Basement state changed to: (Faulted)
   Z-Wave                          received "009 - Garage Door Lock (BE369/468/469)" status update locked (manually)
   AD2USB Alarm Interface          Zone: 2 - Motion Living Room  state changed to: (Faulted)
   AD2USB Alarm Interface Error    updateIndigoBasicMode: updateZoneGroups Error: 'key displayState.ui not found in dict'
   AD2USB Alarm Interface          Zone: 41 - Motion Basement state changed to: (Clear)
   AD2USB Alarm Interface          Zone: 2 - Motion Living Room  state changed to: (Clear)
   AD2USB Alarm Interface Error    updateIndigoBasicMode: updateZoneGroups Error: 'key displayState.ui not found in dict'
   AD2USB Alarm Interface          Zone: 41 - Motion Basement state changed to: (Faulted)
   AD2USB Alarm Interface Error    updateIndigoBasicMode: updateZoneGroups Error: 'key displayState.ui not found in dict'
   AD2USB Alarm Interface          Zone: 41 - Motion Basement state changed to: (Clear)
   Received INSTEON                "Motion Front Door" on (button 1)
   Trigger                         Motion Front Door
   Action Group                    Record Video Front Door
   AD2USB Alarm Interface Error    updateIndigoBasicMode: updateZoneGroups Error: 'key displayState.ui not found in dict'
   AD2USB Alarm Interface          Zone: 41 - Motion Basement state changed to: (Faulted)
   AD2USB Alarm Interface Error    updateIndigoBasicMode: updateZoneGroups Error: 'key displayState.ui not found in dict'
   AD2USB Alarm Interface          Zone: 41 - Motion Basement state changed to: (Clear)
   AD2USB Alarm Interface          Zone: 19 - Door Front Entry state changed to: (Faulted)
   AD2USB Alarm Interface          Zone: 19 - Door Front Entry state changed to: (Clear)
but they haven't repeated in the past hour.

Posted on
Sun Jun 03, 2018 8:05 am
wikner offline
Posts: 173
Joined: Nov 02, 2003

Zero-ing the First Zone Digit in rawData

I have been running this for 3-1/2 days now with no errors. I got rid of the "updateIndigoBasicMode: updateZoneGroups Error: 'key displayState.ui not found in dict'" error by deleting the one zone group that I had defined. I haven't tried re-creating it.

Posted on
Sun Jun 03, 2018 2:26 pm
berkinet offline
User avatar
Posts: 3133
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Zero-ing the First Zone Digit in rawData

wikner wrote:
I have been running this for 3-1/2 days now with no errors. I got rid of the "updateIndigoBasicMode: updateZoneGroups Error: 'key displayState.ui not found in dict'" error by deleting the one zone group that I had defined. I haven't tried re-creating it.
I am glad this is working for you. It is a c complex plugin and I am sure it can be improved. Maybe a project for the fall.

Posted on
Sun Jun 03, 2018 2:47 pm
wikner offline
Posts: 173
Joined: Nov 02, 2003

Re: ad2usb plugin discussion

berkinet wrote:
wikner wrote:
I have been running this for 3-1/2 days now with no errors. I got rid of the "updateIndigoBasicMode: updateZoneGroups Error: 'key displayState.ui not found in dict'" error by deleting the one zone group that I had defined. I haven't tried re-creating it.
I am glad this is working for you. It is a c complex plugin and I am sure it can be improved. Maybe a project for the fall.
Thanks. Yes it is complicated. I am in awe of all the work you have done on it, and I have learned a lot from reading your code. Perhaps it will inspire me to write my own plugin.

Posted on
Wed Jun 27, 2018 8:58 pm
wikner offline
Posts: 173
Joined: Nov 02, 2003

Re: ad2usb plugin discussion

All has been running well since my last post. I have a new question.
I just returned from a 3-week out-of-town trip. While I was gone a certain zone (a window) faulted, sirens went off, the alarm company called my cell phone, and we sent the police. There had been recent activity in my neighborhood (no kidding: one block away someone broke into my neighbor's house, put on her lipstick and got in her bed. He also found her gun. When she entered the house he started calling out her name in a high pitched falsetto. The police were present, so they arrested the guy. Nevertheless I was on heightened alert).
So, when my alarm went off I had dispatch summon the police. They found nothing wrong, and there was no obvious problem with the window. Fortunately, THANKS TO YOUR PLUGIN, I had programmed a disarm action, and was able to execute it from 1,500 miles away. My neighbor and the police were able to enter the house and verify that there was no problem. The neighbor re-armed the system and exited. A few hours later, the same zone faulted again, and the sirens went off. I instructed the monitoring company not to dispatch the police. I disarmed the alarm again, my neighbor bypassed the problem zone, and rearmed the alarm. As a precaution, I instructed the monitoring company not to dispatch if that particular zone faulted again. I can find no obvious fault with the zone. I fiddled with it ( it is a window plus a security screen) taking it apart and putting it back together. Again THANKS TO YOUR PLUGIN, I could examine the logs and show that during this entire day, the zone has not faulted while the alarm system was disarmed. So maybe I fixed it. I'll be monitoring the logs for several weeks (and bypassing the zone at night while it is ARMED-STAY mode).

All this is background for the following: I want to develop the capability to bypass arbitrary zones remotely from my iPhone. To do this, I imagine having a variable called, say, "zoneToBypass" containing a number value. I can set this variable to whatever I want from Indigo touch. But next, I want to execute an action which bypasses that zone. That action would execute your Write To Panel action. The string written would have to start with a user code, then the digit, "6" then the 2-digit zone to be bypassed. So how do I assemble this string and pass it to the action? Indigo, according to it's current documentation, provides very limited ability to modify actions in Python. Is there any way to build this string in Python and then poke it into the Write To Panel action? Or is it possible for you to modify the Write To Panel action to take it's string argument from an Indigo variable?

Posted on
Wed Jun 27, 2018 9:18 pm
hensed offline
Posts: 32
Joined: Feb 01, 2012
Location: Palo Alto, Ca

Re: ad2usb plugin discussion

Is your window Sensor an Ademco/Honeywell? Because I had the exact same issue. the thing would fault in the middle of the night...scaring the crap out of everyone. I would go and check the window and everything is fine. Hours later it would go off again. I bypassed for a couple of weeks - then I added it back, with no issues since.

Posted on
Fri Jun 29, 2018 2:03 am
berkinet offline
User avatar
Posts: 3133
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: ad2usb plugin discussion

wikner wrote:
...All this is background for the following: I want to develop the capability to bypass arbitrary zones remotely from my iPhone. To do this, I imagine having a variable called, say, "zoneToBypass" containing a number value. I can set this variable to whatever I want from Indigo touch. But next, I want to execute an action which bypasses that zone. That action would execute your Write To Panel action. The string written would have to start with a user code, then the digit, "6" then the 2-digit zone to be bypassed. So how do I assemble this string and pass it to the action? Indigo, according to it's current documentation, provides very limited ability to modify actions in Python. Is there any way to build this string in Python and then poke it into the Write To Panel action? Or is it possible for you to modify the Write To Panel action to take it's string argument from an Indigo variable?
Short answer. create a control page emulation of a keypad. I think there is one in the original AD2USB distribution.

Posted on
Fri Jun 29, 2018 9:11 am
wikner offline
Posts: 173
Joined: Nov 02, 2003

Re: ad2usb plugin discussion

berkinet wrote:
[size=85]Short answer. create a control page emulation of a keypad. I think there is one in the original AD2USB distribution.

Do you have a link to that? The original Dropbox link is broken.

Posted on
Mon Jul 02, 2018 6:04 am
berkinet offline
User avatar
Posts: 3133
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: ad2usb plugin discussion

wikner wrote:
berkinet wrote:
Short answer. create a control page emulation of a keypad. I think there is one in the original AD2USB distribution.
Do you have a link to that? The original Dropbox link is broken.

Here ya go... it is now on Google Drive.

Posted on
Sun Jul 29, 2018 7:52 pm
hamw offline
Posts: 1118
Joined: Mar 31, 2008

20se partition 2 keypad address

Hopefully this is pretty simple. I have a new installation at a different home. It came with a 20 SE. I want to set up a second partition, which the 20 SE “supports”, for my perimeter 5800PIR sensors.

However, an unusual feature of the 20 SE is that all keypads have address “31“. That’s fine for the AD2USB, and I do have the system working over Ser2Sock, with 3 Partition 1 keypads and the AD2USB at “31”, but when I try to set up a second keypad so that I can monitor what’s going on with the PIR sensors and trigger actions from them, I have a conflict. I tried setting to address 30 but I just get the same read out as partition one.

Any ideas how to set up the second partition keypad address on a 20 SE?

BTW, I have gotten the third partition working on my FBP 128. Total of three partitions, two that can be set to arm on and off, and the 3rd partition which is perimeter PIR sensors only, that trigger events and notifications. Thanks for the great plugin!

Posted on
Sun Jul 29, 2018 8:46 pm
hamw offline
Posts: 1118
Joined: Mar 31, 2008

Re: ad2usb plugin discussion

One other quick question: I would like to know when my alarm system is armed and disarmed and by whom. I have set up three different sets of codes, one for the family, one for the alarm company and another for a caretaker. Is it possible to have a trigger generated whenever one of these codes is used?

Posted on
Mon Jul 30, 2018 6:03 am
berkinet offline
User avatar
Posts: 3133
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: 20se partition 2 keypad address

hamw wrote:
... I have a new installation at a different home. It came with a 20 SE. I want to set up a second partition, which the 20 SE “supports”, for my perimeter 5800PIR sensors.

However, an unusual feature of the 20 SE is that all keypads have address “31“. That’s fine for the AD2USB, and I do have the system working over Ser2Sock, with 3 Partition 1 keypads and the AD2USB at “31”, but when I try to set up a second keypad so that I can monitor what’s going on with the PIR sensors and trigger actions from them, I have a conflict. I tried setting to address 30 but I just get the same read out as partition one.

Any ideas how to set up the second partition keypad address on a 20 SE?

BTW, I have gotten the third partition working on my FBP 128. Total of three partitions, two that can be set to arm on and off, and the 3rd partition which is perimeter PIR sensors only, that trigger events and notifications...
Short of swapping the panel for a 20P or 21IP, no. The plugin uses the keypad address to identify a partition. So, one address = one partition. However, I think there is a way around this. If you turn on "Log unknown wireless devices" you will see all your 5800PIR messages in the log. Then, you just need to write a script (or maybe someone has written a plugin to do this... though I have not seen it) to watch the log and execute Indigo RESTful API calls to execute Action groups. The script could be done in the shell (I.e. NPR (No Python Required).

Congrats on getting three partitions working!

Then, in another post hamw wrote:
One other quick question: I would like to know when my alarm system is armed and disarmed and by whom. I have set up three different sets of codes, one for the family, one for the alarm company and another for a caretaker. Is it possible to have a trigger generated whenever one of these codes is used?
If you turn on LRR support (either with a real LRR device or by emulating one in the AD2*) those messages are available is the states: lastChgAt, lastChgTo and lastChgBy for the keypad device.

Who is online

Users browsing this forum: No registered users and 0 guests