diff --git a/README.md b/README.md index 254cb15..202bd9a 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,35 @@ -_**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!)._ - # DSC Keybus Interface -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. +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. 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: ![dscHomeKit](https://user-images.githubusercontent.com/12835671/39588413-5a99099a-4ec1-11e8-9a2e-e332fa2d6379.jpg) ## Features -* Tested DSC panels: PC1555MX, PC5015, PC1616, PC1832, PC1864 -* Partitions: 1-8, zones: 1-64 -* Virtual keypad: supports sending keys to the panel for partitions 1 and 2 -* Data buffering: helps prevent missing Keybus data when the sketch is busy -* Non-blocking code: allows sketches to run as quickly as possible without using `delay` or `delayMicroseconds`. +* Status tracking of armed/alarm/fire states for partitions 1-8 +* Status tracking of zones 1-64 +* Virtual keypad: Enables writing keys to the panel for partitions 1 and 2 +* Data buffering: Helps prevent missing Keybus data when the sketch is busy +* Non-blocking code: Allows sketches to run as quickly as possible without using `delay` or `delayMicroseconds`. +* 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. + +## Release notes +* 0.3 + - New: Status for partitions 2-8, zones 33-64 + - New: Virtual keypad support for partition 2 + - New: [Athom Homey](https://www.athom.com/en/) integration example sketch, contributed by [MagnusPer](https://github.com/MagnusPer) + - New: PCB layouts, contributed by [sjlouw](https://github.com/sj-louw) + - New: Configurable number of partitions and zones to customize memory usage: `dscPartitions` and `dscZones` in `dscKeybusInterface.h` + - New: KeybusReader decoding of commands `0xE6` and `0xEB` + - Changed: Split examples by platform + - Changed: MQTT examples updated with username and password fields + - Changed: `processRedundantData` now true by default to prevent storing repetitive data, reduces memory usage. + - Note: This release changes the library methods to accomodate multiple partitions, existing sketches will need to be updated to match the new example sketches. +* 0.2 + - New: Status for zones 9-32 + - New: HomeAssistant integration example sketch + - 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). +* 0.1 - Initial release ## Usage 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,14 +41,14 @@ Download the repo and extract to the Arduino library directory or [install throu See `src/dscKeybusPrintData.cpp` for all currently known Keybus protocol commands and messages. Issues and pull requests with additions/corrections are welcome! -* 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: - * Armed away/stay/disarmed - * Partition in alarm - * Zones +* 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: + * Partitions armed away/stay/disarmed + * Partitions in alarm + * Partitions exit delay in progress + * Partitions entry delay in progress + * Partitions fire alarm + * Zones open/closed * Zones in alarm - * Exit delay in progress - * Entry delay in progress - * Fire * Keypad fire/auxiliary/panic alarm * Panel AC power * Panel battery @@ -39,8 +56,6 @@ Download the repo and extract to the Arduino library directory or [install throu * 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. - 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) - * 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. * 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 Examples: * Switch to partition 2 and send keys: `/2` + `1234` * Switch back to partition 1: `/1` - * Set directly in sketch: `dsc.writePartition = 1` + * Set directly in sketch: `dsc.writePartition = 1;` ## DSC Configuration Panel options affecting this interface, configured by `*8 + installer code`: @@ -112,8 +127,13 @@ Panel options affecting this interface, configured by `*8 + installer code`: 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. ## Notes -* 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. -* 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. +* Memory usage can be adjusted based on the number of partitions, zones, and data buffer size specified in `src/dscKeybusInterface.h`. Default settings: + * Arduino: up to 4 partitions, 32 zones, 10 buffered commands + * esp8266: up to 8 partitions, 64 zones, 50 buffered commands + +* PCB layouts are available in `extras/PCB Layouts` - thanks to [sjlouw](https://github.com/sj-louw) for contributing these designs! + +* 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. ## References [AVR Freaks - DSC Keybus Protocol](https://www.avrfreaks.net/forum/dsc-keybus-protocol): An excellent discussion on how data is sent on the Keybus. diff --git a/examples/Arduino/KeybusReader/KeybusReader.ino b/examples/Arduino/KeybusReader/KeybusReader.ino index f3d0963..1f2435a 100644 --- a/examples/Arduino/KeybusReader/KeybusReader.ino +++ b/examples/Arduino/KeybusReader/KeybusReader.ino @@ -1,32 +1,28 @@ /* - * DSC Keybus Reader (Arduino, esp8266) + * DSC Keybus Reader (Arduino) * * Decodes and prints data from the Keybus to a serial interface, including reading from serial for the virtual * keypad. This is primarily to help decode the Keybus protocol - see the Status examples to put the interface * to productive use. * * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- Arduino ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (Arduino Uno: 2,3) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (Arduino Uno: 2-12) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) - * | - * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) + * DSC Aux(+) --- Arduino Vin pin * * Virtual keypad uses an NPN transistor to pull the data line low - most small signal NPN transistors should * be suitable, for example: @@ -43,9 +39,9 @@ // Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the // virtual keypad. -#define dscClockPin 3 // Arduino Uno: 2,3 esp8266: D1, D2, D8 (GPIO 5, 4, 15) -#define dscReadPin 4 // Arduino Uno: 2-12 esp8266: D1, D2, D8 (GPIO 5, 4, 15) -#define dscWritePin 5 // Arduino Uno: 2-12 esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscClockPin 3 // Arduino Uno hardware interrupt pin: 2,3 +#define dscReadPin 5 // Arduino Uno: 2-12 +#define dscWritePin 6 // Arduino Uno: 2-12 dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin); diff --git a/examples/Arduino/Status-MQTT-HomeAssistant/Status-MQTT-HomeAssistant.ino b/examples/Arduino/Status-MQTT-HomeAssistant/Status-MQTT-HomeAssistant.ino index b47abc1..7df0b99 100644 --- a/examples/Arduino/Status-MQTT-HomeAssistant/Status-MQTT-HomeAssistant.ino +++ b/examples/Arduino/Status-MQTT-HomeAssistant/Status-MQTT-HomeAssistant.ino @@ -1,5 +1,5 @@ /* - * DSC Status with MQTT (Arduino, esp8266) + * DSC Status with MQTT (Arduino) * * Processes the security system status and allows for control using Home Assistant via MQTT. * @@ -92,27 +92,23 @@ payload_off: "0" * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- Arduino ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (Arduino Uno: 2,3) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (Arduino Uno: 2-12) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) - * | - * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) + * DSC Aux(+) --- Arduino Vin pin * * Virtual keypad uses an NPN transistor to pull the data line low - most small signal NPN transistors should * be suitable, for example: @@ -125,23 +121,19 @@ * This example code is in the public domain. */ -#include +#include +#include #include #include -// Set the MAC address -byte mac[] = {0x00, 0x1A, 0x11, 0xB2, 0xDE, 0x0B}; +byte mac[] = { 0xAA, 0x61, 0x0A, 0x00, 0x00, 0x01 }; // Set a MAC address unique to the local network -// Set fallback IP address if DHCP fails -IPAddress ip(169, 254, 254, 254); -// byte server[] = {172, 16, 100, 200}; - -// Set the broker server IP -const char* mqttServer = ""; -const char* mqttUsername = ""; -const char* mqttPassword = ""; -const char* accessCode = ""; // An access code is required to disarm/night arm and may be required to arm based on panel configuration. +const char* accessCode = ""; // An access code is required to disarm/night arm and may be required to arm based on panel configuration. +const char* mqttServer = ""; // MQTT server domain name or IP address +const int mqttPort = 1883; // MQTT server port +const char* mqttUsername = ""; // Optional, leave blank if not required +const char* mqttPassword = ""; // Optional, leave blank if not required const char* mqttClientName = "dscKeybusInterface"; const char* mqttPartitionTopic = "dsc/Get/Partition"; // Sends armed and alarm status per partition: dsc/Get/Partition1 ... dsc/Get/Partition8 const char* mqttZoneTopic = "dsc/Get/Zone"; // Sends zone status per zone: dsc/Get/Zone1 ... dsc/Get/Zone64 @@ -150,14 +142,13 @@ const char* mqttSubscribeTopic = "dsc/Set"; // Receives messages to w unsigned long mqttPreviousTime; EthernetClient ethClient; -PubSubClient mqtt(ethClient); - -// Configures the Keybus interface with the specified pins - dscWritePin is -// optional, leaving it out disables the virtual keypad -// Not using PIN4 on Arduino, as some ethernet shields use it. -#define dscClockPin 3 -#define dscReadPin 5 -#define dscWritePin 6 +PubSubClient mqtt(mqttServer, mqttPort, ethClient); + +// Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the +// virtual keypad. +#define dscClockPin 3 // Arduino Uno hardware interrupt pin: 2,3 +#define dscReadPin 5 // Arduino Uno: 2-12 +#define dscWritePin 6 // Arduino Uno: 2-12 dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin); @@ -166,18 +157,16 @@ void setup() { Serial.println(); Serial.println(); - if (Ethernet.begin(mac) == 0) { - Serial.println("Failed to configure Ethernet using DHCP"); - // no point in carrying on, so do nothing forevermore. - for (;;) - ; + // Initializes ethernet with DHCP + Serial.print(F("Initializing Ethernet...")); + while(!Ethernet.begin(mac)) { + Serial.println(F("DHCP failed. Retrying...")); + delay(5000); } - - // print your local IP address: + Serial.println(F("success!")); + Serial.print(F("IP address: ")); Serial.println(Ethernet.localIP()); - mqtt.setClient(ethClient); - mqtt.setServer(mqttServer, 1883); mqtt.setCallback(mqttCallback); if (mqttConnect()) mqttPreviousTime = millis(); else mqttPreviousTime = 0; @@ -208,69 +197,69 @@ void loop() { } // Publishes status per partition - for (byte partitionIndex = 0; partitionIndex < dscPartitions; partitionIndex++) { + for (byte partition = 0; partition < dscPartitions; partition++) { // Publishes exit delay status - if (dsc.exitDelayChanged[partitionIndex]) { - dsc.exitDelayChanged[partitionIndex] = false; // Resets the exit delay status flag + if (dsc.exitDelayChanged[partition]) { + dsc.exitDelayChanged[partition] = false; // Resets the exit delay status flag // Appends the mqttPartitionTopic with the partition number char publishTopic[strlen(mqttPartitionTopic) + 1]; - char partition[2]; + char partitionNumber[2]; strcpy(publishTopic, mqttPartitionTopic); - itoa(partitionIndex + 1, partition, 10); - strcat(publishTopic, partition); + itoa(partition + 1, partitionNumber, 10); + strcat(publishTopic, partitionNumber); - if (dsc.exitDelay[partitionIndex]) mqtt.publish(publishTopic, "pending", true); // Publish as a retained message - else if (!dsc.exitDelay[partitionIndex] && !dsc.armed[partitionIndex]) mqtt.publish(publishTopic, "disarmed", true); + if (dsc.exitDelay[partition]) mqtt.publish(publishTopic, "pending", true); // Publish as a retained message + else if (!dsc.exitDelay[partition] && !dsc.armed[partition]) mqtt.publish(publishTopic, "disarmed", true); } // Publishes armed/disarmed status - if (dsc.armedChanged[partitionIndex]) { - dsc.armedChanged[partitionIndex] = false; // Resets the partition armed status flag + if (dsc.armedChanged[partition]) { + dsc.armedChanged[partition] = false; // Resets the partition armed status flag // Appends the mqttPartitionTopic with the partition number char publishTopic[strlen(mqttPartitionTopic) + 1]; - char partition[2]; + char partitionNumber[2]; strcpy(publishTopic, mqttPartitionTopic); - itoa(partitionIndex + 1, partition, 10); - strcat(publishTopic, partition); + itoa(partition + 1, partitionNumber, 10); + strcat(publishTopic, partitionNumber); - if (dsc.armed[partitionIndex]) { - if (dsc.armedAway[partitionIndex]) mqtt.publish(publishTopic, "armed_away", true); - else if (dsc.armedStay[partitionIndex]) mqtt.publish(publishTopic, "armed_home", true); + if (dsc.armed[partition]) { + if (dsc.armedAway[partition]) mqtt.publish(publishTopic, "armed_away", true); + else if (dsc.armedStay[partition]) mqtt.publish(publishTopic, "armed_home", true); } else mqtt.publish(publishTopic, "disarmed", true); } // Publishes alarm status - if (dsc.alarmChanged[partitionIndex]) { - dsc.alarmChanged[partitionIndex] = false; // Resets the partition alarm status flag - if (dsc.alarm[partitionIndex]) { + if (dsc.alarmChanged[partition]) { + dsc.alarmChanged[partition] = false; // Resets the partition alarm status flag + if (dsc.alarm[partition]) { // Appends the mqttPartitionTopic with the partition number char publishTopic[strlen(mqttPartitionTopic) + 1]; - char partition[2]; + char partitionNumber[2]; strcpy(publishTopic, mqttPartitionTopic); - itoa(partitionIndex + 1, partition, 10); - strcat(publishTopic, partition); + itoa(partition + 1, partitionNumber, 10); + strcat(publishTopic, partitionNumber); mqtt.publish(publishTopic, "triggered", true); // Alarm tripped } } - // Publishes alarm status - if (dsc.fireChanged[partitionIndex]) { - dsc.fireChanged[partitionIndex] = false; // Resets the fire status flag + // Publishes fire alarm status + if (dsc.fireChanged[partition]) { + dsc.fireChanged[partition] = false; // Resets the fire status flag // Appends the mqttFireTopic with the partition number char firePublishTopic[strlen(mqttFireTopic) + 1]; - char partition[2]; + char partitionNumber[2]; strcpy(firePublishTopic, mqttFireTopic); - itoa(partitionIndex + 1, partition, 10); - strcat(firePublishTopic, partition); + itoa(partition + 1, partitionNumber, 10); + strcat(firePublishTopic, partitionNumber); - if (dsc.fire[partitionIndex]) mqtt.publish(firePublishTopic, "1"); // Fire alarm tripped + if (dsc.fire[partition]) mqtt.publish(firePublishTopic, "1"); // Fire alarm tripped else mqtt.publish(firePublishTopic, "0"); // Fire alarm restored } } @@ -316,33 +305,33 @@ void mqttCallback(char* topic, byte* payload, unsigned int length) { (void)topic; (void)length; - byte partitionIndex = 0; + byte partition = 0; byte payloadIndex = 0; // Checks if a partition number 1-8 has been sent and sets the second character as the payload if (payload[0] >= 0x31 && payload[0] <= 0x38) { - partitionIndex = payload[0] - 49; + partition = payload[0] - 49; payloadIndex = 1; } // Arm stay - if (payload[payloadIndex] == 'S' && !dsc.armed[partitionIndex] && !dsc.exitDelay[partitionIndex]) { + if (payload[payloadIndex] == 'S' && !dsc.armed[partition] && !dsc.exitDelay[partition]) { while (!dsc.writeReady) dsc.handlePanel(); // Continues processing Keybus data until ready to write - dsc.writePartition = partitionIndex + 1; // Sets writes to the partition number + dsc.writePartition = partition + 1; // Sets writes to the partition number dsc.write('s'); // Virtual keypad arm stay } // Arm away - else if (payload[payloadIndex] == 'A' && !dsc.armed[partitionIndex] && !dsc.exitDelay[partitionIndex]) { + else if (payload[payloadIndex] == 'A' && !dsc.armed[partition] && !dsc.exitDelay[partition]) { while (!dsc.writeReady) dsc.handlePanel(); // Continues processing Keybus data until ready to write - dsc.writePartition = partitionIndex + 1; // Sets writes to the partition number + dsc.writePartition = partition + 1; // Sets writes to the partition number dsc.write('w'); // Virtual keypad arm away } // Disarm - else if (payload[payloadIndex] == 'D' && (dsc.armed[partitionIndex] || dsc.exitDelay[partitionIndex])) { + else if (payload[payloadIndex] == 'D' && (dsc.armed[partition] || dsc.exitDelay[partition])) { while (!dsc.writeReady) dsc.handlePanel(); // Continues processing Keybus data until ready to write - dsc.writePartition = partitionIndex + 1; // Sets writes to the partition number + dsc.writePartition = partition + 1; // Sets writes to the partition number dsc.write(accessCode); } } diff --git a/examples/Arduino/Status-MQTT-Homebridge/Status-MQTT-Homebridge.ino b/examples/Arduino/Status-MQTT-Homebridge/Status-MQTT-Homebridge.ino new file mode 100644 index 0000000..c182fa7 --- /dev/null +++ b/examples/Arduino/Status-MQTT-Homebridge/Status-MQTT-Homebridge.ino @@ -0,0 +1,442 @@ +/* + * DSC Status with MQTT (Arduino) + * + * 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 and the homebridge-mqttthing plugin 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. + * + * Homebridge: https://github.com/nfarina/homebridge + * homebridge-mqttthing: https://github.com/arachnetech/homebridge-mqttthing + * Mosquitto MQTT broker: https://mosquitto.org + * + * For a single partition, the commands to set the alarm state are setup in Homebridge as: + * Stay arm: "S" + * Away arm: "A" + * Night arm (arm without an entry delay): "N" + * Disarm: "D" + * + * For multiple partitions, add the partition number as a prefix to the command: + * Partition 1 stay arm: "1S" + * Partition 1 away arm: "1A" + * Partition 2 night arm (arm without an entry delay): "2N" + * Partition 2 disarm: "2D" + * + * The interface listens for commands in the configured mqttSubscribeTopic, and publishes partition status in a + * separate topic per partition with the configured mqttPartitionTopic appended with the partition number: + * Stay arm: "SA" + * Away arm: "AA" + * Night arm: "NA" + * Disarm: "D" + * Alarm tripped: "T" + * + * Zone states are published in a separate topic per zone with the configured mqttZoneTopic appended with the zone + * number. The zone state is published as an integer: + * "0": closed + * "1": open + * + * Fire states are published in a separate topic per partition with the configured mqttFireTopic appended with the + * partition number. The fire state is published as an integer: + * "0": fire alarm restored + * "1": fire alarm tripped + * + * Example Homebridge config.json "accessories" configuration for a single partition: + + { + "accessory": "mqttthing", + "type": "securitySystem", + "name": "Security System", + "url": "http://127.0.0.1:1883", + "topics": + { + "getCurrentState": "dsc/Get/Partition1", + "setTargetState": "dsc/Set" + }, + "targetStateValues": ["S", "A", "N", "D"] + }, + { + "accessory": "mqttthing", + "type": "contactSensor", + "name": "Zone 1", + "url": "http://127.0.0.1:1883", + "topics": + { + "getContactSensorState": "dsc/Get/Zone1" + }, + "integerValue": "true" + }, + { + "accessory": "mqttthing", + "type": "contactSensor", + "name": "Zone 8", + "url": "http://127.0.0.1:1883", + "topics": + { + "getContactSensorState": "dsc/Get/Zone8" + }, + "integerValue": "true" + }, + { + "accessory": "mqttthing", + "type": "smokeSensor", + "name": "Smoke Alarm", + "url": "http://127.0.0.1:1883", + "topics": + { + "getSmokeDetected": "dsc/Get/Fire1" + }, + "integerValue": "true" + } + + * Example Homebridge config.json "accessories" configuration for multiple partitions: + + { + "accessory": "mqttthing", + "type": "securitySystem", + "name": "Security System Partition 1", + "url": "http://127.0.0.1:1883", + "topics": + { + "getCurrentState": "dsc/Get/Partition1", + "setTargetState": "dsc/Set" + }, + "targetStateValues": ["1S", "1A", "1N", "1D"] + }, + { + "accessory": "mqttthing", + "type": "securitySystem", + "name": "Security System Partition 2", + "url": "http://127.0.0.1:1883", + "topics": + { + "getCurrentState": "dsc/Get/Partition2", + "setTargetState": "dsc/Set" + }, + "targetStateValues": ["2S", "2A", "2N", "2D"] + }, + { + "accessory": "mqttthing", + "type": "contactSensor", + "name": "Zone 1", + "url": "http://127.0.0.1:1883", + "topics": + { + "getContactSensorState": "dsc/Get/Zone1" + }, + "integerValue": "true" + }, + { + "accessory": "mqttthing", + "type": "contactSensor", + "name": "Zone 8", + "url": "http://127.0.0.1:1883", + "topics": + { + "getContactSensorState": "dsc/Get/Zone8" + }, + "integerValue": "true" + }, + { + "accessory": "mqttthing", + "type": "smokeSensor", + "name": "Smoke Alarm Partition 1", + "url": "http://127.0.0.1:1883", + "topics": + { + "getSmokeDetected": "dsc/Get/Fire1" + }, + "integerValue": "true" + } + { + "accessory": "mqttthing", + "type": "smokeSensor", + "name": "Smoke Alarm Partition 2", + "url": "http://127.0.0.1:1883", + "topics": + { + "getSmokeDetected": "dsc/Get/Fire2" + }, + "integerValue": "true" + } + + * Wiring: + * DSC Aux(-) --- Arduino ground + * + * +--- dscClockPin (Arduino Uno: 2,3) + * DSC Yellow --- 15k ohm resistor ---| + * +--- 10k ohm resistor --- Ground + * + * +--- dscReadPin (Arduino Uno: 2-12) + * DSC Green ---- 15k ohm resistor ---| + * +--- 10k ohm resistor --- Ground + * + * Virtual keypad (optional): + * DSC Green ---- NPN collector --\ + * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12) + * Ground --- NPN emitter --/ + * + * Power (when disconnected from USB): + * DSC Aux(+) --- Arduino Vin pin + * + * Virtual keypad uses an NPN transistor to pull the data line low - most small signal NPN transistors should + * be suitable, for example: + * -- 2N3904 + * -- BC547, BC548, BC549 + * + * Issues and (especially) pull requests are welcome: + * https://github.com/taligentx/dscKeybusInterface + * + * This example code is in the public domain. + */ + +#include +#include +#include +#include + +byte mac[] = { 0xAA, 0x61, 0x0A, 0x00, 0x00, 0x01 }; // Set a MAC address unique to the local network + +const char* accessCode = ""; // An access code is required to disarm/night arm and may be required to arm based on panel configuration. + +const char* mqttServer = ""; // MQTT server domain name or IP address +const int mqttPort = 1883; // MQTT server port +const char* mqttUsername = ""; // Optional, leave blank if not required +const char* mqttPassword = ""; // Optional, leave blank if not required +const char* mqttClientName = "dscKeybusInterface"; +const char* mqttPartitionTopic = "dsc/Get/Partition"; // Sends armed and alarm status per partition: dsc/Get/Partition1 ... dsc/Get/Partition8 +const char* mqttZoneTopic = "dsc/Get/Zone"; // Sends zone status per zone: dsc/Get/Zone1 ... dsc/Get/Zone64 +const char* mqttFireTopic = "dsc/Get/Fire"; // Sends fire status per partition: dsc/Get/Fire1 ... dsc/Get/Fire8 +const char* mqttSubscribeTopic = "dsc/Set"; // Receives messages to write to the panel +unsigned long mqttPreviousTime; + +EthernetClient ethClient; +PubSubClient mqtt(mqttServer, mqttPort, ethClient); + +// Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the +// virtual keypad. +#define dscClockPin 3 // Arduino Uno hardware interrupt pin: 2,3 +#define dscReadPin 5 // Arduino Uno: 2-12 +#define dscWritePin 6 // Arduino Uno: 2-12 +dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin); + + +void setup() { + Serial.begin(115200); + Serial.println(); + Serial.println(); + + // Initializes ethernet with DHCP + Serial.print(F("Initializing Ethernet...")); + while(!Ethernet.begin(mac)) { + Serial.println(F("DHCP failed. Retrying...")); + delay(5000); + } + Serial.println(F("success!")); + Serial.print(F("IP address: ")); + Serial.println(Ethernet.localIP()); + + mqtt.setCallback(mqttCallback); + if (mqttConnect()) mqttPreviousTime = millis(); + else mqttPreviousTime = 0; + + // Starts the Keybus interface and optionally specifies how to print data. + // begin() sets Serial by default and can accept a different stream: begin(Serial1), etc. + dsc.begin(); + + Serial.println(F("DSC Keybus Interface is online.")); +} + + +void loop() { + mqttHandle(); + + if (dsc.handlePanel() && dsc.statusChanged) { // Processes data only when a valid Keybus command has been read + dsc.statusChanged = false; // Reset the status tracking flag + + // If the Keybus data buffer is exceeded, the sketch is too busy to process all Keybus commands. Call + // handlePanel() more often, or increase dscBufferSize in the library: src/dscKeybusInterface.h + if (dsc.bufferOverflow) Serial.println(F("Keybus buffer overflow")); + dsc.bufferOverflow = false; + + // Sends the access code when needed by the panel for arming + if (dsc.accessCodePrompt && dsc.writeReady) { + dsc.accessCodePrompt = false; + dsc.write(accessCode); + } + + // Publishes status per partition + for (byte partition = 0; partition < dscPartitions; partition++) { + + // Publishes armed/disarmed status + if (dsc.armedChanged[partition]) { + dsc.armedChanged[partition] = false; // Resets the partition armed status flag + + // Appends the mqttPartitionTopic with the partition number + char publishTopic[strlen(mqttPartitionTopic) + 1]; + char partitionNumber[2]; + strcpy(publishTopic, mqttPartitionTopic); + itoa(partition + 1, partitionNumber, 10); + strcat(publishTopic, partitionNumber); + + if (dsc.armed[partition]) { + if (dsc.armedAway[partition] && dsc.noEntryDelay[partition]) mqtt.publish(publishTopic, "NA", true); // Night armed + else if (dsc.armedAway[partition]) mqtt.publish(publishTopic, "AA", true); // Away armed + else if (dsc.armedStay[partition] && dsc.noEntryDelay[partition]) mqtt.publish(publishTopic, "NA", true); // Night armed + else if (dsc.armedStay[partition]) mqtt.publish(publishTopic, "SA", true); // Stay armed + } + else mqtt.publish(publishTopic, "D", true); // Disarmed + } + + // Publishes alarm triggered status + if (dsc.alarmChanged[partition]) { + dsc.alarmChanged[partition] = false; // Resets the partition alarm status flag + if (dsc.alarm[partition]) { + + // Appends the mqttPartitionTopic with the partition number + char publishTopic[strlen(mqttPartitionTopic) + 1]; + char partitionNumber[2]; + strcpy(publishTopic, mqttPartitionTopic); + itoa(partition + 1, partitionNumber, 10); + strcat(publishTopic, partitionNumber); + + mqtt.publish(publishTopic, "T", true); // Alarm tripped + } + } + + // Publishes status when the system is disarmed during exit delay + if (dsc.exitDelayChanged[partition] && !dsc.exitDelay[partition] && !dsc.armed[partition]) { + + // Appends the mqttPartitionTopic with the partition number + char publishTopic[strlen(mqttPartitionTopic) + 1]; + char partitionNumber[2]; + strcpy(publishTopic, mqttPartitionTopic); + itoa(partition + 1, partitionNumber, 10); + strcat(publishTopic, partitionNumber); + + mqtt.publish(publishTopic, "D", true); // Disarmed + } + + // Publishes fire alarm status + if (dsc.fireChanged[partition]) { + dsc.fireChanged[partition] = false; // Resets the fire status flag + + // Appends the mqttFireTopic with the partition number + char firePublishTopic[strlen(mqttFireTopic) + 1]; + char partitionNumber[2]; + strcpy(firePublishTopic, mqttFireTopic); + itoa(partition + 1, partitionNumber, 10); + strcat(firePublishTopic, partitionNumber); + + if (dsc.fire[partition]) mqtt.publish(firePublishTopic, "1"); // Fire alarm tripped + else mqtt.publish(firePublishTopic, "0"); // Fire alarm restored + } + } + + // Publishes zones 1-64 status in a separate topic per zone + // Zone status is stored in the openZones[] and openZonesChanged[] arrays using 1 bit per zone, up to 64 zones: + // openZones[0] and openZonesChanged[0]: Bit 0 = Zone 1 ... Bit 7 = Zone 8 + // openZones[1] and openZonesChanged[1]: Bit 0 = Zone 9 ... Bit 7 = Zone 16 + // ... + // openZones[7] and openZonesChanged[7]: Bit 0 = Zone 57 ... Bit 7 = Zone 64 + if (dsc.openZonesStatusChanged) { + dsc.openZonesStatusChanged = false; // Resets the open zones status flag + for (byte zoneGroup = 0; zoneGroup < dscZones; zoneGroup++) { + for (byte zoneBit = 0; zoneBit < 8; zoneBit++) { + if (bitRead(dsc.openZonesChanged[zoneGroup], zoneBit)) { // Checks an individual open zone status flag + bitWrite(dsc.openZonesChanged[zoneGroup], zoneBit, 0); // Resets the individual open zone status flag + + // Appends the mqttZoneTopic with the zone number + char zonePublishTopic[strlen(mqttZoneTopic) + 2]; + char zone[3]; + strcpy(zonePublishTopic, mqttZoneTopic); + itoa(zoneBit + 1 + (zoneGroup * 8), zone, 10); + strcat(zonePublishTopic, zone); + + if (bitRead(dsc.openZones[zoneGroup], zoneBit)) { + mqtt.publish(zonePublishTopic, "1", true); // Zone open + } + else mqtt.publish(zonePublishTopic, "0", true); // Zone closed + } + } + } + } + + mqtt.subscribe(mqttSubscribeTopic); + } +} + +// Handles messages received in the mqttSubscribeTopic +void mqttCallback(char* topic, byte* payload, unsigned int length) { + + // Handles unused parameters + (void)topic; + (void)length; + + byte partition = 0; + byte payloadIndex = 0; + + // Checks if a partition number 1-8 has been sent and sets the second character as the payload + if (payload[0] >= 0x31 && payload[0] <= 0x38) { + partition = payload[0] - 49; + payloadIndex = 1; + } + + // homebridge-mqttthing STAY_ARM + if (payload[payloadIndex] == 'S' && !dsc.armed[partition] && !dsc.exitDelay[partition]) { + while (!dsc.writeReady) dsc.handlePanel(); // Continues processing Keybus data until ready to write + dsc.writePartition = partition + 1; // Sets writes to the partition number + dsc.write('s'); // Keypad stay arm + } + + // homebridge-mqttthing AWAY_ARM + else if (payload[payloadIndex] == 'A' && !dsc.armed[partition] && !dsc.exitDelay[partition]) { + while (!dsc.writeReady) dsc.handlePanel(); // Continues processing Keybus data until ready to write + dsc.writePartition = partition + 1; // Sets writes to the partition number + dsc.write('w'); // Keypad away arm + } + + // homebridge-mqttthing NIGHT_ARM + else if (payload[payloadIndex] == 'N' && !dsc.armed[partition] && !dsc.exitDelay[partition]) { + while (!dsc.writeReady) dsc.handlePanel(); // Continues processing Keybus data until ready to write + dsc.writePartition = partition + 1; // Sets writes to the partition number + dsc.write('n'); // Keypad arm with no entry delay + } + + // homebridge-mqttthing DISARM + else if (payload[payloadIndex] == 'D' && (dsc.armed[partition] || dsc.exitDelay[partition])) { + while (!dsc.writeReady) dsc.handlePanel(); // Continues processing Keybus data until ready to write + dsc.writePartition = partition + 1; // Sets writes to the partition number + dsc.write(accessCode); + } +} + + +void mqttHandle() { + if (!mqtt.connected()) { + unsigned long mqttCurrentTime = millis(); + if (mqttCurrentTime - mqttPreviousTime > 5000) { + mqttPreviousTime = mqttCurrentTime; + if (mqttConnect()) { + Serial.println(F("MQTT disconnected, successfully reconnected.")); + mqttPreviousTime = 0; + } + else Serial.println(F("MQTT disconnected, failed to reconnect.")); + } + } + else mqtt.loop(); +} + + +bool mqttConnect() { + if (mqtt.connect(mqttClientName, mqttUsername, mqttPassword)) { + Serial.print(F("MQTT connected: ")); + Serial.println(mqttServer); + mqtt.subscribe(mqttSubscribeTopic); + } + else { + Serial.print(F("MQTT connection failed: ")); + Serial.println(mqttServer); + } + return mqtt.connected(); +} + diff --git a/examples/Arduino/Status/Status.ino b/examples/Arduino/Status/Status.ino index 3ff7a88..05c10bf 100644 --- a/examples/Arduino/Status/Status.ino +++ b/examples/Arduino/Status/Status.ino @@ -1,32 +1,28 @@ /* - * DSC Status (Arduino, esp8266) + * DSC Status (Arduino) * * 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. * * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- Arduino ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (Arduino Uno: 2,3) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (Arduino Uno: 2-12) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) - * | - * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) + * DSC Aux(+) --- Arduino Vin pin * * Virtual keypad uses an NPN transistor to pull the data line low - most small signal NPN transistors should * be suitable, for example: @@ -41,11 +37,11 @@ #include -// Configures the Keybus interface with the specified pins - dscWritePin is -// optional, leaving it out disables the virtual keypad -#define dscClockPin 3 // Arduino Uno: 2,3 esp8266: D1, D2, D8 (GPIO 5, 4, 15) -#define dscReadPin 4 // Arduino Uno: 2-12 esp8266: D1, D2, D8 (GPIO 5, 4, 15) -#define dscWritePin 5 // Arduino Uno: 2-12 esp8266: D1, D2, D8 (GPIO 5, 4, 15) +// Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the +// virtual keypad. +#define dscClockPin 3 // Arduino Uno hardware interrupt pin: 2,3 +#define dscReadPin 5 // Arduino Uno: 2-12 +#define dscWritePin 6 // Arduino Uno: 2-12 dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin); diff --git a/examples/esp8266/KeybusReader/KeybusReader.ino b/examples/esp8266/KeybusReader/KeybusReader.ino index 0afbdea..a30d4e4 100644 --- a/examples/esp8266/KeybusReader/KeybusReader.ino +++ b/examples/esp8266/KeybusReader/KeybusReader.ino @@ -1,30 +1,28 @@ /* - * DSC Keybus Reader (Arduino, esp8266) + * DSC Keybus Reader (esp8266) * * Decodes and prints data from the Keybus to a serial interface, including reading from serial for the virtual * keypad. This is primarily to help decode the Keybus protocol - see the Status examples to put the interface * to productive use. * * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- esp8266 ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (esp8266: D1, D2, D8) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (esp8266: D1, D2, D8) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (esp8266: D1, D2, D8) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) + * DSC Aux(+) ---+--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) * | * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) * @@ -43,9 +41,9 @@ // Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the // virtual keypad. -#define dscClockPin D1 // Arduino Uno: 2,3 esp8266: D1, D2, D8 (GPIO 5, 4, 15) -#define dscReadPin D2 // Arduino Uno: 2-12 esp8266: D1, D2, D8 (GPIO 5, 4, 15) -#define dscWritePin D8 // Arduino Uno: 2-12 esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscClockPin D1 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscReadPin D2 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscWritePin D8 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin); diff --git a/examples/esp8266/Status-Email/Status-Email.ino b/examples/esp8266/Status-Email/Status-Email.ino index b979922..c5e7a61 100644 --- a/examples/esp8266/Status-Email/Status-Email.ino +++ b/examples/esp8266/Status-Email/Status-Email.ino @@ -1,5 +1,5 @@ /* - * DSC Status with email notification (esp8266 only, uses SSL) + * DSC Status with email notification (esp8266) * * Processes the security system status and demonstrates how to send an email when the status has changed. Configure * the email SMTP server settings in sendEmail(). @@ -9,25 +9,23 @@ * apps: https://support.google.com/accounts/answer/6010255 * * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- esp8266 ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (esp8266: D1, D2, D8) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (esp8266: D1, D2, D8) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (esp8266: D1, D2, D8) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) + * DSC Aux(+) ---+--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) * | * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) * @@ -50,9 +48,9 @@ const char* wifiPassword = ""; WiFiClientSecure smtpClient; -// Configures the Keybus interface with the specified pins -#define dscClockPin D1 // GPIO5 -#define dscReadPin D2 // GPIO4 +// Configures the Keybus interface with the specified pins. +#define dscClockPin D1 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscReadPin D2 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) dscKeybusInterface dsc(dscClockPin, dscReadPin); diff --git a/examples/esp8266/Status-Homey/Status-Homey.ino b/examples/esp8266/Status-Homey/Status-Homey.ino index 000eebe..998f2cf 100755 --- a/examples/esp8266/Status-Homey/Status-Homey.ino +++ b/examples/esp8266/Status-Homey/Status-Homey.ino @@ -12,25 +12,23 @@ * Zone states are published by Homey.trigger command including the zone number. * * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- esp8266 ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (esp8266: D1, D2, D8) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (esp8266: D1, D2, D8) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (esp8266: D1, D2, D8) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) + * DSC Aux(+) ---+--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) * | * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) * @@ -55,11 +53,11 @@ const char* wifiSSID = ""; const char* wifiPassword = ""; const char* accessCode = ""; // An access code is required to disarm/night arm and may be required to arm based on panel configuration. -// Configures the Keybus interface with the specified pins - dscWritePin is -// optional, leaving it out disables the virtual keypad -#define dscClockPin D1 // GPIO5 -#define dscReadPin D2 // GPIO4 -#define dscWritePin D8 // GPIO15 +// Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the +// virtual keypad. +#define dscClockPin D1 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscReadPin D2 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscWritePin D8 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin); diff --git a/examples/esp8266/Status-MQTT-HomeAssistant/Status-MQTT-HomeAssistant.ino b/examples/esp8266/Status-MQTT-HomeAssistant/Status-MQTT-HomeAssistant.ino index 0082675..977d707 100644 --- a/examples/esp8266/Status-MQTT-HomeAssistant/Status-MQTT-HomeAssistant.ino +++ b/examples/esp8266/Status-MQTT-HomeAssistant/Status-MQTT-HomeAssistant.ino @@ -1,5 +1,5 @@ /* - * DSC Status with MQTT (Arduino, esp8266) + * DSC Status with MQTT (esp8266) * * Processes the security system status and allows for control using Home Assistant via MQTT. * @@ -92,25 +92,23 @@ payload_off: "0" * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- esp8266 ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (esp8266: D1, D2, D8) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (esp8266: D1, D2, D8) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (esp8266: D1, D2, D8) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) + * DSC Aux(+) ---+--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) * | * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) * @@ -132,8 +130,11 @@ const char* wifiSSID = ""; const char* wifiPassword = ""; const char* accessCode = ""; // An access code is required to disarm/night arm and may be required to arm based on panel configuration. -const char* mqttServer = ""; +const char* mqttServer = ""; // MQTT server domain name or IP address +const int mqttPort = 1883; // MQTT server port +const char* mqttUsername = ""; // Optional, leave blank if not required +const char* mqttPassword = ""; // Optional, leave blank if not required const char* mqttClientName = "dscKeybusInterface"; const char* mqttPartitionTopic = "dsc/Get/Partition"; // Sends armed and alarm status per partition: dsc/Get/Partition1 ... dsc/Get/Partition8 const char* mqttZoneTopic = "dsc/Get/Zone"; // Sends zone status per zone: dsc/Get/Zone1 ... dsc/Get/Zone64 @@ -142,13 +143,13 @@ const char* mqttSubscribeTopic = "dsc/Set"; // Receives messages to w unsigned long mqttPreviousTime; WiFiClient wifiClient; -PubSubClient mqtt(wifiClient); +PubSubClient mqtt(mqttServer, mqttPort, wifiClient); -// Configures the Keybus interface with the specified pins - dscWritePin is -// optional, leaving it out disables the virtual keypad -#define dscClockPin D1 // GPIO5 -#define dscReadPin D2 // GPIO4 -#define dscWritePin D8 // GPIO15 +// Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the +// virtual keypad. +#define dscClockPin D1 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscReadPin D2 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscWritePin D8 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin); @@ -162,7 +163,6 @@ void setup() { Serial.print("WiFi connected: "); Serial.println(WiFi.localIP()); - mqtt.setServer(mqttServer, 1883); mqtt.setCallback(mqttCallback); if (mqttConnect()) mqttPreviousTime = millis(); else mqttPreviousTime = 0; @@ -350,7 +350,7 @@ void mqttHandle() { bool mqttConnect() { - if (mqtt.connect(mqttClientName)) { + if (mqtt.connect(mqttClientName, mqttUsername, mqttPassword)) { Serial.print(F("MQTT connected: ")); Serial.println(mqttServer); mqtt.subscribe(mqttSubscribeTopic); diff --git a/examples/esp8266/Status-MQTT-Homebridge/Status-MQTT-Homebridge.ino b/examples/esp8266/Status-MQTT-Homebridge/Status-MQTT-Homebridge.ino index f4dad31..f141f2c 100644 --- a/examples/esp8266/Status-MQTT-Homebridge/Status-MQTT-Homebridge.ino +++ b/examples/esp8266/Status-MQTT-Homebridge/Status-MQTT-Homebridge.ino @@ -1,5 +1,5 @@ /* - * DSC Status with MQTT (Arduino, esp8266) + * DSC Status with MQTT (esp8266) * * 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 and the homebridge-mqttthing plugin for HomeKit integration @@ -160,25 +160,23 @@ } * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- esp8266 ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (esp8266: D1, D2, D8) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (esp8266: D1, D2, D8) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (esp8266: D1, D2, D8) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) + * DSC Aux(+) ---+--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) * | * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) * @@ -200,8 +198,11 @@ const char* wifiSSID = ""; const char* wifiPassword = ""; const char* accessCode = ""; // An access code is required to disarm/night arm and may be required to arm based on panel configuration. -const char* mqttServer = ""; +const char* mqttServer = ""; // MQTT server domain name or IP address +const int mqttPort = 1883; // MQTT server port +const char* mqttUsername = ""; // Optional, leave blank if not required +const char* mqttPassword = ""; // Optional, leave blank if not required const char* mqttClientName = "dscKeybusInterface"; const char* mqttPartitionTopic = "dsc/Get/Partition"; // Sends armed and alarm status per partition: dsc/Get/Partition1 ... dsc/Get/Partition8 const char* mqttZoneTopic = "dsc/Get/Zone"; // Sends zone status per zone: dsc/Get/Zone1 ... dsc/Get/Zone64 @@ -210,13 +211,13 @@ const char* mqttSubscribeTopic = "dsc/Set"; // Receives messages to w unsigned long mqttPreviousTime; WiFiClient wifiClient; -PubSubClient mqtt(wifiClient); +PubSubClient mqtt(mqttServer, mqttPort, wifiClient); -// Configures the Keybus interface with the specified pins - dscWritePin is -// optional, leaving it out disables the virtual keypad -#define dscClockPin D1 // GPIO5 -#define dscReadPin D2 // GPIO4 -#define dscWritePin D8 // GPIO15 +// Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the +// virtual keypad. +#define dscClockPin D1 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscReadPin D2 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscWritePin D8 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin); @@ -230,7 +231,6 @@ void setup() { Serial.print("WiFi connected: "); Serial.println(WiFi.localIP()); - mqtt.setServer(mqttServer, 1883); mqtt.setCallback(mqttCallback); if (mqttConnect()) mqttPreviousTime = millis(); else mqttPreviousTime = 0; @@ -424,7 +424,7 @@ void mqttHandle() { bool mqttConnect() { - if (mqtt.connect(mqttClientName)) { + if (mqtt.connect(mqttClientName, mqttUsername, mqttPassword)) { Serial.print(F("MQTT connected: ")); Serial.println(mqttServer); mqtt.subscribe(mqttSubscribeTopic); diff --git a/examples/esp8266/Status-Pushbullet/Status-Pushbullet.ino b/examples/esp8266/Status-Pushbullet/Status-Pushbullet.ino index 6456e43..52ad014 100644 --- a/examples/esp8266/Status-Pushbullet/Status-Pushbullet.ino +++ b/examples/esp8266/Status-Pushbullet/Status-Pushbullet.ino @@ -1,29 +1,27 @@ /* - * DSC Status with push notification (esp8266 only, requires SSL) + * DSC Status with push notification (esp8266) * * Processes the security system status and demonstrates how to send a push notification when the status has changed. * This example sends notifications via Pushbullet: https://www.pushbullet.com * * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- esp8266 ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (esp8266: D1, D2, D8) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (esp8266: D1, D2, D8) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (esp8266: D1, D2, D8) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) + * DSC Aux(+) ---+--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) * | * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) * @@ -47,9 +45,9 @@ const char* pushToken = ""; // Set the access token generated in the Pushbullet WiFiClientSecure pushClient; -// Configures the Keybus interface with the specified pins -#define dscClockPin D1 // GPIO5 -#define dscReadPin D2 // GPIO4 +// Configures the Keybus interface with the specified pins. +#define dscClockPin D1 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscReadPin D2 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) dscKeybusInterface dsc(dscClockPin, dscReadPin); @@ -111,9 +109,9 @@ void loop() { dsc.alarmChanged[partition] = false; // Resets the partition alarm status flag char pushMessage[38] = "Security system in alarm, partition "; - char partition[2]; - itoa(partition + 1, partition, 10); - strcat(pushMessage, partition); + char partitionNumber[2]; + itoa(partition + 1, partitionNumber, 10); + strcat(pushMessage, partitionNumber); if (dsc.alarm[partition]) sendPush(pushMessage); else sendPush("Security system disarmed after alarm"); @@ -123,9 +121,9 @@ void loop() { dsc.fireChanged[partition] = false; // Resets the fire status flag char pushMessage[40] = "Security system fire alarm, partition "; - char partition[2]; - itoa(partition + 1, partition, 10); - strcat(pushMessage, partition); + char partitionNumber[2]; + itoa(partition + 1, partitionNumber, 10); + strcat(pushMessage, partitionNumber); if (dsc.fire[partition]) sendPush(pushMessage); else sendPush("Security system fire alarm restored"); diff --git a/examples/esp8266/Status/Status.ino b/examples/esp8266/Status/Status.ino index bd467d4..4cefbd5 100644 --- a/examples/esp8266/Status/Status.ino +++ b/examples/esp8266/Status/Status.ino @@ -1,30 +1,28 @@ /* - * DSC Status (Arduino, esp8266) + * DSC Status (esp8266) * * 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. * * Wiring: - * DSC Aux(-) --- Arduino/esp8266 ground + * DSC Aux(-) --- esp8266 ground * - * +--- dscClockPin (Arduino Uno: 2,3 / esp8266: D1,D2,D8) + * +--- dscClockPin (esp8266: D1, D2, D8) * DSC Yellow --- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * - * +--- dscReadPin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * +--- dscReadPin (esp8266: D1, D2, D8) * DSC Green ---- 15k ohm resistor ---| * +--- 10k ohm resistor --- Ground * * Virtual keypad (optional): * DSC Green ---- NPN collector --\ - * |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12 / esp8266: D1,D2,D8) + * |-- NPN base --- 1k ohm resistor --- dscWritePin (esp8266: D1, D2, D8) * Ground --- NPN emitter --/ * * Power (when disconnected from USB): - * DSC Aux(+) ---+--- Arduino Vin pin - * | - * +--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) + * DSC Aux(+) ---+--- 5v voltage regulator --- esp8266 development board 5v pin (NodeMCU, Wemos) * | * +--- 3.3v voltage regulator --- esp8266 bare module VCC pin (ESP-12, etc) * @@ -41,11 +39,11 @@ #include -// Configures the Keybus interface with the specified pins - dscWritePin is -// optional, leaving it out disables the virtual keypad -#define dscClockPin D1 // Arduino Uno: 2,3 esp8266: D1, D2, D8 (GPIO 5, 4, 15) -#define dscReadPin D2 // Arduino Uno: 2-12 esp8266: D1, D2, D8 (GPIO 5, 4, 15) -#define dscWritePin D8 // Arduino Uno: 2-12 esp8266: D1, D2, D8 (GPIO 5, 4, 15) +// Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the +// virtual keypad. +#define dscClockPin D1 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscReadPin D2 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) +#define dscWritePin D8 // esp8266: D1, D2, D8 (GPIO 5, 4, 15) dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin); diff --git a/schematics/arduino/README.md b/extras/PCB Layouts/Arduino/README.md similarity index 79% rename from schematics/arduino/README.md rename to extras/PCB Layouts/Arduino/README.md index 6ef892e..a3a2148 100644 --- a/schematics/arduino/README.md +++ b/extras/PCB Layouts/Arduino/README.md @@ -11,4 +11,6 @@ |2|15kΩ Resistor|resistance 15kΩ| |2|10kΩ Resistor|resistance 10kΩ| |1|1kΩ Resistor|resistance 1kΩ| -|1|Arduino UNO|Revision 3| \ No newline at end of file +|1|Arduino UNO|Revision 3| + +Thanks to [sjlouw](https://github.com/sj-louw) for contributing these designs! diff --git a/schematics/arduino/etch_copper_top.pdf b/extras/PCB Layouts/Arduino/etch_copper_top.pdf similarity index 100% rename from schematics/arduino/etch_copper_top.pdf rename to extras/PCB Layouts/Arduino/etch_copper_top.pdf diff --git a/schematics/arduino/etch_copper_top_mirror.pdf b/extras/PCB Layouts/Arduino/etch_copper_top_mirror.pdf similarity index 100% rename from schematics/arduino/etch_copper_top_mirror.pdf rename to extras/PCB Layouts/Arduino/etch_copper_top_mirror.pdf diff --git a/schematics/arduino/etch_silk_top.pdf b/extras/PCB Layouts/Arduino/etch_silk_top.pdf similarity index 100% rename from schematics/arduino/etch_silk_top.pdf rename to extras/PCB Layouts/Arduino/etch_silk_top.pdf diff --git a/schematics/arduino/etch_silk_top_mirror.pdf b/extras/PCB Layouts/Arduino/etch_silk_top_mirror.pdf similarity index 100% rename from schematics/arduino/etch_silk_top_mirror.pdf rename to extras/PCB Layouts/Arduino/etch_silk_top_mirror.pdf diff --git a/schematics/arduino/pcb_screenshot.png b/extras/PCB Layouts/Arduino/pcb_screenshot.png similarity index 100% rename from schematics/arduino/pcb_screenshot.png rename to extras/PCB Layouts/Arduino/pcb_screenshot.png diff --git a/schematics/esp8266/README.md b/extras/PCB Layouts/NodeMCU/README.md similarity index 81% rename from schematics/esp8266/README.md rename to extras/PCB Layouts/NodeMCU/README.md index c2f019f..528adcc 100644 --- a/schematics/esp8266/README.md +++ b/extras/PCB Layouts/NodeMCU/README.md @@ -13,4 +13,6 @@ |2|15kΩ Resistor|resistance 15kΩ| |2|10kΩ Resistor|resistance 10kΩ| |1|1kΩ Resistor|resistance 1kΩ| -|1|NodeMCU V3.0|chip ESP8266| \ No newline at end of file +|1|NodeMCU V3.0|chip ESP8266| + +Thanks to [sjlouw](https://github.com/sj-louw) for contributing these designs! diff --git a/schematics/esp8266/etch_copper_top.pdf b/extras/PCB Layouts/NodeMCU/etch_copper_top.pdf similarity index 100% rename from schematics/esp8266/etch_copper_top.pdf rename to extras/PCB Layouts/NodeMCU/etch_copper_top.pdf diff --git a/schematics/esp8266/etch_copper_top_mirror.pdf b/extras/PCB Layouts/NodeMCU/etch_copper_top_mirror.pdf similarity index 100% rename from schematics/esp8266/etch_copper_top_mirror.pdf rename to extras/PCB Layouts/NodeMCU/etch_copper_top_mirror.pdf diff --git a/schematics/esp8266/etch_silk_top.pdf b/extras/PCB Layouts/NodeMCU/etch_silk_top.pdf similarity index 100% rename from schematics/esp8266/etch_silk_top.pdf rename to extras/PCB Layouts/NodeMCU/etch_silk_top.pdf diff --git a/schematics/esp8266/etch_silk_top_mirror.pdf b/extras/PCB Layouts/NodeMCU/etch_silk_top_mirror.pdf similarity index 100% rename from schematics/esp8266/etch_silk_top_mirror.pdf rename to extras/PCB Layouts/NodeMCU/etch_silk_top_mirror.pdf diff --git a/schematics/esp8266/pcb_screenshot.png b/extras/PCB Layouts/NodeMCU/pcb_screenshot.png similarity index 100% rename from schematics/esp8266/pcb_screenshot.png rename to extras/PCB Layouts/NodeMCU/pcb_screenshot.png diff --git a/schematics/simple/README.md b/extras/PCB Layouts/Simple/README.md similarity index 82% rename from schematics/simple/README.md rename to extras/PCB Layouts/Simple/README.md index 84a08a0..e167cb0 100644 --- a/schematics/simple/README.md +++ b/extras/PCB Layouts/Simple/README.md @@ -11,3 +11,5 @@ |2|15kΩ Resistor|resistance 15kΩ| |2|10kΩ Resistor|resistance 10kΩ| |1|1kΩ Resistor|resistance 1kΩ| + +Thanks to [sjlouw](https://github.com/sj-louw) for contributing these designs! diff --git a/schematics/simple/etch_copper_top.pdf b/extras/PCB Layouts/Simple/etch_copper_top.pdf similarity index 100% rename from schematics/simple/etch_copper_top.pdf rename to extras/PCB Layouts/Simple/etch_copper_top.pdf diff --git a/schematics/simple/etch_copper_top_mirror.pdf b/extras/PCB Layouts/Simple/etch_copper_top_mirror.pdf similarity index 100% rename from schematics/simple/etch_copper_top_mirror.pdf rename to extras/PCB Layouts/Simple/etch_copper_top_mirror.pdf diff --git a/schematics/simple/etch_silk_top.pdf b/extras/PCB Layouts/Simple/etch_silk_top.pdf similarity index 100% rename from schematics/simple/etch_silk_top.pdf rename to extras/PCB Layouts/Simple/etch_silk_top.pdf diff --git a/schematics/simple/etch_silk_top_mirror.pdf b/extras/PCB Layouts/Simple/etch_silk_top_mirror.pdf similarity index 100% rename from schematics/simple/etch_silk_top_mirror.pdf rename to extras/PCB Layouts/Simple/etch_silk_top_mirror.pdf diff --git a/schematics/simple/pcb_screenshot.png b/extras/PCB Layouts/Simple/pcb_screenshot.png similarity index 100% rename from schematics/simple/pcb_screenshot.png rename to extras/PCB Layouts/Simple/pcb_screenshot.png diff --git a/library.json b/library.json index c73092a..4c581de 100644 --- a/library.json +++ b/library.json @@ -1,7 +1,7 @@ { "name": "dscKeybusInterface", "keywords": "home-security, home-automation, homekit, homebridge, home-assistant", - "description": "This library directly interfaces Arduino and esp8266 microcontrollers to DSC PowerSeries security systems for integration with home automation (including Home Assistant and Apple HomeKit), notifications on system events, and writing as a virtual keypad.", + "description": "This library directly interfaces Arduino and esp8266 microcontrollers to DSC PowerSeries security systems for integration with home automation (Home Assistant, Apple HomeKit, Homey), notifications on system events, and writing as a virtual keypad.", "repository": { "type": "git", diff --git a/schematic/README.md b/schematic/README.md deleted file mode 100644 index 87e2c91..0000000 --- a/schematic/README.md +++ /dev/null @@ -1,9 +0,0 @@ -### Parts List - -|Amount|Part Type|Properties| -|--- |--- |--- | -|4|Screw terminal - 2 pins|pin spacing 0.137in (3.5mm); pins 2; hole size 1.0mm,0.508mm| -|1|NPN-Transistor|2N3904| -|2|15kΩ Resistor|pin spacing 400 mil; resistance 15kΩ| -|2|10kΩ Resistor|pin spacing 400 mil; resistance 10kΩ| -|1|1kΩ Resistor|pin spacing 400 mil; resistance 1kΩ| diff --git a/schematic/etch_copper_top.pdf b/schematic/etch_copper_top.pdf deleted file mode 100644 index a6b7549..0000000 Binary files a/schematic/etch_copper_top.pdf and /dev/null differ diff --git a/schematic/etch_copper_top_mirror.pdf b/schematic/etch_copper_top_mirror.pdf deleted file mode 100644 index 0ccee5e..0000000 Binary files a/schematic/etch_copper_top_mirror.pdf and /dev/null differ diff --git a/schematic/etch_silk_top.pdf b/schematic/etch_silk_top.pdf deleted file mode 100644 index e451b78..0000000 Binary files a/schematic/etch_silk_top.pdf and /dev/null differ diff --git a/schematic/etch_silk_top_mirror.pdf b/schematic/etch_silk_top_mirror.pdf deleted file mode 100644 index 6259c06..0000000 Binary files a/schematic/etch_silk_top_mirror.pdf and /dev/null differ diff --git a/schematic/pcb_screenshot.png b/schematic/pcb_screenshot.png deleted file mode 100644 index 4b89679..0000000 Binary files a/schematic/pcb_screenshot.png and /dev/null differ