| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
ADT / Honeywell / Ademco / Vista / Alarm / SmartThings / Alarm Panel / Home Alarm
Do want to integrate your home alarm panel with SmartThings? Do you hate the hassle arming your panle and having to rush to disarm? Do you want to install another keypad and don't want to deal with your alarm company? Do you have an alarm panel and never use it?
This is a relatively simple integration project that effectively integrates your Honeywell or Ademco alarm panel with SmartThings. These panels are typically installed by ADT or other alarm companies. You can choose to continue or not with your ADT monitoring service. This project works either way.
After installing this project, control of your alarm panel becomes intuitive and automagic!
Release Note:
*-*This release allows for independent zone processing and reduces the logging from the Aruidno in SmartThings recent history log. Also included is a SmartApp that will automatically create virtual contact and motion sensors which allows you to subscribe to these from other SmartApps. This release also standardizes the hardware assembly of the AD2SmartThings device, which addresses the top two support issues. In addition, we provide more detailed instructions on how to power your project using the alarm console. The release includes new version 4 code bases for both the Arduino sketch, the device handler and a new README with updated project instructions.
Note: This release is not backwards compatable with the Version 3.X or earlier. Be sure to install both the sketch and new device handler to upgrade. The libraries from SmartThings and the ArduinoMega library which can be found on github are not compatable with v4 and later sketches. You must use the ST_Anything SmartThings library. A big thanks to Daniel Ogorchock and his son, Daniel Ogorchock, for creating a superior version of the SmartThings library with many enhancements and full support for the Arduino Mega.
The AD2Pi was obtained from Alarm Decoder. www.alarmdecoder.com The SmartThings ThingShield was purchased directly from SmartThings All other items from this project were easily obtained from Amazon via Amazon Prime
For the wiring, I used individual male to male jumper cables to wire the project (see below). I found these at Amazon such as Male to Male Solderless Flexible Breadboard Jumper Cable Wires 65Pcs for Arduino by Sunkee.
During programming, the Arduino will be powered by the USB connection to your computer. Once installed, the Arduino + AD2Pi will be powered by the alarm panel. This has the added advantage of using the alarm panel battery backup as backup power to the Arduino + AD2Pi. If power goes out, connectivity will be preserved as long as your internet+SmartThings hub is on a back up power supply and as long as the Alarm Panel battery lasts.
I simply strapped the Arduino onto a foam board and inserted it into my alarm panel box
Here is a high level overview of the entire project. This README will take you through each step by step.
An *Arduino Mega was used as the controller and was stacked with the SmartThings ThingShield.
Set the DIP switch on the ThingShield to D2/D3. The shield has a DIP switch that allows it to either read serial commands via pins 0/1 or pins 2/3. For this project, the ThingShield is reading the Serial commands from the ArduinoMega through the ThingShield pins 2/3. Check that the DIP switch is set to D2/D3. Note, this is typically the default position when ThingShields are shipped.
Stack the ThingShield on top of the Arduino Mega, matching the pins as you push the two boards together. All pins should be securely contacted.
Use jumpers to provide a connection between Serial3 and Pins 2/3. Here are the connections:
| Jumper | Pin | Pin |
|---|---|---|
| TX | 14 | 2 |
| RX | 15 | 3 |
Note, the ThingShield pins are not labeled. So you can identify the pins using labels on the ArduinoMega picture (above) or by study the photos of my project (above).
Here are the pin connections to make between the Arduino/Thingshield and the AD2Pi along with a couple pics to get you oriented. You can make these connections using an 8" male to male jumper wire.
Pin Configuration for AD2Pi to Arduino Mega
| Jumper | AD2PI | Mega |
|---|---|---|
| 5V | 1 | 5V |
| GND | 6 | GND |
| TX | 8 | 18 |
| RX | 10 | 19 |
The code for this project can be found posted on github:
https://github.com/d8adrvn/ad2smartthings.git
To load the sketch onto the Arduino, you will need the Arduino developer environment:
http://arduino.cc/en/main/software
Once the software is installed, the first thing to do is obtain the required libraries.
Once you have the zip files downloaded you can import them within the Arduino IDE. Go to the Sketch:Import Library;Add Library drop down menu. Once you have added the libraries, they will show up under Sketch:Add Library:Contributed as "SmartThings".
Optionally, you can edit the sketch to match the highest zone number in your system. Note, this is the highest zone number not the total number of zones. If you have only a few zones and the highest zone is a low number, by editing the sketch, the software will be more efficient at processing alarm panel messages. To make the edit, go to the code where it says numZones = 36 and change the number to the highest zone. If the highest zone is greater than 36, you can make the number higher as well (you may have to edit the device handler if the highest zone is greater than 39).
You can connect the Arduino Mega to your computer via an USB cable, create a new sketch, paste the code from github into the Arduino IDE and then transfer to the ArduinoMEGA. Be sure to go to the tools menu, select and then select the ArduinoMega 2560 so that the code will compile correctly and not time out during transfer.
Pairing instructions for the Arduino to the SmartThings hub can be found at SmartThings.com and are copied here:
“To join the shield to your SmartThings hub, go to “Add SmartThings” mode in the SmartThings app by hitting the “+” icon in the desired location, and then press the Switch button on the shield. You should see the shield appear in the app.
To unpair the shield, press and hold the Switch button for 6 seconds and release. The shield will now be unpaired from your SmartThings Hub.”
Once you have finished transfering the code to the Arduino, you can remove the USB and power the Arduino using a 9V transformer.
Its more than a good idea to put a piece of electrical tape over the USB port to prevent accidental grounding of the port!
The device type code allows you to control the ArduinoMega via the SmartThings physical graph. The controller device type code has the following features:
The Main Tile gives the status of the system and allows you to disarm the system (by pressing the tile).
Inside the device type:
As you scroll down the Device Type UI, you will find:
In addition to the above tiles, notice the 3 VERTICAL DOTS in the top right corner of the Device Type screen. Pressing these dots takes you to the Prefernces sections. Here you can:
To install the device type code:
To install the SmartApp code:
Here is a close up of the terminals that connect AD2Pi to the alarm console
After making all the connections, reconnect alarm console to 120v and then reconnect the alarm console to its battery backup. The Arduino should be powered on and the AD2Pi LED should be be slowly and steadily blinking.
The VistaSE series requires the AD2Pi to be configured with an ADDRESS=31. To do this, go to the Preferences tile on your mobile device and in the Configuration box, enter "ADDRESS=31". All caps, no spaces and no quotes. After entering this in the Preferences, you must then press the Config AD2Pi tile to send down the configuration command to the AD2Pi. You will see the Message tile indicate !Sending and then you should see a confirmation message of "ADDRESS=31". You can double check your work by going back to the Preferences, erasing the command (recommended) and then pressing the ConfigAD2Pi tile once again. The Message tile will report back the current address of the AD2Pi.
The Vista20P will only commuicate to the AD2Pi if it has been properly configured with a unique address. This requires two steps. First, you need to activate an unused keypad address in your Vista20P and second, you need to configure the AD2Pi with that address.
To configure your Vista20P, follow the instructions in the manual to activate an unused keypad address. There is a helpful video at alarmdecoder.com http://www.alarmdecoder.com/wiki/index.php/Panel_Configuration You can also find a manual at http://site.aesecurity.com/Manuals/v15pand20pprogrammingguide.pdf
You will also may need to configure the AD2Pi. The AD2Pi is pre-configured with ADDRESS=18. If you were lucky enough to only have two keypads and activated the third keypad for the AD2Pi (*191 in the Honeywell programming mode), then you should be fine. If you activated a different keypad, lets say keypad #4 (*192), then you need to configure the AD2Pi with the correct address. For Keypad #4, you should configure with ADDRESS=19. To do this, go to the Preferences tile on your mobile device and in the Configuration box, enter "ADDRESS=19". All caps, no spaces and no quotes. After entering this in the Preferences, you must then press the Config AD2Pi tile to send down the configuration command to the AD2Pi. You will see the Message tile indicate !Sending and then you should see a confirmation message of "ADDRESS=19". You can double check your work by going back to the Preferences, erasing the command (recommended) and then pressing the ConfigAD2Pi tile once again. The Message tile will report back the current address of the AD2Pi.
The device type also establishes a switch and lock capability. You can integrate your alarm panel into SmartApps and into Actions using these capabilities.
To automate turning on/off the Alarm in "Stay" mode, select the Home Alarm from the list of "switches" in your SmartThings device list
To To automate turning on/off the Alarm in "Away" mode, select the Home Alarm from the list of "locks" in your SmartThings device list. "Locking" the alarm turns it on in Away Mode while "Un-Locking" turns it off
For example, here are some of my automations that control my Alarm Panel
Have fun integrating!
After installing the Device Type, be sure to both Save AND Publish (for me). If you do not publish, they will not be able to communicate with the hub. If you make changes to either code, Publish early and often to avoid IDE issues.
The Arduino 9V power supply (transformer) can be purchased at Amazon by searching for "Arduino Power Supply". CAUTION: There are 9V power supplies availble on Amazon that do not work for the Arduino (they are made for musical instrament controllers) and some that perform very poorly on Arduino. Be sure to read the reviews!
If you have hooked up everything "perfectly", and you still do not see any communication from the AD2Pi, recheck the following:
While compiling or transferring the code, you get the following error: 'Serial1' was not declared in this scope or 'Serial2' was not declared in this scope, then you likely do not have the correct board selected in the Arduino Development Environment. You can also have the same issue if you see that during transfer, the transfer process times out without transfering the code. Go to the menu and select then select the Mega 2560. This will allow the code to compile correctly.
A few thoughts regarding newer Vista panels that support partitions.
Your system will not respond to ArmStay/ArmAway/DisArm yet you are receiving messages from the system. For example, you are seeing your Zone tiles activate when you open/close a door. Messages from the system indicate your Arduino, AD2Pi and Device Handler are installed and communicating, however, the AD2Pi is not communicating with the Alarm Panel. You should see a steady LED heartbeat on the AD2Pi along with this message. Check the following:
You can go to api.graph.smartthings.com and open the Live Logging Tab. This can give you some useful diagnostics, in case your system is not working as expected. You can also set isDebugEnabled to 'true' in both the device handler and the arduino sketch to get additional log information in Live Logging tab and the Arduino Console window, respectively
##Credits
| Back | FazBrowse Home | New Git URL |