Page 8 of 10

Re: Homebridge for HomeKit hack

PostPosted: Fri Oct 30, 2015 8:03 am
by smurfless1
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>

Re: Homebridge for HomeKit hack

PostPosted: Fri Oct 30, 2015 11:23 pm
by DVDDave
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

Re: Homebridge for HomeKit hack

PostPosted: Fri Oct 30, 2015 11:42 pm
by DVDDave
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

Re: Homebridge for HomeKit hack

PostPosted: Sat Oct 31, 2015 6:44 am
by rehafer
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.

Re: Homebridge for HomeKit hack

PostPosted: Sat Oct 31, 2015 7:11 am
by durosity
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

Re: Homebridge for HomeKit hack

PostPosted: Sat Oct 31, 2015 7:24 am
by howartp
durosity wrote:
Scottish accents have never been particularly compatible.

True.


Sent from my iPhone using Tapatalk

Re: Homebridge for HomeKit hack

PostPosted: Sat Oct 31, 2015 8:28 am
by oktemplar
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!

Re: Homebridge for HomeKit hack

PostPosted: Sat Oct 31, 2015 8:41 am
by durosity
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

Re: Homebridge for HomeKit hack

PostPosted: Sat Oct 31, 2015 3:14 pm
by DVDDave
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

Re: Homebridge for HomeKit hack

PostPosted: Sat Oct 31, 2015 3:16 pm
by durosity
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

Re: Homebridge for HomeKit hack

PostPosted: Sat Oct 31, 2015 3:22 pm
by DVDDave
durosity wrote:
Tried clearing out the persist folder?...

Success! Thanks so much!

Re: Homebridge for HomeKit hack

PostPosted: Sat Oct 31, 2015 10:13 pm
by DVDDave
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

Re: Homebridge for HomeKit hack

PostPosted: Sun Nov 01, 2015 12:05 am
by DVDDave
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!

Re: Homebridge for HomeKit hack

PostPosted: Sun Nov 01, 2015 12:15 am
by BassMint
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.

Re: Homebridge for HomeKit hack

PostPosted: Sun Nov 01, 2015 9:25 am
by DVDDave
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