Homebridge Plugin

Contribute source code here. Anything not accompanied by source code will be removed.

Re: Homebridge Plugin

Postby djstiky » Mon Jun 18, 2018 7:07 am

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.
djstiky
newt
newt
 
Posts: 12
Joined: Mon Jun 18, 2018 6:06 am

Re: Homebridge Plugin

Postby aficustree » Mon Jun 18, 2018 7:45 am

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?
aficustree
Junior Nut
Junior Nut
 
Posts: 23
Joined: Sun Jun 11, 2017 7:20 pm

Re: Homebridge Plugin

Postby djstiky » Mon Jun 18, 2018 7:47 am

jsonlint.com says "Valid JSON"

How can I check the log?
djstiky
newt
newt
 
Posts: 12
Joined: Mon Jun 18, 2018 6:06 am

Re: Homebridge Plugin

Postby aficustree » Mon Jun 18, 2018 7:52 am

Code: Select all
tail -f /var/log/homebridge.log
tail -f /var/log/homebridge.err
aficustree
Junior Nut
Junior Nut
 
Posts: 23
Joined: Sun Jun 11, 2017 7:20 pm

Re: Homebridge Plugin

Postby djstiky » Mon Jun 18, 2018 7:57 am

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
djstiky
newt
newt
 
Posts: 12
Joined: Mon Jun 18, 2018 6:06 am

Re: Homebridge Plugin

Postby aficustree » Mon Jun 18, 2018 8:05 am

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
Last edited by aficustree on Mon Jun 18, 2018 8:57 am, edited 1 time in total.
aficustree
Junior Nut
Junior Nut
 
Posts: 23
Joined: Sun Jun 11, 2017 7:20 pm

Re: Homebridge Plugin

Postby djstiky » Mon Jun 18, 2018 8:12 am

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.
djstiky
newt
newt
 
Posts: 12
Joined: Mon Jun 18, 2018 6:06 am

Re: Homebridge Plugin

Postby aficustree » Mon Jun 18, 2018 8:21 am

can you try a port above 1025, i don't know if it'll work with reserved ports.
aficustree
Junior Nut
Junior Nut
 
Posts: 23
Joined: Sun Jun 11, 2017 7:20 pm

Re: Homebridge Plugin

Postby djstiky » Mon Jun 18, 2018 8:31 am

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.
djstiky
newt
newt
 
Posts: 12
Joined: Mon Jun 18, 2018 6:06 am

Re: Homebridge Plugin

Postby aficustree » Mon Jun 18, 2018 8:40 am

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?
aficustree
Junior Nut
Junior Nut
 
Posts: 23
Joined: Sun Jun 11, 2017 7:20 pm

PreviousNext

Return to Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest

cron