Homebridge for HomeKit hack

Posted on
Sun Nov 01, 2015 10:42 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Homebridge for HomeKit hack

As far as I can tell at the moment it's not possible because nothing tells HomeBridge that it's a lock. That's why I'd love to see a plugin in indigo for it that would allow you to define the type of device it is, as in device, light, lock, door, etc. I think it's quite important that devices and lights are defined separately too otherwise a command to Siri to "turn off all the lights" will result in some devices that aren't lights being turned off too. At least as far as my experiments have shown they are. Perhaps I'm missing something? But either way being able to say "lock the door" and it turn that device to "on" or "close the garage door" being translated to turning a virtual device off would be awesome!

Computer says no.

Posted on
Sun Nov 01, 2015 10:43 am
rehafer offline
Posts: 279
Joined: Feb 08, 2013

Re: Homebridge for HomeKit hack

I have some Aeotec multisensors installed and they show as switches in HomeKit. Is this to be expected or have missed an update made an error?
Admittedly, being able to ask Siri What's the Temperature in the Study, is a minor add compared the working cool features.



Sent from my iPhone using Tapatalk

Posted on
Sun Nov 01, 2015 4:15 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

durosity wrote:
As far as I can tell at the moment it's not possible because nothing tells HomeBridge that it's a lock. That's why I'd love to see a plugin in indigo for it that would allow you to define the type of device it is, as in device, light, lock, door, etc. I think it's quite important that devices and lights are defined separately too otherwise a command to Siri to "turn off all the lights" will result in some devices that aren't lights being turned off too. At least as far as my experiments have shown they are. Perhaps I'm missing something? But either way being able to say "lock the door" and it turn that device to "on" or "close the garage door" being translated to turning a virtual device off would be awesome!

Yeah, I agree defining a functional category for each device would be the cleanest way to do this, either through a plugin or an enhancement to Indigo itself. I suppose Indigo.js could infer that a device is a lock by looking at the type along with the name but that may get kludgy very quickly.

It's interesting that Insteon+ chooses different icons for some of the devices, including my virtual lock device, office light and several others. I think it's looking at the names since when I change the name of a device, the icon changes. I'm not sure if this is being done by the Insteon+ app itself or if HomeKit is involved. Maybe there is some algorithm being used that Indigo.js could use in the selection of a device category.

--Dave

Posted on
Sun Nov 01, 2015 4:40 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Homebridge for HomeKit hack

It could but as you said it could get kludgy. I think some way of mapping the function manually seems the most logical way. I just really wish I knew enough to do it myself. Perhaps one day I'll finally have time to learn Python :)

Computer says no.

Posted on
Sun Nov 01, 2015 8:51 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Homebridge for HomeKit hack

Perhaps one day I'll finally have time to learn Python

I'm going to go back to your posts and count how many times you have said this... :-)

Posted on
Sun Nov 01, 2015 11:49 pm
webdeck offline
Posts: 436
Joined: May 07, 2005

Re: Homebridge for HomeKit hack

DVDDave wrote:
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


I have an apache proxy in front of my Indigo server as well, for requests from the outside world, but why would you have homebridge talk to that? Can't you have homebridge talk directly to Indigo's web server?

Posted on
Mon Nov 02, 2015 12:08 am
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

webdeck wrote:
I have an apache proxy in front of my Indigo server as well, for requests from the outside world, but why would you have homebridge talk to that? Can't you have homebridge talk directly to Indigo's web server?

Hi Mike,
For some reason, even when I talk directly to Indigo I still need the extra /indigo layer, namely http://127.0.0.1:8176/indigo/devices. I would think it would work also but when I don't include it, nothing comes back. Maybe I have something misconfigured in the reverse proxy.
--Dave

Posted on
Mon Nov 02, 2015 1:22 am
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

DVDDave wrote:
webdeck wrote:
I have an apache proxy in front of my Indigo server as well, for requests from the outside world, but why would you have homebridge talk to that? Can't you have homebridge talk directly to Indigo's web server?

Hi Mike,
For some reason, even when I talk directly to Indigo I still need the extra /indigo layer, namely http://127.0.0.1:8176/indigo/devices. I would think it would work also but when I don't include it, nothing comes back. Maybe I have something misconfigured in the reverse proxy.
--Dave

I just remembered why the extra layer is needed to talk to Indigo directly. When I configured my reverse proxy, the links weren't coming back correctly in my control pages. Therefore, as recommended , I added /indigo/ to the Indigo root in my IndigoWebServer.conf file to make the links work.

Do you not have this issue with your reverse proxy?

--Dave

Posted on
Mon Nov 02, 2015 2:44 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Homebridge for HomeKit hack

RogueProeliator wrote:
Perhaps one day I'll finally have time to learn Python

I'm going to go back to your posts and count how many times you have said this... :-)


About 70! I start, then something comes up and I don't have time anymore. Then I start again and the cycle starts all over again. Plus I have a very bad memory :/

Computer says no.

Posted on
Mon Nov 02, 2015 11:02 pm
webdeck offline
Posts: 436
Joined: May 07, 2005

Re: Homebridge for HomeKit hack

DVDDave wrote:
I just remembered why the extra layer is needed to talk to Indigo directly. When I configured my reverse proxy, the links weren't coming back correctly in my control pages. Therefore, as recommended , I added /indigo/ to the Indigo root in my IndigoWebServer.conf file to make the links work.

Do you not have this issue with your reverse proxy?


I do my reverse proxy to another host name, so everything remains at the root level for me. What does your apache config look like? I thought the pair of ProxyPass and ProxyPassReverse are supposed to take care of all the rewriting transparently.

-Mike

Posted on
Tue Nov 03, 2015 12:18 am
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Homebridge for HomeKit hack

webdeck wrote:
I do my reverse proxy to another host name, so everything remains at the root level for me. What does your apache config look like? I thought the pair of ProxyPass and ProxyPassReverse are supposed to take care of all the rewriting transparently.

-Mike

Note that there was no problem with my configuration until I ran into an issue with a plugin that was not processing the returned paths correctly. This led to a suggestion to add /indigo to the Indigo root path and it worked. Now, I'm having a similar issue with Indigo.js since it is making assumptions about the URL that aren't true for a different root path. Wouldn't be hard to fix by explicitly including the Indigo root path in the config file and then adding it to the URL processing code for the initial query of the devices; i.e.

url: this.baseURL + config["root"] + /devices.json/"

where root would be "/indigo" in the config file. The rest of the processing is fine since you are using the URLs returned by Indigo.

However, I don't mind making the slight change to each new release. A small price to pay for this fantastic feature! :)

In any event, in response to your question, here are the contents of my Guest1.conf file:

<Directory "/Users/Guest1/Sites/">
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
ProxyPass /indigo/ http://localhost:8176/indigo/
ProxyPassReverse /indigo/ http://localhost:8176/indigo/

Thanks.

--Dave
Last edited by DVDDave on Tue Nov 03, 2015 11:44 pm, edited 1 time in total.

Posted on
Tue Nov 03, 2015 10:36 pm
rehafer offline
Posts: 279
Joined: Feb 08, 2013

Re: Homebridge for HomeKit hack

A Little News
My 4th gen AppleTV arrived today. After installing and set-up, I checked remote access to Homebridge and it worked as expected. I've seen no evidence that would tell me if the 4th gen is better than my 3rd gen; or if plugging in a new device did some iCloud voodoo.
BTW, I tried to turn on some lights with the AppleTVs Siri, it didn't work but I got a message the HomeKit wasn't supported yet. Maybe an app or update will bring it in the future.



Sent from my iPhone using Tapatalk

Posted on
Wed Nov 04, 2015 1:29 pm
chrismenke offline
Posts: 9
Joined: Dec 27, 2013

Re: Homebridge for HomeKit hack

So I moved to the new version of homebridge with homebridge-legacy-plugins, and the new version is spitting and error after discovery when it finds the first switch (a Z Wave Smart Energy Switch) called Airport (which was previously working. Here's the error. Anyone seen anything similar?

[Indigo] Loaded services for Airport
/usr/local/lib/node_modules/homebridge/lib/server.js:232
return accessoryLoader.parseAccessoryJSON({
^

ReferenceError: accessoryLoader is not defined
at Server._createAccessory (/usr/local/lib/node_modules/homebridge/lib/server.js:232:12)
at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:211:32)
at Object.callback (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:15:19)
at /usr/local/lib/node_modules/homebridge-legacy-plugins/platforms/Indigo.js:105:22
at /usr/local/lib/node_modules/homebridge-legacy-plugins/node_modules/async/lib/async.js:52:16
at /usr/local/lib/node_modules/homebridge-legacy-plugins/node_modules/async/lib/async.js:269:32
at /usr/local/lib/node_modules/homebridge-legacy-plugins/node_modules/async/lib/async.js:44:16
at Request._callback (/usr/local/lib/node_modules/homebridge-legacy-plugins/platforms/Indigo.js:96:21)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-legacy-plugins/node_modules/request/request.js:373:22)
at emitTwo (events.js:87:13)

Posted on
Wed Nov 04, 2015 2:24 pm
Londonmark offline
Posts: 509
Joined: Feb 29, 2012

Re: Homebridge for HomeKit hack

Been away from this for a couple of weeks. Two questions:
- has there been any progress on action groups? A few pages back there was a discussion about splitting the github repositories but I don't know if that has happened.
- is there a trick to getting the new Apple TV to act as a bridge? I've tried it but no dice. My iPhone has remote access for homekit kit enabled.

Posted on
Wed Nov 04, 2015 2:57 pm
rehafer offline
Posts: 279
Joined: Feb 08, 2013

Re: Homebridge for HomeKit hack

Londonmark wrote:
- is there a trick to getting the new Apple TV to act as a bridge? I've tried it but no dice. My iPhone has remote access for homekit kit enabled.


I don't believe I did anything special, with the possible exception that I used the iPhone with Homebridge/ HomeKit running on it for the Bluetooth setup data transfer.



Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 1 guest