[OBSOLETE] Hello, Home HomeKit (and Siri!) control via homebridge

> [Sat Sep 17 2016 23:18:13 GMT-0700 (PDT)] ERROR LOADING PLUGIN homebridge-smartthings:
> [Sat Sep 17 2016 23:18:13 GMT-0700 (PDT)] SyntaxError: Unexpected token (
>     at Module._compile (module.js:439:25)
>     at Object.Module._extensions..js (module.js:474:10)
>     at Module.load (module.js:356:32)
>     at Function.Module._load (module.js:312:12)
>     at Module.require (module.js:364:17)
>     at require (module.js:380:17)
>     at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:65:22)
>     at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:112:14)
>     at Array.forEach (native)
>     at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:108:22)

Any thoughts on why this is happening?

Any idea what I’m doing wrong?

I also found this thread:

I have not done any coding in over 20 years… so the fix looks pretty complicated to me :slight_smile: Maybe just start from scratch and re-install. :open_mouth:

awesome sir thank you! Not sure how you found that. Perhaps googling while sleepy is a bad idea. I got everything running however nothing shows in the add accessory of homekit.

all I get when i boot it up.
[9/19/2016, 10:35:12 PM] —
[9/19/2016, 10:35:12 PM] Loaded plugin: homebridge-smartthings
[9/19/2016, 10:35:12 PM] Registering platform ‘homebridge-smartthings.SmartThings’
[9/19/2016, 10:35:12 PM] —
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

Have selected any devices in the “JSON API” SmartThings app? The log should list all the accessories you have specified.

I have. Do I need to do anything with that info?

Did you enable OAuth for the JSON API Smartthings SmartApp? from what you are saying, it looks like you have Homebridge running but the connection to SmartThings is somehow not working?

I can confirm that oauth is on.

Sorry, this is all I can think of… but I am sure there are smarter people than me in this forum.

During my initial setup I had to wipe everything clean twice and start over before i got it to work. It has been rock solid for about a year now though.

alright thanks!

I deleted everything and started over…Still no dice
I deleted the contents of the ~/.homebridge folder and nothing…
any other hits folks?

@MacBenTosh I can double check my setup when I get home tonight. Though since this is a LONG thread and I’ve only been half-paying attention, could you give a quick summary of the steps you followed (github links too if you have them) and the errors you’re seeing? Feel free to PM me as well.

@pizzinini awesome got my devices to show up. However they are. It responding. :disappointed:

good news!

I had trouble getting devices to respond when I used the Eve or iDevice iphone app but the new Home app in iOS10 usually works fine.

In the past when non of my (~50) devices responded and a reboot of the pi where I installed Homebridge helped. the one time it did not help, I had to delete and re-set up my Homekit configuration to fix the issue.

I have created the config.json and put it in the /root/.homebridge directory, but I am recieving this error:

[10/4/2016, 3:56:40 AM] No plugins found. See the README for information on installing plugins.
[10/4/2016, 3:56:40 AM] There was a problem reading your config.json file.
[10/4/2016, 3:56:40 AM] Please try pasting your config.json file here to validate it: http://jsonlint.com
[10/4/2016, 3:56:40 AM]
/usr/lib/node_modules/homebridge/lib/server.js:194
throw err;
^

SyntaxError: Unexpected token
in JSON at position 203
at Object.parse (native)
at Server._loadConfig (/usr/lib/node_modules/homebridge/lib/server.js:188:19)
at new Server (/usr/lib/node_modules/homebridge/lib/server.js:49:23)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:26:16)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:556:32)
at Object.Module._extensions…js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)

Here is my config.json content:

{
“bridge”: {
“name”: “Homebridge”,
“username”: “D0:00:00:00:00:00”,
“port”: 51826,
“pin”: “031-45-154”
},

“description”: “JSON API”,
“platforms”: [{
“platform”: “SmartThings”,
“name”: “SmartThings”, "
app_url": "https://graph-na02-useast1.api.smartthings.com:443/api/smartapps/ins$
“app_id”: “f73f7bf6-77f3-48ff-888f-6974cee4a3bc”,
“access_token”: “632770c8-6b30-4e76-aea0-409ffd629143”
}]
}

You have an extra double-quote after:

"name": "SmartThings"," 

Pasting that snippet into the mentioned http://jsonlint.com should help show this and any other errors. It’s still a little messy after that too so you’ll have some other issues to fix after you fix the first.

Just keep fixing them until it’s green.

Thanks. I fixed it and I’m fully up and running. Someone should really fix the OP as the instructions are basically worthless.

I have set up homebridge on my Rasp Pi 2 and everything is working fine. Regarding functionality though, can I initiate a routine through Siri?

What I can do so far is pretty trivial, e.g. turn on a light or make a siren go off.

Thanks

I’m not sure myself. I need to look into this as well. I have seen YouTube videos of people doing things like this but haven’t found the documentation yet. I had to use a mix of instructions to get this all working. I should probabaly write it al down in case I have to do it again. Or at least clone my pi just to avoid headaches in the future.

Congrats to getting this up and running.

One way to initiate a routine is to create a virtual switch (momentary contact) that you control via homebridge. Then you use one of the rule apps (e.g. Smartrules, CoRE) to launch the the routine (or whatever else you want smartthings to do) if the switch is turned on.

To make it more intuitive you can create a scene (e.g. “I am home” or “good night” ) in Homekit that turns on the virtual switch.

For advanced users: You can set up your rules in a way that the same phrase does different things based on time of day e.g. “hello home” may only turn on certain lights if it is after sunset etc…