Coder Social home page Coder Social logo

aficustree / homebridge-alarmdecoder-platform Goto Github PK

View Code? Open in Web Editor NEW
18.0 5.0 11.0 85 KB

Homebridge plugin for the AlarmDecoder interface for Honeywell and DSC Alarm Systems. Exposes the security system and all zones (via Contact Sensors and Motion Sensors) to Apple's Homekit. Control your alarm through Siri.

License: Apache License 2.0

JavaScript 100.00%
homebridge homebridge-plugin homebridge-alarmdecoder homekit honeywell motion-sensor contact-sensor dsc

homebridge-alarmdecoder-platform's Introduction

homebridge-alarmdecoder-platform

Homebridge dynamic platform plugin for the alarmdecoder (alarmdecoder.com) interface to Honeywell/DSC Systems & Interlogix (formerly GE Security, Caddx, NetworX) Systems.

  • For DSC/Homebridge: You must have a functioning alarmdecoder-webapp for the homebridge plugin to contact (via the rest API). Please make sure your webapp is updated with the latest alarmdecoder python package. The alarmdecoder webui must be setup to push alarm events and zone status changes using the enclosed directions.
  • For Interlogix/GE: You must have the Interlogix NX-584E board or a NX8E alarm system and an installed and a working installation of the NX584 Interface Library built by kk7ds. Note the Interlogix branch was written for a friend and is fairly untested, please report any issues

This plugin exposes the security system and any configured contact sensors or motion sensors (i.e., the security system's zones) to HomeKit/Homebridge for use in further automations.

IMPORTANT For Honeywell/DSC systems, the name of the zone in the AlarmDecoder WebUI or for Interlogix/GE systems, the name within config.ini must have the word 'motion', 'smoke' or 'carbon' in the name for the plugin to use the special motion, smoke or carbon monoxide services, otherwise all zones will load as contact sensors. You can name the zones in settings->zones->zone name. Contact sensors are the default so you don't have to put 'contact' in the name anywhere.

Installation

  1. Install homebridge using: npm install -g homebridge
  2. Install homebridge-alarmdecoder-platform using: npm install -g git+https://github.com/aficustree/homebridge-alarmdecoder-platform#master
  3. Update your configuration file. See sample-config.json in this repository for a sample.

Configuration

This module requires that the URLs for getting and setting the security system's state are configured correctly. This has to be done in Homebridge's config.json. You can find a sample configuration file in this repository.

The configuration options are the following:

Configuration examples can be as noted:

DSC Example

Honeywell Example

Interlogix/GE/NetworX/Caddx

  • The name parameter determines the name of the security system you will see in HomeKit.
  • the key parameter reflects the API key from the alarmdecoder GUI (honeywell/DSC only)
  • The port parameter reflects the port the alarmdecoder-sensor will listen for updates from alarmdecoder GUI. This value should be found on the https://alarmdecoder.local/settings/notifications/1/edit page by clicking on the "Custom Settings" tab.
  • The stateURL, zoneURL and setURL entries show the URL that the plugin will query for the list of zones, the state of the alarm system (and all faulted zones) and the URL to send virtual keypresses. Replace YOURIP and YOURPORT with the IP and port in the text box at the top of https://alarmdecoder.local/static/swagger/index.html on a standard install.
  • The setPIN is your PIN that you use to arm/disarm the system. Only type the base pin, do not add the arm/disarm button press (i.e., if you arm the system by typing 12342, your pin is 1234)
  • The useSwitches provides 'switch' toggles that control the setting of the alarm in away/night/stay mode or to trigger a panic function (or really any arbitrary command). USING THIS FEATURE FOR AWAY/NIGHT/STAY/DISARM IS A SECURITY RISK (panic and chime are fine) as you can now control your alarm via Siri without unlocking your iDevice (i.e., if you have a homepod someone could scream 'hey siri, turn off my Alarm Away'). This is useful if you don't care and want to control your alarm through an automation (like a geofence) without authenticating via your phone.
  • Panic Key is the key used to trigger the panic alarm (either silent or audible). By flipping this switch your alarm will go into panic mode (and your neighbors may be displeased).
  • The platformType should be set to either "DSC", "Honeywell", or "Interlogix" (use Interlogix for GE/Caddx/NetworX panels) depending on the type of alarm panel
  • Values for DSCStay, DSCAway, DSCReset and DSCExit are DSC specific
  • Interlogix plugin does not support panic or chime buttons at this time

Configuration of Alarmedecoder GUI (Honeywell/DSC Only)

  • Go to your installation of the Alarmdecoder GUI
  • Go to settings
  • Notifications
  • New Notification
  • Notification Type Custom
  • Under Notification Events Tab
  • Select / Tick the following:
    • Alarm system is triggered
    • Alarm system stops signaling
    • A panic has been detected
    • A fire is detected
    • Alarm system is armed
    • Alarm system is disarmed
    • A zone has faulted
    • A zone has been restored
  • Under 'custom settings' Tab
  • URL = the ip address of your homebridge including the Port i.e. 127.0.0.1:8888
  • Path = /
  • Method = Post

Supporting Other Panels

  • An Abstract Base Class is provided to guide development. All three functions must be overridden and appropriate logic added to the initPlatform function in index.js as to instantiate the right class for your panel (by using the PlatformType variable above).
  • The system expect to receive a 'ping' (in the form of an HTTP GET) to the port specified in the config.json. That 'ping' informs the library to query the panel for a full status/zone report getAlarmState. This function should update the state variables of any zone and the system itself and return true/false depending on the success of the call.
  • During startup, the system will call initZones to get a list of all zones. This will be compared with any cached zones and updated accordingly.
  • The 'setAlarmState' function is called by the platform whenever the user requests a state change. It is expected that the plugin makes the call and returns true/false depending on success of the request. The platform will tell homekit that the target state has been successfully set and wait for the 'ping' to update the current state. if the next ping does not show an updated current state, the target state will be returned to the original value.

Donations

If you found this useful, free free to donate.

paypal

Issues

If you find any issues or just have questions, open an issue on github. I will try my best to answer but only have my own honeywell system to troubleshoot.

License

Copyright 2018, aficustree

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

homebridge-alarmdecoder-platform's People

Contributors

aficustree avatar dependabot[bot] avatar drjeff avatar dssinger avatar jondthompson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

homebridge-alarmdecoder-platform's Issues

Parse Error: Expected HTTP/

I had AlarmDecoder working perfectly with my HOOBS 3 setup. Then my Pi died so I got a new HOOBS running newer software, specifically Homebridge 1.3.4 and Node 14.17.6. Now I am getting the following error when starting Homebridge. This is the same setup and config I was using before.

9/11/2021, 6:48:56 PMAlarm System BridgeLoaded plugin 'homebridge-alarmdecoder-platform'
9/11/2021, 6:48:57 PMAlarm System BridgeLoading 1 platforms...
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm SystemAlarm System Configuring Accessory from Cache
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemadding accessory Alarm System
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systempanic Configuring Accessory from Cache
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemadding accessory panic
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemchime Configuring Accessory from Cache
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemadding accessory chime
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemaway Configuring Accessory from Cache
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemadding accessory away
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemstay Configuring Accessory from Cache
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemadding accessory stay
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm SystemCached Accessories Loaded
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systeminitalizing platform
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemfound security system from cache, skipping
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systeminit zones
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemlistening on port 8888
9/11/2021, 6:48:57 PMAlarm System BridgeBridge is running on port 51836.
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm SystemError: Parse Error: Expected HTTP/
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemfound switch panic from cache, skipping
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemfound switch chime from cache, skipping
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemfound switch away from cache, skipping
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm Systemfound switch stay from cache, skipping
9/11/2021, 6:48:57 PMAlarm System BridgeAlarm SystemError: Parse Error: Expected HTTP/
9/11/2021, 6:47:21 PMAlarm System BridgeERROR[Alarm System Bridge 44B5@Alarm System@Alarm System@Security System Current State] characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics
9/11/2021, 6:47:21 PMAlarm System BridgeERROR[Alarm System Bridge 44B5@Alarm System@Alarm System@Security System Target State] characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics

Here is my config with some things *** out:

{
"platform": "alarmdecoder-platform",
"name": "Alarm System",
"port": "8888",
"key": "**********",
"stateURL": "http://alarmdecoder.local:10000/api/v1/alarmdecoder",
"zoneURL": "http://alarmdecoder.local:10000/api/v1/zones",
"setURL": "http://alarmdecoder.local:10000/api/v1/alarmdecoder/send",
"setPIN": "
",
"panicKey": "",
"useSwitches": [
"panic",
"chime",
"away",
"stay"
],
"DSCorHoneywell": "Honeywell",
"chimeKey": "9"
}

useSwitches for any arbitrary commands

Was reading the documentation on the plugin configuration it states:

"The useSwitches provides 'switch' toggles that control the setting of the alarm in away/night/stay mode or to trigger a panic function (or really any arbitrary command)"

Is there any documentation of how to configure the useSwitches to trigger "any arbitrary command"?

Thanks,

Notification issue

Just installed the HOOBS plugin, the sensors and alarm all seem to integrate properly in Home. Alarm will arm, disarm, etc - however the sensors/contacts will not show change of state (ie: open the front door, no change on the home app).

The logs seem to point towards an error - though my programming skills are sketchy at best.

2020-11-30 13:06:48,822 INFO: Event: Ready status has changed to True [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:06:49,217 INFO: Background notification function CustomNotification._do_post() starting. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:149]
2020-11-30 13:06:49,224 INFO: Event: The alarm system has been disarmed. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:06:49,273 INFO: Event: 1666000000006663024543f531fb456cf5ec03010101 [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:06:49,821 INFO: Background notification functions running 1. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:438]
2020-11-30 13:06:49,823 INFO: Background notification function CustomNotification._do_post() finished with gaierror(-2, 'Name or service not known') line 1137. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:454]
2020-11-30 13:07:26,012 INFO: Event: 126600000000676c02456cf5ec0101010000 [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:07:26,192 INFO: Event: Ready status has changed to False [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:07:26,734 INFO: Background notification function CustomNotification._do_post() starting. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:149]
2020-11-30 13:07:26,740 INFO: Event: The alarm system has been armed STAY. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:07:26,790 INFO: Event: 1766000000006063024543f531fb456cf5ec020101022c [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:07:29,834 INFO: Background notification functions running 1. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:438]
2020-11-30 13:07:29,835 INFO: Background notification function CustomNotification._do_post() finished with gaierror(-2, 'Name or service not known') line 1137. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:454]
2020-11-30 13:07:46,360 INFO: Event: 0226050:0:1:0:0:1:0 [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:07:55,598 INFO: Event: 1028341:0:1:0:0:0:0 [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:08:10,179 INFO: Event: 126600000000616c02456cf5ec0101010000 [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:08:10,297 INFO: Event: 1666000000006263024543f531fb456cf5ec02010101 [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:08:10,477 INFO: Event: Ready status has changed to False [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:08:19,305 INFO: Event: 126600000000636c02456cf5ec0101010000 [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:08:19,496 INFO: Event: 1666000000006463024543f531fb456cf5ec03010101 [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:08:19,674 INFO: Event: Ready status has changed to True [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:08:20,225 INFO: Background notification function CustomNotification._do_post() starting. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:149]
2020-11-30 13:08:20,231 INFO: Event: The alarm system has been disarmed. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]
2020-11-30 13:08:24,846 INFO: Background notification functions running 1. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:438]
2020-11-30 13:08:24,847 INFO: Background notification function CustomNotification._do_post() finished with gaierror(-2, 'Name or service not known') line 1137. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:454]

adding custom buttons?

is there a way to add homekit switches for custom buttons? naively i thought that if i created and named a custom button "foo" in the alarm decoder configuration interface and then referenced "foo" in the useSwitches line of config.json that homekit would be able to trigger that button. however, homekit says "no response" from that switch and nothing happens when i press it.

is this something that is supported? if so is there some other way the button needs to be referred to in config.json?

thanks

Plugin causing system to crash

This is the only plugin I have installed on my hoobs, and every 24 hours, it causes the system to crash and I have to power cycle the unit to get it back up. Any help would be greatly appreciated. Here's the log.

6/12/2021, 7:32:02 AM HOOBS listening on port 80.
6/12/2021, 7:32:04 AM Initializing HAP-NodeJS v0.9.3...
6/12/2021, 7:32:05 AM Loaded plugin 'homebridge-alarmdecoder-platform'
6/12/2021, 7:32:06 AM [6/12/2021, 5:32:05 AM] Registering platform 'homebridge-alarmdecoder-platform.alarmdecoder-platform'
6/12/2021, 7:32:06 AM Loading 1 platforms...
6/12/2021, 7:32:06 AM [alarmdecoder-platform] Initializing alarmdecoder-platform platform...
6/12/2021, 7:32:06 AM [alarmdecoder-platform] no system specified, assuming Honeywell, please add platformType variable to your config.json
6/12/2021, 7:32:06 AM [alarmdecoder-platform] Cached Accessories Loaded
6/12/2021, 7:32:06 AM [alarmdecoder-platform] initalizing platform
6/12/2021, 7:32:06 AM [alarmdecoder-platform] adding security system accessory
6/12/2021, 7:32:06 AM [alarmdecoder-platform] listening on port undefined
6/12/2021, 7:32:06 AM Preparing Advertiser for 'HOOBS ACF3' using bonjour-hap backend!
6/12/2021, 7:32:06 AM Starting to advertise 'HOOBS ACF3' using bonjour-hap backend!
6/12/2021, 7:32:06 AM Bridge is running on port 51826.
6/12/2021, 7:32:06 AM (node:612) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
6/12/2021, 7:32:06 AM at Hash.update (internal/crypto/hash.js:84:11)
6/12/2021, 7:32:06 AM at Object.generate (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/src/lib/util/uuid.ts:11:11)
6/12/2021, 7:32:06 AM at AlarmdecoderPlatform.initPlatform (/home/hoobs/.hoobs/node_modules/homebridge-alarmdecoder-platform/index.js:151:32)
6/12/2021, 7:32:06 AM at HomebridgeAPI. (/home/hoobs/.hoobs/node_modules/homebridge-alarmdecoder-platform/index.js:41:22)
6/12/2021, 7:32:06 AM at HomebridgeAPI.emit (events.js:376:20)
6/12/2021, 7:32:06 AM at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/homebridge/src/api.ts:275:10)
6/12/2021, 7:32:06 AM at Server.start (/usr/local/lib/node_modules/@hoobs/hoobs/bridge/server.js:156:18)
6/12/2021, 7:32:06 AM at /usr/local/lib/node_modules/@hoobs/hoobs/bridge/cli.js:94:16
6/12/2021, 7:32:06 AM at processTicksAndRejections (internal/process/task_queues.js:95:5)
6/12/2021, 7:32:06 AM (Use node --trace-warnings ... to show where the warning was created)
6/12/2021, 7:32:06 AM (node:612) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
6/12/2021, 7:32:06 AM (node:612) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Crash when adding to HomeKit on fresh homebridge installation

I just tried to install the plugin on a fresh homebridge installation, and the plugin crashed homebridge when adding the hub to HomeKit. I tried on another fresh homebridge installation, and the same thing happened.

Here's the error in the log file:

HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +32ms
Accessory [Dev Homebridge] Processing characteristic set: [{"aid":9,"iid":2,"value":true}] +157ms
Accessory [Dev Homebridge] Setting Characteristic "Identify" to value true +1ms
Accessory [5 Garage Entry Door] Identification request +0ms
[5/6/2020, 4:42:48 PM] [Alarm System] 5 Garage Entry Door Identify!!!
[5/6/2020, 4:42:48 PM] TypeError: callback is not a function
	at PlatformAccessory.<anonymous> (/usr/local/lib/node_modules/homebridge-alarmdecoder-platform/index.js:61:13)
	at PlatformAccessory.emit (events.js:310:20)
	at Accessory.<anonymous> (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:85:12)
	at Accessory.emit (events.js:310:20)
	at Accessory.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
	at Accessory._this._identificationRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:259:12)
	at Identify.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:248:16)
	at Identify.emit (events.js:310:20)
	at Identify.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
	at Identify.Characteristic._this.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:614:12)
[5/6/2020, 4:42:48 PM] Got SIGTERM, shutting down Homebridge...

Let me know if there is any other information i can provide.

Npm and Git repos are out of sync

When updating to the 3.1.8 release using the homebridge plugin admin facilities, I noticed my system did not contain the latest code. Specifically, honeywell.js did not contain the changes associated with release 3.1.8. Upon reviewing the code in the git repo and the npm repo and I find the code bases are not in sync. It looks like the npm repo contains code from two years ago. As I'm neither a git nor npm expert, what I'm observing may be perfectly normal, so take what I'm saying with a grain of salt. Please note, if I manually issue, "npm install -g git+https://github.com/aficustree/homebridge-alarmdecoder-platform#master" from the linux command line, I get the correct code base.

I'm missing something....

Please delete this error report. I went a different way and am no longer attempting to use this plugin.

Errors detected with interlogix integration

Thanks for the plugin.Great work, It is working but I get the following errors in the log file. Any fixes/help would be appreciated.

�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[Alarm System]�[39m found 3 FRONT DOOR,from cache, skipping
�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[Alarm System]�[39m found 4 LIVING R.WINDOW,from cache, skipping
�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[Alarm System]�[39m found 5 MOTION DETECTOR,from cache, skipping
�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[Alarm System]�[39m found 6 KIT. NOOK WINDOW,from cache, skipping
�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[Alarm System]�[39m found 7 KIT. NOOK DOOR,from cache, skipping
�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[Alarm System]�[39m found 8 SMOKE DETECTOR,from cache, skipping
�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[Alarm System]�[39m found switch away from cache, skipping
�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[Alarm System]�[39m found switch stay from cache, skipping
�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[Alarm System]�[39m found switch night from cache, skipping
�[37m[11/7/2021, 6:42:43 AM] �[39m�[36m[homebridge-alarmdecoder-platform]�[39m This plugin generated a warning from the characteristic 'Motion Detected': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info.

Second issue/Error:
�[37m[11/7/2021, 7:00:58 AM] �[39m�[36m[Alarm System]�[39m TypeError: Cannot set property 'faulted' of undefined
at /usr/lib/node_modules/homebridge-alarmdecoder-platform/alarmsystems/interlogix.js:25:84
at Array.forEach ()
at Interlogix.getAlarmState (/usr/lib/node_modules/homebridge-alarmdecoder-platform/alarmsystems/interlogix.js:24:21)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at AlarmdecoderPlatform._getStateFromAlarm (/usr/lib/node_modules/homebridge-alarmdecoder-platform/index.js:242:13)
at AlarmdecoderPlatform.getSwitchState (/usr/lib/node_modules/homebridge-alarmdecoder-platform/index.js:355:9)

Homebridge alarmdecoder json format

Hello,
I want to use the homebridge-alarmdecoder plugin (the closed project). Can you send me a sample of the json response for the API that will send the alarm status? Thank you so much. Fred

"No Response" from Alarm System accessory when system is armed

I mentioned this in my comments on another issue, but it seems like the problem I'm seeing is different and more reproducible in my set up, so I'm opening a new issue.

Basically, the accessories all seem to work fine when system is disarmed. I can use the Alarm System accessory to arm the system to "Home," which properly arms my Honeywell system to "Stay." But once the system is armed, the Alarm System accessory becomes unresponsive. This isn't immediately obvious in the Home app interface (which seems to cache the state), but eventually the Alarm System accessory will show "No Response" and can't display or set the state (and it will do this behavior right away if I force quit and restart the Home app). If I disarm the system (e.g., using a manual keypad or the Web App), the Alarm System accessory in HomeKit becomes responsive again and displays the correct disarmed state.

I've got a Honeywell system with a very basic plugin config (basically just the Honeywell Example config with my info replaced and without the "panic key" or "switches" options). The Alarmdecoder Web App is up-to-date and functioning fine. I've explicitly identified the IP addresses and ports in the config for the plugin and web app notifications to try to rule out any DNS issues. And it looks from the logs like the plugin is communicating correctly with the Alarmdecoder Web App API even when the Alarm System accessory is showing up as not responsive.

I've tried on two separate clean homebridge installations (running on different machines), and I get the same behavior on both.

I ran one in debug mode to see if I could get any information. When disarmed, the plugin can successfully get the state for all of the sensor characteristics, including the "Security System Target State" and "Security System Current State" (with value 3 for disarmed):

[5/6/2020, 8:32:35 PM] [Alarm System] {"last_message_received":"[10000001000000003A--],008,[f70600ff1008001c08020000000000],\"****DISARMED****  Ready to Arm  \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
	Accessory [Dev Homebridge] Got Characteristic "Contact Sensor State" value: 0 +34ms
[5/6/2020, 8:32:35 PM] [Alarm System] {"last_message_received":"[10000001000000003A--],008,[f70600ff1008001c08020000000000],\"****DISARMED****  Ready to Arm  \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
	Accessory [Dev Homebridge] Got Characteristic "Security System Target State" value: 3 +34ms
[5/6/2020, 8:32:35 PM] [Alarm System] {"last_message_received":"[10000001000000003A--],008,[f70600ff1008001c08020000000000],\"****DISARMED****  Ready to Arm  \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
	Accessory [Dev Homebridge] Got Characteristic "Security System Current State" value: 3 +33ms
[5/6/2020, 8:32:35 PM] [Alarm System] {"last_message_received":"[10000001000000003A--],008,[f70600ff1008001c08020000000000],\"****DISARMED****  Ready to Arm  \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
	Accessory [Dev Homebridge] Got Characteristic "Contact Sensor State" value: 0 +35ms

When I arm the system to Home / Stay, the debug log shows that characteristic being set:

Accessory [Dev Homebridge] Setting Characteristic "Security System Target State" to value 0 +0ms

That arms the system, which is reflected in the API messages:

5/6/2020, 8:33:16 PM] [Alarm System] {"last_message_received":"[00110301000000003A--],008,[f70600f51008038c08020000000000],\"ARMED ***STAY***You may exit now\"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":true,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}

The next time HomeKit checks the status, the plugin seems to get all of the correct API responses from Web App. It reports values for the individual sensors but for some reason it reports the "Security System Current State" and "Security System Target State" as "undefined" (when it should have value 0 for "stay"):

[5/6/2020, 8:33:50 PM] [Alarm System] {"last_message_received":"[00110001000000003A--],008,[f70600ff1008008c08020000000000],\"ARMED ***STAY***You may exit now\"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":true,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
	Accessory [Dev Homebridge] Got Characteristic "Motion Detected" value: false +35ms
[5/6/2020, 8:33:50 PM] [Alarm System] {"last_message_received":"[00110001000000003A--],008,[f70600ff1008008c08020000000000],\"ARMED ***STAY***You may exit now\"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":true,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
	Accessory [Dev Homebridge] Error getting value for Characteristic "Security System Current State": undefined +38ms
[5/6/2020, 8:33:50 PM] [Alarm System] {"last_message_received":"[00110001000000003A--],008,[f70600ff1008008c08020000000000],\"ARMED ***STAY***You may exit now\"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":true,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
	Accessory [Dev Homebridge] Error getting value for Characteristic "Security System Target State": undefined +37ms
[5/6/2020, 8:33:50 PM] [Alarm System] {"last_message_received":"[00110001000000003A--],008,[f70600ff1008008c08020000000000],\"ARMED ***STAY***You may exit now\"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":true,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
	Accessory [Dev Homebridge] Got Characteristic "Contact Sensor State" value: 0 +36ms

Any idea what could be going on?

Support for Arming Buttons

First off, thank you so much for your work on this platform. I know you guys do this stuff for fun and it is really appreciated by people like me who take advantage of all that work.

I was curious if you had any plans to support the automatic arming buttons present on DSC systems that appear in the Alarm Decoder Web UI. For example, my system as dedicated "Stay" and "Away" buttons that enable specific alarm states. It seems that there are special keys that can be sent via the API to activate those specific functions. It would be really cool if rather than sending the generic arm/disarm code, it could send those specific keys instead.

Thanks for reading and if its too much work, I totally get it :)

Bad Request',) line 1144.

Custom notification not updating sensor only on start or restart of HomeBridge
Getting this error in log
Any Ideas?

[2020-04-29 04:14:19,197] INFO in types: Background notification function CustomNotification._do_post() starting.
[2020-04-29 04:14:19,200] INFO in types: Event: 1044296:0:0:1:1:0:0
[2020-04-29 04:14:19,299] INFO in types: Event Custom Notification Failed

[2020-04-29 04:14:20,078] INFO in types: Background notification functions running 2.
[2020-04-29 04:14:20,079] INFO in types: Background notification function CustomNotification._do_post() finished with Exception('Custom Notification Failed (400) Bad Request',) line 1144.

[2020-04-29 04:14:20,079] INFO in types: Background notification function CustomNotification._do_post() finished with Exception('Custom Notification Failed (400) Bad Request',) line 1144.

[2020-04-29 04:14:21,697] INFO in types: Background notification function CustomNotification._do_post() starting.
[2020-04-29 04:14:21,699] INFO in types: Event: 1001600:0:0:0:1:0:1
[2020-04-29 04:14:21,800] INFO in types: Event Custom Notification Failed

[2020-04-29 04:14:24,502] INFO in types: Event: Ready status has changed to True
[2020-04-29 04:14:24,591] INFO in types: Background notification function CustomNotification._do_post() starting.
[2020-04-29 04:14:24,594] DEBUG in types: Event: Zone Family Room Door (21) has been restored.
[2020-04-29 04:14:24,683] INFO in types: Event Custom Notification Failed

[2020-04-29 04:14:25,083] INFO in types: Background notification functions running 2.
[2020-04-29 04:14:25,083] INFO in types: Background notification function CustomNotification._do_post() finished with Exception('Custom Notification Failed (400) Bad Request',) line 1144.

[2020-04-29 04:14:25,084] INFO in types: Background notification function CustomNotification._do_post() finished with Exception('Custom Notification Failed (400) Bad Request',) line 1144.

Fix for issue 5 broke sending for ademco/honeywell boards

I tried manually removing the changes one at a time and it didn't fix it. I then reverted to 3.1.1 and it worked. Checking status works, but something breaks when sending codes.

Also, I suspect you can get which board it is from the status of the board rather than codifying it in the config. Mine sends "panel_type":"ADEMCO" on every status update.

Duplicate Zones after resyncing panel

I had cleaned up the alphabetic case on my zone names in AlarmDecoder Webapp. After making some changes to my alarm system (adding a sensor and renaming a couple zones) then rescanning the panel in AlarmDecoder, all my zones are now capitalized.

This is fine, I'm going to leave them that way, but now alarmdecoder homebridge plugin and Homekit have duplicates of my alarm zones. eg. 24 Kitchen Motion and 24 KITCHEN MOTION.

There seems to be no way to remove them in Homekit, and "hiding" them in the plugin seems to have no effect in homekit so far.

How can I purge the duplicate zones from the plugin?

Sorry. This his feels like a FAQ.

Smoke Detectors load as Contact Sensors

Tried adding "Smoke" or "smoke" to the name of my smoke detector, but it will only show up as a contact sensor. I have a DSC alarm panel, am on the latest version of AlarmDecoder and latest version of the homebridge-alarmdecoder-platform. I've tried adding it as many ways as I could think, but ended up adding "Motion" to the name so it'd come in as a Motion Sensor (which works for me) in the meantime.

This issue is more trivial than my other one I'm about to post (has to do with arming/disarming DSC not working correctly). But I also wanted to express my gratitude for creating this plugin! I really appreciate the work you put in and am looking to donate :)

Plug-in is slowing down Homebridge

Homebridge is flagging the plug-in as slowing down the system. The specific message is:

[07/09/2022, 06:55:26] [homebridge-alarmdecoder-platform] This plugin slows down Homebridge. The read handler for the characteristic 'Contact Sensor State' was slow to respond! See https://homebridge.io/w/JtMGR for more info.

The referenced link suggests that the developer ensure they are making the proper call-backs.

Port Same?

Is the Port the same as the port used in the URLs

The port parameter reflects the port the alarmdecoder-sensor will listen for updates from alarmdecoder GUI

             "stateURL": "http://192.168.0.10:5055/api/v1/alarmdecoder",
            "zoneURL": "http://192.168.0.10:5055/api/v1/zones",
            "setURL": "http://192.168.0.10:5055/api/v1/alarmdecoder/send",

So in the example above the port used would be the same?
"port": "5055"
Or is this a port Homebridge will be using internally? I'm a little confused :crazy:

Sporadic "no response" in HomeKit

I'm not sure what's going on, but occasionally I will get a "not connected" on the icon for my Ademco->AlarmDecoder Board/Raspberry Pi->Alarmdecoder software->homebridge-alarmdecoder-platform->homebridge.

Troubleshooting has been:

  1. making sure the Ademco->...->alarmdecoder software is working via the web keypad (it is)
  2. Making sure the alarmdecoder API is working via the web interface. (it is)
  3. Making sure that homebridge is working by verifying that other plugins can communicate with HomeKit (they can)

So, the only thing that could be causing the "not communicating" is something going on with the homebridge-alarmdecoder-platform software. However, I don't see anything in the logs to tell me there is anything wrong, and rebooting homebridge doesn't seem to make any difference.

At one point I thought it was my use of IPv6 on my network, but it's not that, as this would keep the pi and/or homebridge itself from communicating.

Anyhow, this can go on for hours, and really makes it difficult to be able to trust my alarm system for automations.

Bad Request inside of Webapp with Webhook setup as outlined

Custom notification not updating sensor only on start or restart of HomeBridge
Getting this error in log
Any Ideas?

[2020-04-29 04:14:19,197] INFO in types: Background notification function CustomNotification._do_post() starting.
[2020-04-29 04:14:19,200] INFO in types: Event: 1044296:0:0:1:1:0:0
[2020-04-29 04:14:19,299] INFO in types: Event Custom Notification Failed

[2020-04-29 04:14:20,078] INFO in types: Background notification functions running 2.
[2020-04-29 04:14:20,079] INFO in types: Background notification function CustomNotification._do_post() finished with Exception('Custom Notification Failed (400) Bad Request',) line 1144.

[2020-04-29 04:14:20,079] INFO in types: Background notification function CustomNotification._do_post() finished with Exception('Custom Notification Failed (400) Bad Request',) line 1144.

[2020-04-29 04:14:21,697] INFO in types: Background notification function CustomNotification._do_post() starting.
[2020-04-29 04:14:21,699] INFO in types: Event: 1001600:0:0:0:1:0:1
[2020-04-29 04:14:21,800] INFO in types: Event Custom Notification Failed

[2020-04-29 04:14:24,502] INFO in types: Event: Ready status has changed to True
[2020-04-29 04:14:24,591] INFO in types: Background notification function CustomNotification._do_post() starting.
[2020-04-29 04:14:24,594] DEBUG in types: Event: Zone Family Room Door (21) has been restored.
[2020-04-29 04:14:24,683] INFO in types: Event Custom Notification Failed

[2020-04-29 04:14:25,083] INFO in types: Background notification functions running 2.
[2020-04-29 04:14:25,083] INFO in types: Background notification function CustomNotification._do_post() finished with Exception('Custom Notification Failed (400) Bad Request',) line 1144.

[2020-04-29 04:14:25,084] INFO in types: Background notification function CustomNotification._do_post() finished with Exception('Custom Notification Failed (400) Bad Request',) line 1144.

Excessive logging in Homebridge

The plugin is working for both alarm setting and notifications; however, I'm getting excessive logging in Homebridge. Following are extracts from the Homebridge log and the Alarm Decoder log. Note there is no specific Alarm Decoder entry for 21:20 but Homebridge received three duplicate entries for 21:20. I have the two systems' clocks sync'd so the timestamps are accurate. Can anyone provide insight into this behavior from the plug-in?

Homebridge
[31/12/2021, 21:20:34] [ADT Security] {"last_message_received":"[10000001100000003A--],008,[f72200ff1008001c28020000000000]," DISARMED CHIME Ready to Arm "","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":true,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
[31/12/2021, 21:20:34] [ADT Security] {"last_message_received":"[10000001100000003A--],008,[f72200ff1008001c28020000000000]," DISARMED CHIME Ready to Arm "","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":true,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}
[31/12/2021, 21:20:34] [ADT Security] {"last_message_received":"[10000001100000003A--],008,[f72200ff1008001c28020000000000]," DISARMED CHIME Ready to Arm "","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{},"panel_chime":true,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}

Alarm Decoder
2021-12-31 21:16:18,392 INFO: Checking for version updates - last check at: 12-31-2021 21:06:09 [in /opt/alarmdecoder-webapp/ad2web/decoder.py:616]
2021-12-31 21:22:05,791 INFO: Event: 0124531:0:1:1:0:0:0 [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:521]

Can’t Arm “Night”

This is a great plugin and I only have one issue. I can’t get homekit to recognize “night” mode. The status always quickly changes from “Night” to “Home” within HomeKit even though my keypads say “NIGHT-STAY” as desired. It seems it is setting the command correctly but not getting the status back correctly.

Publish to npm?

Hi, thanks for sharing this, it's exactly what I was looking for. Are you planning to publish it to npm? I started writing my own plugin after I couldn't find any alarmdecoder homebridge plugin on npm, but fortunately only like an hour later I ran across a reddit post linking to this repo.

Issue loading module in homebridge in new install

Homebridge Error Log:
Load homebridge-alarmdecoder-platform.alarmdecoder-platform
[11/13/2019, 10:46:44 PM] TypeError: Cannot read property 'port' of null
at new AlarmdecoderPlatform (/usr/lib/node_modules/homebridge-alarmdecoder-platform/index.js:16:28)
at Server._loadDynamicPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:358:30)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:92:8)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)

Entry in config.json
{
"platform" : "alarmdecoder-platform",
"name" : "Alarm System",
"port" : "8888",
"key" : "3ZZHVUAAHV3A",
"stateURL" : "http://alarmdecoder.local:2222/api/v1/alarmdecoder",
"zoneURL" : "http://alarmdecoder.local:2222/api/v1/zones",
"setURL" : "http://alarmdecoder.local:2222/api/v1/alarmdecoder/send",
"setPIN" : "1245",
"panicKey" : "",
"useSwitches" : ["panic","chime","away","stay","night"],
"DSCorHoneywell" : "Honeywell",
"chimeKey":"9",
}
I believe the port in the URLs and ports are inconsistent, I just didn't change them from the example. I only changed the "IP" to the host hame.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.