more G-Labs products

Author Topic: Honeywell Ademco alarm panel via AD2USB  (Read 7023 times)

February 16, 2015, 06:16:24 PM
Read 7023 times

CptJack

  • **
  • Information
  • Jr. Member
  • Posts: 30
It's my experience that alarm sensors (door/window and motion) are more reliable and less expensive than their HA counterparts. Also, if the HA system fails, the alarm panel will still do its job as an alarm. With that in mind, I've been using my Honeywell Ademco Vista 20P alarm panel and wireless sensors as HA sensors in my previous HA setup, and wanted to do it again with HG.

The AD2USB connects to lots of different kinds of alarm panels, but my experience is only with the Vista 20P. It wires in as a keypad using the four-wire interface, and provides a USB connection to your computer. It creates a virtual serial port which can be used to get information from the panel, and to provide commands to the panel. I'm on Windows, but it should work fine on Mac and Linux, as well, as there are drivers available.

Update 5/1/2015: You can now interact with the system using the plugin. Six quick-access buttons (Disarm, Max, Stay, Instant, Away and Chime) plus the 12-key keypad are available for use.

Update 6/7/2015: The panel/sensor combo will now monitor both the panel and wireless sensors directly. You can add the RFX ID of your sensor to the Alarm Sensor module instead of a panel string to match. The RFX.Status field on the sensor is updated with loop/battery/supervision information.

The files provided will get you started. The AlarmPanel folder should be placed in /HomeGenie/html/pages/control/widgets, and then import the HGX files. The Alarm Panel program will provide the interface to the alarm panel itself, and the Alarm Sensor will provide the virtual sensors which feed off of the data from the Alarm Panel. There's a place to enter the string which the alarm panel sends when a zone is faulted - such as "FAULT 1 FRONT DOOR". These strings are set by the installer at the panel, and are what show up on the keypads when a zone is faulted. If you don't know all the strings, you can look at the Alarm Panel device that you create, and it will display them as they're faulted. Just copy and paste that text into the textbox. You can alternately use the RFX ID of the wireless sensor you want to monitor directly.

If you have any questions, post them and I'll see what I can do to help out!
« Last Edit: June 07, 2015, 10:06:55 PM by CptJack »

February 17, 2015, 12:19:33 AM
Reply #1

enterprised

  • ****
  • Information
  • Sr. Member
  • Posts: 101
  • Things are only impossible until they are not
Nice job, can't wait to try the final product.

I've got the Alarm Panel working with an AD2USB connected to a Raspberry Pi B+

Still struggling a bit with the virtual sensors, either  i'm entering the wrong string or something is not configured correctly in my Vista 10P.
4a 75 73 74 20 61 20 70 65 72 73 6f 6e 20 68 61 76 69 6e 67 20 66 75 6e 20 77 69 74 68 20 68 6f 6d 65 20 61 75 74 6f 6d 61 74 69 6f 6e
enterprised == guytpetj

February 17, 2015, 02:10:56 AM
Reply #2

CptJack

  • **
  • Information
  • Jr. Member
  • Posts: 30
The first thing to check would be the alarm panel module. It should have the last received status in the title area (which, for a 10P, should be ****DISARMED**** Ready to Arm or a fault). If you don't have that, the virtual sensors won't work.

February 17, 2015, 02:35:10 AM
Reply #3

enterprised

  • ****
  • Information
  • Sr. Member
  • Posts: 101
  • Things are only impossible until they are not
Sometimes the solution to the problem is so simple that you wonder why didn't I think of this before.

Since I'm using this on a Raspberry Pi, all I had to do was re-compile the Alarm Sensor plugin.

I also made a small tweak to the HTML and JS files to make the alarm panel picture show up properly.

Fantastic option to have lights switch on/off using the Alarm Sensors and some Macro's when opening the front door or garage door.
« Last Edit: February 17, 2015, 03:35:08 AM by enterprised »
4a 75 73 74 20 61 20 70 65 72 73 6f 6e 20 68 61 76 69 6e 67 20 66 75 6e 20 77 69 74 68 20 68 6f 6d 65 20 61 75 74 6f 6d 61 74 69 6f 6e
enterprised == guytpetj

February 17, 2015, 06:02:24 AM
Reply #4

CptJack

  • **
  • Information
  • Jr. Member
  • Posts: 30
I'm glad it was easy to get working! I'm still working on it, but the panel shows up fine for me - what did you have to change? I wonder if it's the difference in the platforms, or something I did wrong.

February 22, 2015, 01:57:48 AM
Reply #5

enterprised

  • ****
  • Information
  • Sr. Member
  • Posts: 101
  • Things are only impossible until they are not
While playing around with HG I had the following thought. The widget used for "BasicThermostat" looks like a good choice for this program. The main widget can act as display, and the secondary control widget can become the keypad.

I made a small change to your panel code to make it re-connect after the connection to the AD2USB is lost, see attachment.

I also started writing an add-on that will speak a user defined text when a sensor is activated. The wife realy wanted the alarm system to speak voice commands if a perimeter door was opened, even if the Ademco alarm system is not activated.
You can define the text in the widget settings under Features/Options there is a new option "Speak Sensor Status". If you add text in this field HG will speak the text when the sensor is activated. Also, see attachment. Will work for all sensors, is not locked-in to alarm system only.
4a 75 73 74 20 61 20 70 65 72 73 6f 6e 20 68 61 76 69 6e 67 20 66 75 6e 20 77 69 74 68 20 68 6f 6d 65 20 61 75 74 6f 6d 61 74 69 6f 6e
enterprised == guytpetj

February 22, 2015, 08:35:08 PM
Reply #6

CptJack

  • **
  • Information
  • Jr. Member
  • Posts: 30
I like the idea of the speech. I hadn't posted it, but I'd also written a connected status check, but I did mine a little differently. I'm not sure if one way is better than the other, but this has been working very reliably for me:

Code: [Select]
while (Program.IsEnabled){
  if(!SerialPort.IsConnected){
    SerialPort
      .WithName(Program.InputField("Port").Value)
      .OnStatusChanged(HandleStatusChanged)
      .OnMessageReceived(HandleMessageReceived)
      .OnStringReceived(HandleStringReceived)
      .Connect(115200);
  }
  Pause(30);
}

Now that I'm a little more familiar with HG, I might actually go back and re-write the whole thing to integrate the two programs, plus also auto-generate the modules for the sensors. I also need to add the arm/disarm capabilities.

February 22, 2015, 10:54:01 PM
Reply #7

enterprised

  • ****
  • Information
  • Sr. Member
  • Posts: 101
  • Things are only impossible until they are not
Was trying to make the sensors app to only look for "FAULT ##"  (## is related group number)  instead of the full name given the alarm config.

I tried the following change to your code, but does not seem to work. Any idea what I'm doing wrong?
I just learned a bit of C# playing around with HG.

//value coming from alarm system
var panelValue = new System.Text.RegularExpressions.Regex(@"[^a-zA-Z0-9-]",     System.Text.RegularExpressions.RegexOptions.None).Replace(parameter.Value, @"").ToString();
    //only look for fault code i.e. "FAULT 01"
    panelValue = panelValue.Substring(0,8);

   
Modules.InDomain("HomeAutomation.AlarmPanel.Sensor").Each((sensor) => {
//parameter entered in sensor setup window
var stringMatch = new System.Text.RegularExpressions.Regex(@"[^a-zA-Z0-9-]",     System.Text.RegularExpressions.RegexOptions.None).Replace(sensor.Parameter("StringMatch").Value, @"").ToString();
    //only look for fault code i.e. "FAULT 01"
    stringMatch = stringMatch.Substring(0,8)
4a 75 73 74 20 61 20 70 65 72 73 6f 6e 20 68 61 76 69 6e 67 20 66 75 6e 20 77 69 74 68 20 68 6f 6d 65 20 61 75 74 6f 6d 61 74 69 6f 6e
enterprised == guytpetj

February 23, 2015, 01:29:45 AM
Reply #8

CptJack

  • **
  • Information
  • Jr. Member
  • Posts: 30
I've found that the whitespace that comes in from the panel is unpredictable (e.g. "FAULT 10 KITCHEN MOTION" could be received as "FAULT 10 KITCHENMOTION" or "FAULT 10        KITCHEN MOTION"), so I 've stripped out all the whitespace from the strings before I do a comparison. So, you'll want substring(0,7) to match "FAULT01" instead of "FAULT 01".

April 07, 2015, 02:21:11 AM
Reply #9

enterprised

  • ****
  • Information
  • Sr. Member
  • Posts: 101
  • Things are only impossible until they are not
CptJack,
Did you do further development to this app?
4a 75 73 74 20 61 20 70 65 72 73 6f 6e 20 68 61 76 69 6e 67 20 66 75 6e 20 77 69 74 68 20 68 6f 6d 65 20 61 75 74 6f 6d 61 74 69 6f 6e
enterprised == guytpetj

April 07, 2015, 08:20:44 PM
Reply #10

CptJack

  • **
  • Information
  • Jr. Member
  • Posts: 30
I have a couple of small fixes I need to package up. I haven't done any of the setting of the panel yet - maybe I'll work on it this week.

May 02, 2015, 01:29:14 AM
Reply #11

CptJack

  • **
  • Information
  • Jr. Member
  • Posts: 30
I've updated the first post with a new zip and picture of the plugin. I want to do some work on notifications next, and if there's anything you can think of, I'll work on it, too.
« Last Edit: May 02, 2015, 01:41:31 AM by CptJack »

May 02, 2015, 04:08:56 AM
Reply #12

enterprised

  • ****
  • Information
  • Sr. Member
  • Posts: 101
  • Things are only impossible until they are not
The new alarm panel program and widget are working great.

The sensor program however did not work with my Vista 10PSIA, I had to revert to the old version and now all works fine.
4a 75 73 74 20 61 20 70 65 72 73 6f 6e 20 68 61 76 69 6e 67 20 66 75 6e 20 77 69 74 68 20 68 6f 6d 65 20 61 75 74 6f 6d 61 74 69 6f 6e
enterprised == guytpetj

May 06, 2015, 07:09:45 PM
Reply #13

gustavo

  • *
  • Information
  • Newbie
  • Posts: 13
I've made some updates to your app.  Specifically, AlarmPanel will now raise events for the !RFX messages, which will be processed by a new Sensor Type RFX Sensor.  The current app maps the fault codes to virtual sensors which works great.  By mapping to RFX sensors, you get a couple of advantages:

1) You can monitor wireless sensors that are not specifically enrolled in the alarm panel.
The !RFX messages come across for any wireless sensor in range.  This is useful for debugging before enrolling, or just for monitoring sensors that aren't part of your alarm network.  :P

2) You can monitor all of the loops on a specific sensor.
For example, the wireless sensors in my house all have three loops.  There's a loop for the builtin reed sensor, as well as a loop for wired devices (e.g. you can wire a device into the sensor itself).  Thus each one of my wireless sensors can serve dual zones.  Additionally, the sensors I have at my house have a loop for tamper.  Additionally, my smoke alarm has a freeze sensor builtin on a separate loop.  The caveat for loops is right now, a trigger for any loop triggers the DoorWindow.  I plan to allow a configurable mapping of loops which trigger the Door/Window for the specific sensor.

3) You can monitor sensors even when the system is armed.
This is useful for interior monitoring and automation that doesn't necessarily need to trip the alarm.  Again, this is only for "wireless" sensors.  As far as I can tell there's no real way to monitor "wired" devices that are wired directly into the alarm panel, while the panel is armed.  Note I said directly attached.  I plan on writing the same sort of thing for wired expanders unless someone else gets to it first.

Note that you have to configure the serial number of your device as sensorsn (it's a 7 digit serial number).  I'm not sure if this is a 1:1 map of the actual device SN or not.  Right now the RFX Sensor is spamming the user with notifications for sensors that it doesn't know about - so you should be able to trigger your wireless devices, and see the notifications, thus grabbing the serial number.  When you're done, just comment out this line:

Program.Notify("RFXSensor: " + sensorSN, "Sensor unknown, state: " + sensorState);

May 08, 2015, 01:29:10 AM
Reply #14

gustavo

  • *
  • Information
  • Newbie
  • Posts: 13
I've made an updated version of my RFXSensor mod for AlarmPanel.  In this version the loops are configurable.  E.g. if you have a sensor with SN 1234567 and you only want to trigger the DoorWindow based on loop2, you'd configure 1234567:2

This is useful for a sesnor like the 5816 where loop1 is 'wired' and loop2 is the reed switch.  If you to utilize loop 1,2, or 4 to trigger the DoorWindow, use 1234567:1,2,4

Keep in mind that you need to use the updated AlarmPanel from my previous post, as the official doesn't won't convert the !RFX messages into events that are handled by the RFX Sensor.  Maybe that can get merged in?