You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-20Lines changed: 40 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,35 @@
1
-
_**Note**: This is a development branch for testing: partitions 2-8, zones 33-64, virtual keypad partitions 1 & 2. The library methods have changed to accommodate multiple partitions and the previous methods have been removed - see the examples sketches for usage. The new methods should not change in the future and can be considered stable (in theory!)._
2
-
3
1
# DSC Keybus Interface
4
-
This library directly interfaces Arduino and esp8266 microcontrollers to [DSC PowerSeries](http://www.dsc.com/dsc-security-products/g/PowerSeries/4) security systems for integration with home automation, notifications on system events, and usage as a virtual keypad. The included examples demonstrate monitoring armed/alarm/zone/fire/trouble states, integrating with Home Assistant and Apple HomeKit using MQTT, sending push notifications/email, and reading/decoding Keybus data.
2
+
This library directly interfaces Arduino and esp8266 microcontrollers to [DSC PowerSeries](http://www.dsc.com/dsc-security-products/g/PowerSeries/4) security systems for integration with home automation, notifications on system events, and usage as a virtual keypad. The included examples demonstrate monitoring armed/alarm/zone/fire/trouble states, integrating with Home Assistant/Apple HomeKit/Homey, sending push notifications/email, and reading/decoding Keybus data.
5
3
6
4
For example, an Arduino Uno (with an ethernet module) or the inexpensive NodeMCU and Wemos D1 Mini modules ($3USD shipped) can be used with [Homebridge](https://github.com/nfarina/homebridge) for notifications and control of the security system through the iOS Home app and Siri:
* Virtual keypad: supports sending keys to the panel for partitions 1 and 2
14
-
* Data buffering: helps prevent missing Keybus data when the sketch is busy
15
-
* Non-blocking code: allows sketches to run as quickly as possible without using `delay` or `delayMicroseconds`.
9
+
* Status tracking of armed/alarm/fire states for partitions 1-8
10
+
* Status tracking of zones 1-64
11
+
* Virtual keypad: Enables writing keys to the panel for partitions 1 and 2
12
+
* Data buffering: Helps prevent missing Keybus data when the sketch is busy
13
+
* Non-blocking code: Allows sketches to run as quickly as possible without using `delay` or `delayMicroseconds`.
14
+
* Tested DSC panels: PC1555MX, PC5015, PC1616, PC1832, PC1864. All PowerSeries panels are supported, post an issue if you have a different panel (PC5020, etc) and have tested the interface to update this list.
15
+
16
+
## Release notes
17
+
* 0.3
18
+
- New: Status for partitions 2-8, zones 33-64
19
+
- New: Virtual keypad support for partition 2
20
+
- New: [Athom Homey](https://www.athom.com/en/) integration example sketch, contributed by [MagnusPer](https://github.com/MagnusPer)
21
+
- New: PCB layouts, contributed by [sjlouw](https://github.com/sj-louw)
22
+
- New: Configurable number of partitions and zones to customize memory usage: `dscPartitions` and `dscZones` in `dscKeybusInterface.h`
23
+
- New: KeybusReader decoding of commands `0xE6` and `0xEB`
24
+
- Changed: Split examples by platform
25
+
- Changed: MQTT examples updated with username and password fields
26
+
- Changed: `processRedundantData` now true by default to prevent storing repetitive data, reduces memory usage.
27
+
- Note: This release changes the library methods to accomodate multiple partitions, existing sketches will need to be updated to match the new example sketches.
28
+
* 0.2
29
+
- New: Status for zones 9-32
30
+
- New: HomeAssistant integration example sketch
31
+
- New: Panel data buffering, adds `dscBufferSize` to `dscKeybusInterface.h` to allow configuration of how many panel commands are buffered to customize memory usage (uses 18 bytes of memory per command buffered).
32
+
* 0.1 - Initial release
16
33
17
34
## Usage
18
35
Download the repo and extract to the Arduino library directory or [install through the Arduino IDE](https://www.arduino.cc/en/Guide/Libraries#toc4): `Sketch > Include Library > Add .ZIP Library`. Alternatively, `git clone` the repo in the Arduino library directory to keep track of the latest changes - after the code has been tested across different panels, I'll flag the library to be added to the Arduino Library Manager for integrated updates.
@@ -24,23 +41,21 @@ Download the repo and extract to the Arduino library directory or [install throu
24
41
25
42
See `src/dscKeybusPrintData.cpp` for all currently known Keybus protocol commands and messages. Issues and pull requests with additions/corrections are welcome!
26
43
27
-
* Status: Processes and prints the security system status to a serial interface, including reading from serial for the virtual keypad. This demonstrates how to determine if the security system status has changed, what has changed, and how to take action based on those changes. Post an issue/pull request if you have a use for additional commands - for now, only a subset of all decoded commands are being tracked for status:
28
-
* Armed away/stay/disarmed
29
-
* Partition in alarm
30
-
* Zones
44
+
* Status: Processes and prints the security system status to a serial interface, including reading from serial for the virtual keypad. This demonstrates how to determine if the security system status has changed, what has changed, and how to take action based on those changes. Post an issue/pull request if you have a use for additional commands - for now, only a subset of all decoded commands are being tracked for status to limit memory usage:
45
+
* Partitions armed away/stay/disarmed
46
+
* Partitions in alarm
47
+
* Partitions exit delay in progress
48
+
* Partitions entry delay in progress
49
+
* Partitions fire alarm
50
+
* Zones open/closed
31
51
* Zones in alarm
32
-
* Exit delay in progress
33
-
* Entry delay in progress
34
-
* Fire
35
52
* Keypad fire/auxiliary/panic alarm
36
53
* Panel AC power
37
54
* Panel battery
38
55
* Panel trouble
39
56
40
57
* Status-MQTT-Homebridge: Processes the security system status and allows for control using Apple HomeKit, including the iOS Home app and Siri. This uses MQTT to interface with [Homebridge](https://github.com/nfarina/homebridge) and [homebridge-mqttthing](https://github.com/arachnetech/homebridge-mqttthing) for HomeKit integration and demonstrates using the armed and alarm states for the HomeKit securitySystem object, zone states for the contactSensor objects, and fire alarm states for the smokeSensor object.
41
58
42
-
Note: homebridge-mqttthing seems to have a bug for the smokeSensor object, I've fixed the bug and forked the repo until upstream is patched: [taligentx/homebridge-mqttthing](https://github.com/taligentx/homebridge-mqttthing)
43
-
44
59
* Status-MQTT-HomeAssistant: Processes the security system status and allows for control with [Home Assistant](https://www.home-assistant.io) via MQTT. This uses the armed and alarm states for the HomeAssistant [Alarm Control Panel](https://www.home-assistant.io/components/alarm_control_panel.mqtt) component, as well as fire alarm and zone states for the [Binary Sensor](https://www.home-assistant.io/components/binary_sensor.mqtt) component.
45
60
46
61
* Status-Homey: Processes the security system status and allows for control using [Athom Homey](https://www.athom.com/en/) and the [Homeyduino](https://github.com/athombv/homey-arduino-library/) library, including armed, alarm, fire, and zone states.
@@ -103,7 +118,7 @@ Keys are sent to partition 1 by default and can be changed to a different partit
103
118
Examples:
104
119
* Switch to partition 2 and send keys: `/2` + `1234`
105
120
* Switch back to partition 1: `/1`
106
-
* Set directly in sketch: `dsc.writePartition = 1`
121
+
* Set directly in sketch: `dsc.writePartition = 1;`
107
122
108
123
## DSC Configuration
109
124
Panel options affecting this interface, configured by `*8 + installer code`:
@@ -112,8 +127,13 @@ Panel options affecting this interface, configured by `*8 + installer code`:
112
127
This section also sets the delay in reporting AC power failure to 30 minutes by default and can be set to 000 for no delay.
113
128
114
129
## Notes
115
-
* Memory usage can be reduced by lowering the number of partitions and zones specified in `src/dscKeybusInterface.h`. By default, Arduino monitors up to 4 partitions/32 zones and esp8266 monitors up to 8 partitions/64 zones.
116
-
* Support for the esp32 and other platforms depends on adjusting the code to use their platform-specific timers. In addition to hardware interrupts to capture the DSC clock, this library uses platform-specific timer interrupts to capture the DSC data line in a non-blocking way 250us after the clock changes (without using `delayMicroseconds()`). This is necessary because the clock and data are asynchronous - I observed keypad data delayed up to 160us after the clock falls.
130
+
* Memory usage can be adjusted based on the number of partitions, zones, and data buffer size specified in `src/dscKeybusInterface.h`. Default settings:
131
+
* Arduino: up to 4 partitions, 32 zones, 10 buffered commands
132
+
* esp8266: up to 8 partitions, 64 zones, 50 buffered commands
133
+
134
+
* PCB layouts are available in `extras/PCB Layouts` - thanks to [sjlouw](https://github.com/sj-louw) for contributing these designs!
135
+
136
+
* Support for the esp32 and other platforms depends on adjusting the code to use their platform-specific timers. In addition to hardware interrupts to capture the DSC clock, this library uses platform-specific timer interrupts to capture the DSC data line in a non-blocking way 250us after the clock changes (without using `delayMicroseconds()`). This is necessary because the clock and data are asynchronous - I've observed keypad data delayed up to 160us after the clock falls.
117
137
118
138
## References
119
139
[AVR Freaks - DSC Keybus Protocol](https://www.avrfreaks.net/forum/dsc-keybus-protocol): An excellent discussion on how data is sent on the Keybus.
0 commit comments