Page 4 of 6

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 7:07 am
by djstiky
Ok that worked but it broke homebridge. I get this when checking with "sudo systemctl status homebridge":

Process: 569 ExecStart=/usr/bin/homebridge $HOMEBRIDGE_OPTS (code=exited, status=1/FAILURE)

And it's a endless loop of crashing and relaunching.

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 7:45 am
by aficustree
it's probably erring out, have you run your config.json through jsonlint.com or can you get the logs of what the crash message is?

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 7:47 am
by djstiky
jsonlint.com says "Valid JSON"

How can I check the log?

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 7:52 am
by aficustree
Code: Select all
tail -f /var/log/homebridge.log
tail -f /var/log/homebridge.err

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 7:57 am
by djstiky
ok, I have it running as a service so I just did "tail -F /var/log/daemon.log". This part is interesting:

Code: Select all
Jun 18 11:58:18 homebridge homebridge[13437]: Load homebridge-alarmdecoder-platform.alarmdecoder-platform
Jun 18 11:58:18 homebridge homebridge[13437]: /usr/lib/node_modules/homebridge-alarmdecoder-platform/index.js:33
Jun 18 11:58:18 homebridge homebridge[13437]:         this.port = config.port;
Jun 18 11:58:18 homebridge homebridge[13437]:                            ^
Jun 18 11:58:18 homebridge homebridge[13437]: TypeError: Cannot read property 'port' of null
Jun 18 11:58:18 homebridge homebridge[13437]:     at new AlarmdecoderPlatform (/usr/lib/node_modules/homebridge-alarmdecoder-platform/index.js:33:28)
Jun 18 11:58:18 homebridge homebridge[13437]:     at Server._loadDynamicPlatforms (/usr/lib/node_modules/homebridge/lib/server.js:345:30)
Jun 18 11:58:18 homebridge homebridge[13437]:     at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:87:8)
Jun 18 11:58:18 homebridge homebridge[13437]:     at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
Jun 18 11:58:18 homebridge homebridge[13437]:     at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
Jun 18 11:58:18 homebridge homebridge[13437]:     at Module._compile (module.js:652:30)
Jun 18 11:58:18 homebridge homebridge[13437]:     at Object.Module._extensions..js (module.js:663:10)
Jun 18 11:58:18 homebridge homebridge[13437]:     at Module.load (module.js:565:32)
Jun 18 11:58:18 homebridge homebridge[13437]:     at tryModuleLoad (module.js:505:12)
Jun 18 11:58:18 homebridge homebridge[13437]:     at Function.Module._load (module.js:497:3)
Jun 18 11:58:18 homebridge systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 8:05 am
by aficustree
looks like your config file is missing the port entry. it should look something like below

Code: Select all
{
            "platform": "alarmdecoder-platform",
            "name": "Alarm",
            "port": "8888",
            "key": "API KEY GOES HERE",
            "stateURL": "http://10.0.1.4:2222/api/v1/alarmdecoder",
            "zoneURL": "http://10.0.1.4:2222/api/v1/zones",
            "setURL": "http://10.0.1.4:2222/api/v1/alarmdecoder/send",
            "setPIN": "1234"
        },


port is an open port on your server that the alarmdecoder webui will connect to, the URL entries should reflect your alarmdecoder webui host/port

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 8:12 am
by djstiky
This is what I have in my config.json

Code: Select all
"platform": "alarmdecoder-platform",
                        "name": "Alarm System",
                        "port": "911",
                        "key": "Whatever my key is",
                        "stateURL": "https://ip-of-alarmdecoder-gui:80/api/v1/alarmdecoder",
                        "zoneURL": "https://ip-of-alarmdecoder-gui:80/api/v1/zones",
                        "setURL": "https://ip-of-alarmdecoder-gui:80/api/v1/alarmdecoder/send",
                        "setPIN": "1234",
                        "DSCorHoneywell": "DSC",
                        "DSCStay": "<F4>",
                        "DSCAway": "<S5>",
                        "DSCReset": "<S7>",
                        "DSCExit": "<S8>"


In Alarmdecoder's config, I have:

URL: ip-of-homebridge:911
Path: /api/v1/
Method: POST
Type: JSON

So port is there, not sure what else to check.

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 8:21 am
by aficustree
can you try a port above 1025, i don't know if it'll work with reserved ports.

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 8:31 am
by djstiky
Changed port to 5001 in both notification settings of Alarmdecoder and config.json. Still got the same error.
I then tried something else:

For The URLs in config.json, I noticed AlarmDecoder runs HTTPS in my browser. So I changed it to:

Code: Select all
"stateURL": "https://192.168.222.7:443/api/v1/alarmdecoder",
"zoneURL": "https://192.168.222.7:443/api/v1/zones",
"setURL": "https://192.168.222.7:443/api/v1/alarmdecoder/send",


Notice the "https" and port 443

But it doesn't seem to change the fact that its still broken.

Re: Homebridge Plugin

PostPosted: Mon Jun 18, 2018 8:40 am
by aficustree
config is passed by homebridge into the constructor so there's something wrong with your JSON. Are you sure you've loaded the snipped section into the PLATFORMS section and not the ACCESSORIES section?