All Projects → yracine → DSC-Integration-with-Arduino-Mega-Shield-RS-232

yracine / DSC-Integration-with-Arduino-Mega-Shield-RS-232

Licence: GPL-2.0 license
DSC - Integration with SmartThings (RS232)

Programming Languages

groovy
2714 projects
C++
36643 projects - #6 most used programming language
processing
702 projects

Projects that are alternatives of or similar to DSC-Integration-with-Arduino-Mega-Shield-RS-232

PowerShell-DevOps
PowerShell scripts or modules for purposes related to DevOps practices
Stars: ✭ 31 (+82.35%)
Mutual labels:  dsc
SmartLEDLamp
A smart, web-enabled floor lamp with nice visual effects based on IKEA Vidja powered by ESP8266 and WS2801.
Stars: ✭ 22 (+29.41%)
Mutual labels:  smartthings
smartapp-sdk-java
A collection of consumer-oriented Java (JVM) libraries for creating SmartApps and using the public API
Stars: ✭ 42 (+147.06%)
Mutual labels:  smartthings
node-red-contrib-smartthings
Allows you to control your devices and get their status using NodeRed
Stars: ✭ 30 (+76.47%)
Mutual labels:  smartthings
IoTBench-test-suite
A micro-benchmark suite to assess the effectiveness of tools designed for IoT apps
Stars: ✭ 59 (+247.06%)
Mutual labels:  smartthings
SmartThings
No description or website provided.
Stars: ✭ 29 (+70.59%)
Mutual labels:  smartthings
DscWorkshop
Blueprint for a full featured DSC project for Push / Pull with or without CI/CD
Stars: ✭ 151 (+788.24%)
Mutual labels:  dsc
PowerShell
A collection of useful PowerShell modules and scripts.
Stars: ✭ 37 (+117.65%)
Mutual labels:  dsc
cbj smart-home
🏡 If you are searching for an easy way to connect all your smart home devices with one app CyBear Jinni 🦾🐼🧞‍♂️ is here for you. Join the community and make your home smarter than yesterday.
Stars: ✭ 40 (+135.29%)
Mutual labels:  smartthings
APSoft-Web-Scanner-v2
Powerful dork searcher and vulnerability scanner for windows platform
Stars: ✭ 96 (+464.71%)
Mutual labels:  smartthings
device-type.myneurio
SmartThings-Neurio integration
Stars: ✭ 17 (+0%)
Mutual labels:  smartthings
OmniLinkBridge
MQTT bridge, web service API, time sync, and logging for HAI/Leviton OmniPro II controllers
Stars: ✭ 34 (+100%)
Mutual labels:  smartthings
SmartThings-VirtualThermostat-WithDTH
Virtual Thermostat Device with Device Type Hander to create a proper thermostat device (Works With Google Home and Alexa)
Stars: ✭ 33 (+94.12%)
Mutual labels:  smartthings
TKViewer
NexusTK DAT Object Viewer
Stars: ✭ 18 (+5.88%)
Mutual labels:  dsc
RyobiGDO
Device Type Handler and Node.js Proxy Service for Smartthings
Stars: ✭ 17 (+0%)
Mutual labels:  smartthings
CertificateDsc
DSC resources to simplify administration of certificates on a Windows Server.
Stars: ✭ 103 (+505.88%)
Mutual labels:  dsc
gosmart
A Go (golang) library to interface with the Samsung SmartThings API.
Stars: ✭ 14 (-17.65%)
Mutual labels:  smartthings
xHyper-V
This module contains DSC resources for deployment and configuration of Microsoft Hyper-V.
Stars: ✭ 105 (+517.65%)
Mutual labels:  dsc
Smartthingspublic
SmartThings open-source DeviceTypeHandlers and SmartApps code
Stars: ✭ 2,201 (+12847.06%)
Mutual labels:  smartthings
Smartthings
Custom DTHs for Smartthings
Stars: ✭ 44 (+158.82%)
Mutual labels:  smartthings

DSCAlarmSmartThings

DSC Alarm interface to SmartThings. Able to arm/disarm, monitor zone status and trigger the panic alarm.

Author: Vassilis Varveropoulos, Brice Dobry

Modified by Yves Racine


PayPal

===================== PREREQUISITES

https://community.smartthings.com/t/faq-how-to-find-out-what-shard-cloud-slice-ide-url-your-account-location-is-on/53923

If you are on a different shard, you need to change the links below for your right shard. As an example, in North America,

replace https://graph.api.smartthings.com/ide/devices by https://graph-na02-useast1.api.smartthings.com

Required hardware

  • Compatible DSC Alarm System
  • IT-100 interface
  • Arduino MEGA
  • Arduino RS232 shield
  • Arduino SmartThings shield
  • Null modem RS-232 cable

Required software

  • Arduino IDE (>v1)
  • Libraries and source of the Arduino folder in this repository
  • Open the HomeAlarm.ino file and enter your pin at the right location (see the comments)

How to connect the hardware

The IT-100 interface is connected to the communication and power lines of the DSC alarm panel (AUX+/AUX- for power and GRN/YEL for data). An Arduino is used to decode the commands from the alarm system and interface with the SmartThings hub. The output of the IT-100 interface is RS232 at 12V levels therefore it can't be directly connected to the Arduino board (it will only accept 5V levels), therefore an RS232 shield is used to convert to the right levels. You may also use a 9v (1A) power adapter connected to the Arduino Mega to have a steady power source.

A SmartThings shield is used to interface with the SmartThings hub and cloud. The Arduino needs to be capable of receiving and transmitting through two serial ports (one for the IT-100 and another for the SmartThings shield). An Arduino Mega was chosen since it has more than two serial ports. An attempt was made to use an Arduino Uno with one hardware and one software serial port but it was not fast enough to handle all communications and as a result messages were lost. The SmartThings serial port is operating a 2400 bps and if a software serial port is used it blocks all other communication while a message is sent to the hub, which at those speeds it could be several ms.

The official SmartThings Arduino library will only support a software serial port, as a result the library had to be modified in order to utilize a hardware serial port.

The order of the shield stacking is the following (from bottom to top), Arduino Mega, SmartThings shield and RS232 shield. Make sure that the SmartThings shield serial port selection switch is set to pins 1,2. By default the RS232 shield will also use pins 1 &2.

All four lines had to be re-routed to the dedicated serial ports of the Arduino Mega. You do it by bending the pins, and running wires to the appropriate ports. The Rx and Tx pins of the RS232 shield are bent, and wires are run to connect Rx to port 19 (Rx1) of the MEGA, and Tx to port 18 (Tx1). Similarly, the Rx and Tx pins of the SmartThings shield are bent and wires are run to pins 17 (Rx2) and 16 (Tx2), respectively. See the pictures (IMG_426*.JPG) for details.

Before programming the Arduino board you will need to modify the SmartthingsDCSAlarm.ino file with your pin code (3 places, see comments), otherwise arming and disarming will not work.

A few pictures of the hardware can be found in the repository.

Arduino Code

To load the code 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.

Timer library was created by Simon Monk as modified by JChristensen. A copy is included in this repository/release for your convenience.

SmartThings Mega library contained in this repository/release SoftwareSerial library was default library provided with Arduino IDE

Once you have the required 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 "Timer" and "SmartThingsMega". Be sure the Timer library is installed named as "Timer"

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 it to the ArduinoMEGA

Once you have finished transfering the code to the Arduino, you can remove the USB and power the Arduino using a 9V transformer.

Setup of the Arduino Shield and Smartthings custom device type

Pairing instructions for the Arduino shield 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.”

The source code for the device type is also provided. You will need to modify this file to setup the proper zone numbers for your system. Use the provided source code and publish the device type. Pair your SmartThings shield to you hub and then manually change its device type to the one you created. You should now be able to see your new device and will be able to arm/disarm, monitor the state of the zones, trigger the panic alarm, etc.

You can also use the smartapp ArduinoAlarmController to create individual sensors as child Devices. Prior to executing the smartapp, you need to create the Open/Close and Motion Detector device types within your own namespace by using the SmartThing code template in the IDE.

In order to do so,

a) Go to https://graph.api.smartthings.com/ide/devices

b) Click on new SmartDevice on the right

c) On the new SmartDevice page, click on the "From Template" tab

d) Scroll down to Motion Detector

e) Click "create" at the bottom of the page

f) Click Save and publish on the next page

g) Do the same for Open/Close Sensor

h) Click "create" at the bottom of the page

i) Click save and publish

Each of your zones defined in SecurityAlarmPanel must then be created in the same order as ArduinoAlarmController, so that there is a match in the zone event processing.

Ex. In SecurityAlaramPanel, the following sendEvent must match the zone number in ArduinoAlarmController.

        sendEvent(name: "response",  value: "r 4 inactive", type: "Motion Detector")

So, the zone 4 in SecurityAlarmPanel should be the same zone number in ArduinoAlarmController when you execute it and do the zone configuration.

Credits

  • Timer library from Simon Monk
  • SmartThings shield library from SmartThings (modified for ArduinoMega)
  • Original code forked from Vassilis Varveropoulos and Brice Dobry
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].