Homebridge for HomeKit hack

Posted on
Fri Oct 30, 2015 8:03 am
smurfless1 offline
User avatar
Posts: 38
Joined: Sep 23, 2015
Location: Round Rock, TX

Re: Homebridge for HomeKit hack

Running automatically at user login:
1. save this to ~/Library/LaunchAgents/com.github.nfarina.homebridge.plist - remembering of course to change to your username and paths
2. run in Terminal 'launchctl load ~/Library/LaunchAgents/com.github.nfarina.homebridge.plist'
3. to run now, run in Terminal 'launchctl start com.github.nfarina.homebridge'. Use 'stop' to make it stop later if you want.
Next time you log in your user, it will automatically launch this (once). Once you're comfortable with it working properly, then you can delete the lines about stdout and stderr.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:$PATH</string>
<key>NODE_PATH</key>
<string>/Users/dbrown/homebridge/node_modules</string>
</dict>
<key>Label</key>
<string>com.github.nfarina.homebridge</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/node</string>
<string>app.js</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/Users/dbrown/homebridge</string>
<key>StandardErrorPath</key>
<string>/Users/dbrown/homebridge/stderr.txt</string>
<key>StandardOutPath</key>
<string>/Users/dbrown/homebridge/stdout.txt</string>
</dict>
</plist>


Also note that I compiled mine with NPM_CONFIG_PREFIX set so that maybe the whole thing might be in the same directory (I'm new at the node.js thing), so I included this in my EnvironmentVariables as well:

<key>NPM_CONFIG_PREFIX</key>
<string>/Users/dbrown/homebridge</string>

Posted on
Fri Oct 30, 2015 11:23 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

Success! I got Homebridge working with Indigo. Pretty cool how it discovers the devices. Thanks to all you pioneers for this!

I still have a lot to learn though. For example, I told Siri to "Turn on the Hall Light" but she heard "Turn on the Lights" and proceeded to turn on every light in the house! It's late here and I'm not looking forward to hearing what my sleeping wife has to say about this in the morning. :(

I'm sure I'll have much more to say about this, and hopefully something to contribute eventually.

--Dave

Posted on
Fri Oct 30, 2015 11:42 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

Mike,

I had to make a small change to Indigo.js to get it working. I use a reverse proxy to get Indigo to accept SSL (https) requests. A side effect is that all my URLs have an extra directory layer called indigo even for non-SSL requests.. I tried adding /indigo to the port in the configuration file but the URLs returned by Indigo when discovering devices already have the correct path and so Indigo.js was adding an extra layer to them.

So I changed line 48 to url: this.baseURL + "/indigo/devices.json/" , so the the extra layer would only be added to the first request.

I haven't dug into the code enough to recommend a more robust change but I wanted to alert you to the issue since I think others are using reverse proxies as well.

Thanks.

--Dave

Posted on
Sat Oct 31, 2015 6:44 am
rehafer offline
Posts: 279
Joined: Feb 08, 2013

Re: Homebridge for HomeKit hack

DVDDave wrote:
I still have a lot to learn though. For example, I told Siri to "Turn on the Hall Light" but she heard "Turn on the Lights" and proceeded to turn on every light in the house! It's late here and I'm not looking forward to hearing what my sleeping wife has to say about this in the morning. :(

--Dave


I've had similar Siri experiences, Some of my devices have "Bedroom" in the name, so I've changed the HomeKit room label to "Boudoir" to avoid unwanted reactions. :?
Hall and All may be too similar to Siri's ear.

Posted on
Sat Oct 31, 2015 7:11 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Homebridge for HomeKit hack

Yeah, I keep telling it to turn off the lounge main light.. But it always picks it as "lounge mean light". That said voice recognition and Scottish accents have never been particularly compatible.


Sent from my iPad using Tapatalk

Computer says no.

Posted on
Sat Oct 31, 2015 7:24 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Homebridge for HomeKit hack

durosity wrote:
Scottish accents have never been particularly compatible.

True.


Sent from my iPhone using Tapatalk

Posted on
Sat Oct 31, 2015 8:28 am
oktemplar offline
Posts: 20
Joined: Jan 22, 2009
Location: Newark, OH

Re: Homebridge for HomeKit hack

I've had this running now for nearly a week and it's working great controlling lights. I notice that the Nest Thermostat plugin device is not functioning or showing correct stats in Homebridge. Has anyone else tried using their Nest? I know I can set Nest up as a platform but I'm concerned about showing the device twice, once thru the Indigo API list and once thru the Homebridge Nest platform.

It would be really sweet if we had an additional setting in the Indigo Device listing where we could disable for API pulls. I've hidden some devices from remote display like others mention, but I'd like to still have them in Indigo Touch and this presents an issue ;)

I've also been using Siri both thru my Apple Watch and my iPhone and it has been flawless. A bit of a lag sometimes from the watch but it's instantaneous on my IPhone.

Thanks to all for the work on this, so sweet!

Posted on
Sat Oct 31, 2015 8:41 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Homebridge for HomeKit hack

Just out of interest is your nest set to F or C? I've had issues with it in C because it's trying to translate it to F... Atleast as best I can tell.


Sent from my iPad using Tapatalk

Computer says no.

Posted on
Sat Oct 31, 2015 3:14 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

Argh! I thought this was too good to be true. I got up this morning and tried a couple of Siri commands. They seemed to work but then stopped. Now I can't get any of the apps, including MyTouchHome, to find Homebridge from any of my iOS devices.

I've tried reseting HomeKit, rebooting everything, etc but still no luck. Homebridge loads the devices just like before and then waits for a client to connect but then nothing. No errors or anything, even in the system log. The only way I have been able to get anything into the Homebridge log is to port scan the server in which case it shows the connection opening and closing, so I know there is connectivity from my iPhone to my server.

Any ideas? Thanks.

--Dave

Posted on
Sat Oct 31, 2015 3:16 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Homebridge for HomeKit hack

Tried clearing out the persist folder?

Also I've it stop receiving commands recently when my router has rebooted.


Sent from my iPhone using Tapatalk

Computer says no.

Posted on
Sat Oct 31, 2015 3:22 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

durosity wrote:
Tried clearing out the persist folder?...

Success! Thanks so much!

Posted on
Sat Oct 31, 2015 10:13 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

I'm so jazzed about this! I've implemented several speech solutions for Indigo like the Echo and Siri text messaging, but this is the first one that works so fast and intuitively that I can see using it regularly. Sending Siri commands via the Apple Watch is especially handy.

It's really easy to set up after the initial installation work is done. Would be nice if changes in Indigo propagated to HomeKit without having to restart Homebridge, but that's no big deal. Maybe I could implement a shell script that Indigo could trigger to do that task.

Also, Indigo virtual devices make this even more powerful. It's very easy to configure an on/off device that triggers actions when its switched and even return status via a variable. This nicely gets around Homekit's limitations.

Thanks again to all the people that showed us the way! It's great to realize that this is only the beginning.

--Dave

Posted on
Sun Nov 01, 2015 12:05 am
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

DVDDave wrote:
Would be nice if changes in Indigo propagated to HomeKit without having to restart Homebridge, but that's no big deal. Maybe I could implement a shell script that Indigo could trigger to do that task.

Shell scripts to stop and start Homebridge work perfectly in Indigo actions. I even set up a virtual device so I can tell Siri to "Turn HomeKit on" which runs an action that stops and then restarts Homebridge. Too much fun!

Posted on
Sun Nov 01, 2015 12:15 am
BassMint offline
Posts: 105
Joined: Dec 24, 2013

Re: Homebridge for HomeKit hack

Re Nest Thermostats...
Didn't realize I could plug them into the system until reading the posts here.
All 3, a 1st, 2nd and 3rd Gen recognized and working, so far.

Posted on
Sun Nov 01, 2015 9:25 am
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

Is there any way to get Homebridge to treat my Insteon door lock as a security device? I have it set up to turn on and off as a virtual device, but it would be nice to say "Unlock the door" and also to require the phone to be unlocked for additional security. Possibly the same question for the alarm, although I'm not sure HomeKit has a mechanism for this.

BTW, Homebridge works great with my Insteon thermostat. I did not have to do any additional configuration to make it work.

Thanks.

--Dave

Who is online

Users browsing this forum: No registered users and 1 guest