Page 5 of 6

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 8:45 am
by djstiky
Ok, here's my config.json

https://pastebin.com/BTHdddN4

Can't tell if im missing anything.

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 9:06 am
by aficustree
you have alarmdecoder-platform accidentally scoped into camera-ffmpeg, you need to end the camera array and then start a new platform

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 9:08 am
by djstiky
ok, let me see if I can figure that out. Not sure which brackets to add or remove.

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 9:10 am
by aficustree
line 67 replace
Code: Select all
}, {


with

Code: Select all
}]},{

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 9:31 am
by djstiky
YES! It's not crashing anymore! Wow, thank you so much.
However, the accessories are not showing up in the Home app though. Can we double check to see if my URLs are good in config.json or if im missing anything in the Alarmdecoder notifications settings?

Code: Select all
                        "platform": "alarmdecoder-platform",
                        "name": "Alarm System",
                        "port": "5001",
                        "key": "ABCDEFGHIJKL",
                        "stateURL": "http://192.168.222.7:80/api/v1/alarmdecoder",
                        "zoneURL": "http://192.168.222.7:80/api/v1/zones",
                        "setURL": "http://192.168.222.7:80/api/v1/alarmdecoder/send",
                        "setPIN": "1234",
                        "DSCorHoneywell": "DSC",
                        "DSCStay": "<F4>",
                        "DSCAway": "<S5>",
                        "DSCReset": "<S7>",
                        "DSCExit": "<S8>"


When I normally use my browser to access the GUI using http, it redirects me to HTTPS. Do we have to worry about that in the config.json?
Also, is the notification type supposed to be JSON? I have the option to set it to URLEncoded and XML as well.

I feel we're so close to getting it working. hehe.

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 10:37 am
by djstiky
Ok, I'm checking the homebridge log to see if it's getting any data. Here's a snippet:

Code: Select all
Jun 18 14:37:33 homebridge homebridge[379]: [2018-6-18 14:37:33] [Alarm System] {"last_message_received":"[10010001000000000D--],002,[000200000000000000000000000000],\"Secure or       Arm System    <>\"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_bypassed":{},"panel_fire_detected":false,"panel_on_battery":false,"panel_panicked":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}
Jun 18 14:37:33 homebridge homebridge[379]: [2018-6-18 14:37:33] [Alarm System] TypeError: Cannot set property 'state' of null
Jun 18 14:37:33 homebridge homebridge[379]:     at AlarmdecoderPlatform.getState (/usr/lib/node_modules/homebridge-alarmdecoder-platform/index.js:238:51)
Jun 18 14:37:33 homebridge homebridge[379]:     at <anonymous>
Jun 18 14:37:33 homebridge homebridge[379]:     at process._tickCallback (internal/process/next_tick.js:188:7)


Not sure about that "TypeError: Cannot set property 'state' of null" part and what it means. I also cannot see the devices when trying to add to the Home app.

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 11:54 am
by aficustree
when the system starts up it reaches out to the alarmdecoder system to pull the zone lists, if that operation fails it won't ever initialize the platform which is why when it receives a notification from alarmdecoder's webGUI it crashes. In your log you should see 'platform did not respond'. If that's the case you need to make sure your API is accessible on the port/address you think it is and your API key is correct. That's also why you don't see anything to add in home kit.

To check that it's at least accepting connections you can open a web browser and type

http://10.0.1.4:2222/api/v1/zones

(obviously replace with your IP and port). You should get an access denied.

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 12:17 pm
by djstiky
Ok, finally got it working.
URLs in config.json are fine with http even though the webgui redirects you to https.
Notification type JSON is fine in Alarmdecoder.
What finally made it work for me was to stop homebridge, delete cachedAccessories and everything in the Persist folder and then restart Homebridge.
This is SO cool. I can not thank you enough aficustree! Really appreciate the support you gave me throughout the day.

Re: Homebridge Plugin

PostPosted: Sun Aug 26, 2018 2:14 pm
by aficustree
just an update. I finally got around to making a new version.

- The ability to use switches to control the alarm state instead of the native alarm control (allows for the management of alarm state without authentication, typically for geofenced applications). Optional, configured via config.json.
- Fixed bugs that caused the target state to not report correctly
- Added an option to control chime state and trigger the panic alarm
- Fixed various logic bugs that make it a bit more efficient in operation
- KNOWN LIMITATIONS:
- Chime state is a toggle, the alarmdecoder REST API does not report chime state (or at least I can’t figure out how to poll it)
- When setting night mode, the system initially reports it in the home state. The state is properly set and the next refresh will properly update it. Limitation is because setting night happens after the mode is set to stay and the system reports the stay setting too quickly. Haven’t figured out how to address yet.
- read the notes on the security implications of using the switches on the readme.md file on the GitHub homepage

Re: Homebridge Plugin

PostPosted: Sat Nov 16, 2019 12:33 am
by Macntsh
Trying to get homebridge going and only running into this issue now.
[code][ _header: 'POST /api/v1/alarmdecoder/send HTTP/1.1\r\n' +
'Accept: application/json\r\n' +
'Content-Type: application/json\r\n' +
'Authorization: asdfasdfasdf\r\n' +
'User-Agent: axios/0.19.0\r\n' +
'Content-Length: 16\r\n' +
'Host: 10.0.1.131\r\n' +
'Connection: close\r\n' +
'\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
method: 'POST',
path: '/api/v1/alarmdecoder/send',
_ended: false,
res: null,
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
_redirectable: [Circular],
[Symbol(kNeedDrain)]: false,
[Symbol(isCorked)]: false,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
_currentUrl: 'https://1.1.1.1/api/v1/alarmdecoder/send'
},
response: undefined,
isAxiosError: true,
toJSON: [Function]
} /code]