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

Today I have tried to do a clean install but I am now in a worse position than I was. I have now got the 'problem authenticating with SmartThings error. Could the problem be that I have the latest version of node? I have v5.4.1.

If so, how do I go about downgrading it?

I’m trying to get this going on a always on Mac Mini running El Capitan. For far:

Installed the Xcode command line tools:
xcode-select --install
Installed homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
ran brew doctor
Next, install NPM (Node Package Manager)
brew install node
install Homebridge
sudo npm install -g home bridge This is the part that fails.
npm install -g homebridge
/usr/local/bin/homebridge -> /usr/local/lib/node_modules/homebridge/bin/homebridge

mdns@2.2.11 install /usr/local/lib/node_modules/homebridge/node_modules/mdns
node-gyp rebuild

Traceback (most recent call last):
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py”, line 11, in
import gyp
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 8, in
import gyp.input
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py”, line 883
except ImportError as e:
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.2.0
gyp ERR! command “/usr/local/Cellar/node/5.4.1/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge/node_modules/mdns
gyp ERR! node -v v5.4.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:mdns@2.2.11 mdns@2.2.11 install: node-gyp rebuild
npm WARN install:mdns@2.2.11 Exit status 1

ed25519@0.0.3 install /usr/local/lib/node_modules/homebridge/node_modules/ed25519
node-gyp rebuild

Traceback (most recent call last):
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py”, line 11, in
import gyp
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 8, in
import gyp.input
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py”, line 883
except ImportError as e:
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.2.0
gyp ERR! command “/usr/local/Cellar/node/5.4.1/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge/node_modules/ed25519
gyp ERR! node -v v5.4.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:ed25519@0.0.3 ed25519@0.0.3 install: node-gyp rebuild
npm WARN install:ed25519@0.0.3 Exit status 1

curve25519@1.1.0 install /usr/local/lib/node_modules/homebridge/node_modules/curve25519
node-gyp rebuild

Traceback (most recent call last):
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py”, line 11, in
import gyp
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 8, in
import gyp.input
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py”, line 883
except ImportError as e:
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.2.0
gyp ERR! command “/usr/local/Cellar/node/5.4.1/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge/node_modules/curve25519
gyp ERR! node -v v5.4.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:curve25519@1.1.0 curve25519@1.1.0 install: node-gyp rebuild
npm WARN install:curve25519@1.1.0 Exit status 1

bignum@0.11.0 install /usr/local/lib/node_modules/homebridge/node_modules/bignum
node-gyp configure build

Traceback (most recent call last):
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py”, line 11, in
import gyp
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 8, in
import gyp.input
File “/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py”, line 883
except ImportError as e:
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.2.0
gyp ERR! command “/usr/local/Cellar/node/5.4.1/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “configure” "build"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge/node_modules/bignum
gyp ERR! node -v v5.4.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:bignum@0.11.0 bignum@0.11.0 install: node-gyp configure build
npm WARN install:bignum@0.11.0 Exit status 1
/usr/local/lib
└── (empty)

npm ERR! code 1

Its been about a week and so far, my second installation of Homekit has been a success. Running rock solid. I haven’t really customized Eve yet and I haven’t installed anything else on the Pi. I had installed Apache, php, etc. the first time.

I’m about to start those things, so hopefully they won’t turn out to be the cause of the crashing issues.

Some observations…
There are certain devices that seem to work half the time. Siri will get the command right, but return a “sorry I can’t find any devices right now”. Then I’ll ask again, Siri will get the same command right, except it’ll work. Frustrating and not sure if that’s a siri thing, homekit thing, or homebridge thing.

Like Smarttiles, Homebridge also has trouble with my WeMo outlets. I’m using a WeMo insight and a regular WeMo outlet and it seems turning these OFF is a challenge. I’m going to create a momentary switch that will hopefully just work as a toggle and solve those issues.

The real kicker that I’m finding is this though…
Siri can’t really compete with Alexa when it comes to recognizing your voice. I have a dedicated phone plugged in in my family room and I have my 6s with me. When i’m in the room, tv on or not, Hey Siri picks me up about 50% of the time on either device. Alexa, from what I’ve seen from friends and family, can hear you even if you’re in another room. It’s hard to beat those 7 dedicated far field mics for this sort of implementation.

That’s what I’m rooting for this: http://www.theverge.com/2016/1/14/10766832/apple-siri-speaker-homekit-apple-music

1 Like

Wow, so I had to do all kinds of work to get this working, but I did manage to finally get it working. I’m still struggling with how to turn individual items on and off using Siri, but it works otherwise. Thanks to everyone in this thread for the suggestions and help!

3 Likes

I also have mine up and running. I reformatted my SD card (yet again) and followed the instructions in the GitHub wiki and used the latest node version. Instead of adding the homebridge Legacy plugins I first added the homebridge sonos plugin and got that working first before adding the legacy plugin. I have even managed to put the code in to start it on boot up.

I had the auth error and I think it was due to me forgetting to amend the SmartThings file to point to the UK server.

I am well pleased with myself.

2 Likes

I just came across this description of how to control a nest via homebridge:

http://www.idownloadblog.com/2015/12/18/control-nest-with-apple-watch-homekit-siri-homebridge/

Is it possible to control multiple devices via the same homebridge? I assume this means having multiple entries in a config.json file? Or does each config.json file require a separate homebridge (instance or server)?

1 Like

You put everything in the same config.json file.

Here’s an example of a working config.json file with multiple plugins:

{
    "bridge": {
        "name": "Your Homebridge",
        "username": "CC:22:3D:E3:CE:20",
        "port": 51826,
        "pin": "123-45-678 "
    },

    "description": "HomeKit Bridge",

    "platforms": [{
        "platform": "BelkinWeMo",
        "name": "WeMo Platform",
        "expected_accessories": "10",
        "timeout": "30",
        "no_motion_timer": "60",
        "homekit_safe": "1"
    }, {
        "platform": "HarmonyHub",
        "name": "Living Room Harmony Hub",
        "ip_address": "192.168.1.50 "
    }, {
        "platform": "Nest",

        "token": "**MUST FILL IN, READ-ME VERY IMPORTANT HERE",

        "clientId": "**NEED DEV API**",
        "clientSecret": "**NEED DEV API**",
        "code": "**NEED DEV API**"
    }, {
        "platform": "IFTTT",
        "name": "IFTTT",
        "makerkey": "**NEED TO ACTIVATE MAKER CHANNEL**",
        "accessories": [{
            "name": "IFTTT Test Accessory 1",
            "buttons": [{
                "caption": "A1-1",
                "triggerOn": "T1-1On",
                "triggerOff": "T1-1Off"
            }, {
                "caption": "A1-2",
                "triggerOn": "T1-2On",
                "triggerOff": "T1-2Off"
            }, {
                "caption": "A1-3",
                "trigger": "T1-3"
            }, {
                "caption": "A1-4",
                "trigger": "T1-4"
            }]
        }, {
            "name": "IFTTT Test Accessory 2",
            "buttons": [{
                "caption": "A2-1",
                "trigger": "T2-1"
            }, {
                "caption": "A2-2",
                "trigger": "T2-2"
            }, {
                "caption": "A2-3",
                "trigger": "T2-3"
            }, {
                "caption": "A2-4",
                "trigger": "T2-4"
            }]
        }]
    }]
}
1 Like

http://jsonlint.com is a Json validator where you can plug in your config.json to ensure its valid. Very helpful here.

3 Likes

Yes, excellent link. I couldn’t have managed to set mine up without it.

Couple of clarifying questions please.

  1. I currently run Homebridge with the Nest plugin for HomeKit control of Nest, is this still supported in this build or Homebridge mentioned here or can I use my current build and just use the HelloHomeBridge Groovy Plugin ?

  2. Can this integration currently control Keen Smart Vents through Homebridge/HomeKit ?

  3. Can the sensors (i.e. temp, motion, multipurpose) be bridged so that HomeKit can read and act on data from those ?

Thanks

WC

Ok thanks to this thread, I have everything up and running on a Mac with HomeBridge controlling my Nest and the Smarththings devices, wahoo ! Also implemented Rule Machine to trigger routines and thats working well too.

Couple of questions though:

  1. I have Keen Smart Vents (controllable HVAC vents) that report Temperature, Pressure and are controllable from 0 to 100% open. I am seeing that the only SmartApp that I can find that controls these today is a Light Switch App therefore it controls on/off (open/close of vent to last position) and dimmer control for the 0% to 100% amount open. I am noticing that in HomeBridge it pulls these over the same way, however the dimmer functionality doesn’t work, only open close. Using the dimmer slider in a HomeKit app doesn’t affect the open/close amount. Any ideas on whether either I am doing something wrong or if in fact this functionality is not integrated yet ?

  2. With regards to the vent reporting statuses (Temperature, Humidity, Pressure) those are not carried over to HomeKit through HomeBridge, is that a known limitation today or if not is there a better way to set these up ?

  3. Is there a better SmartApp to use for vent functionality that anyone is aware of for these Keen smart vents that I can incorporate into HomeBridge/HomeKit ?

Thanks all

WC

Thank you! I did get it working! Just adding the Nest platform information to my config.json worked. I did use the new Nest API (see setup here: https://www.npmjs.com/package/homebridge-nest ). jsonlint.com was a great help!

I have 3 nests in the house so the figuring out the Siri commands was a little bit of a challenge but I finally did:
“Set [room the thermostat is in] to XX Fahrenheit” .

Now I dont have to use virtual buttons anymore to include thermostat temp changes in my scenes…

Thank you!

Re (2): You can get the temp/humidity readings from your Nest thermostat by “What is the temperature in the [room name the Nest is in]” or “What is the humidity in the [room name the Nest is in]”

Any word on whether temperature can be ported across to HomeKit (through HomeBridge) for ST sensor and other devices supporting it such as smart vents ?

Right now I am finding smart vents don’t bring that info through and ST multipurpose sensors don’t… Similarly the smart vents seem to come through as lights with dimmer control but again as mentioned above, on/off (open/close) works but the dimmer piece (amount of open or close) does not carry through to HomeKit

I think this will require an update to the JSON API app. The current version only supports switches and hues.

I am not a great programmer but it does not look too complicated to do to add other device types after line 54… I am just afraid to mess up my reliably working homebridge if I try.

@pizzinini, right there with ya, don’t want to mess up something thats working well. Would like to add it to the ‘wish list’ for this app though :slight_smile:

This is actively being worked on.

Checkout this open GitHub issue on the homebridge repository:

Here is the developers GitHub repository for the new plugin and ST Smartapp

I would say it works but there are few things to still be ironed out, so report any issues to the developers GitHub repository

2 Likes

Thanks for sharing Huy, much appreciated !

I had the same issue. homebridge worked great for first 24h, then could not be seen by iOS devices but was still running ok. Starting and stopping the homebridge service on the RPI didn’t work. This is what finally worked for me (RPI 2 NOOBS/Raspian built 2 days ago):

systemctl stop homebridge
systemctl disable homebridge
rm -r /var/homebridge/persist
systemctl daemon-reload
systemctl enable homebridge
systemctl start homebridge

So far so good. I also switched from Insteon+ to Eve on the iOS side. Still trying to figure out how to get the garage door opener at least identified as a switch, though.

Hi all,

First, a big thanks to everyone who’s helped to develop homebridge and the various plugins!

I’ve installed homebridge and pdlove’s homebridge-smartthings on a RasPi model B using the latest Raspbian build (2016-02-09) and everything works fine (can connect and control several switches and power meter devices on SmartThings). :slight_smile:

However, after an hour or so my iPhone can no longer connect to any devices via homebridge. The only way I can get things working again is to empty ‘/var/homebridge/persist’ and reset the HomeKit database on the iPhone. This has happened several times since installing 48 hrs ago. The homebridge server is typically still running (as a service using systemd) with no obvious errors and I still get a response if I browse to http://myhost:51826/accessories, so looking for some help as I’m not sure where the issue could lie.

agladman’s solution unfortunately doesn’t work for me (at least not without resetting the Homekit database on the iPhone too)…

systemctl stop homebridge
systemctl disable homebridge
rm -r /var/homebridge/persist
systemctl daemon-reload
systemctl enable homebridge
systemctl start homebridge

Any tips, anyone?

Thanks.

1 Like