Homebridge 2.0 with Indigo plugin brings Siri to Indigo

Posted on
Sat Nov 07, 2015 4:13 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Homebridge 2.0 with Indigo plugin brings Siri to Indigo

NOTE: I have locked this very long thread, which was migrated over from another forum. Please post new topics in their own threads in this forum - thanks!

Homebridge 2.0 - New Release

Homebridge has been upgraded to version 2.0, and with that, there is a whole new way of doing things. The plugins are now separate modules that are installed independently. That means I will be able to update the homebridge-indigo plugin without needing to wait for it to be merged into homebridge. That also means it's easy for anyone else who wants to contribute improvements to the homebridge-indigo plugin to submit them to me for inclusion. Also, it makes it easy to install other homebridge plugins to bridge other systems into HomeKit.


Migrating from Homebridge 1.0

This section is only relevant if you were using Homebridge 1.0. First, if you were using Homebridge 1.0, you'll want to stop your homebridge server, take your config.json file and persist directory, and copy them into a new .homebridge (yes, with a leading period) directory in your home folder. You may want to edit your config.json as I have added new features. See below for more details. Here are example commands to move your files to the right location:
Code: Select all
cd path-to-wherever-you-have-homebridge-installed
mkdir ~/.homebridge
cp -rp config.json persist ~/homebridge



Installing Homebridge 2.0

See the new sticky thread with updated installation instructions.

-Mike
Last edited by webdeck on Mon Jan 25, 2016 11:26 pm, edited 5 times in total.

Posted on
Sat Nov 07, 2015 4:51 pm
petematheson offline
Posts: 733
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

Hey Mike - awesome work once again!

First one for you:
Loading 1 platforms...
[Matheson Manor] Initializing Indigo platform...
[Matheson Manor] Indigo base URL is http://127.0.0.1:8176
[Matheson Manor] Indigo request: http://127.0.0.1:8176/devices.json/
Loading 0 accessories...
/usr/local/lib/node_modules/homebridge-indigo/node_modules/request/request.js:1173
self.redirects.push(
^

TypeError: Cannot read property 'push' of undefined
at Request.onRequestResponse (/usr/local/lib/node_modules/homebridge-indigo/node_modules/request/request.js:1173:19)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:415:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
at Socket.socketOnData (_http_client.js:305:20)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)

Posted on
Sat Nov 07, 2015 4:55 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

petematheson wrote:
/usr/local/lib/node_modules/homebridge-indigo/node_modules/request/request.js:1173
self.redirects.push(
^

TypeError: Cannot read property 'push' of undefined
at Request.onRequestResponse (/usr/local/lib/node_modules/homebridge-indigo/node_modules/request/request.js:1173:19)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:415:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
at Socket.socketOnData (_http_client.js:305:20)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)


Wow, that's an error inside the request module of Node. Can you share your config.json?

Posted on
Sat Nov 07, 2015 5:00 pm
petematheson offline
Posts: 733
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},

"description": "This is an example configuration file to configure the Indigo platform plugin. See README.md for more details.",

"platforms": [
{
"platform": "Indigo",
"name": "My Indigo Server",
"protocol": "http",
"host": "127.0.0.1",
"port": "8176",
"path": "",
"username": "xxxxx",
"password": "xxxxx",
"includeActions": true
}
],

"accessories": [
]
}

Posted on
Sat Nov 07, 2015 5:09 pm
petematheson offline
Posts: 733
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

Also just tried a re-install of Node and npm but getting the same error (since I installed previously for home bridge v1)

Posted on
Sat Nov 07, 2015 5:20 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

petematheson wrote:
Hey Mike - awesome work once again!

First one for you:
Loading 1 platforms...
[Matheson Manor] Initializing Indigo platform...
[Matheson Manor] Indigo base URL is http://127.0.0.1:8176
[Matheson Manor] Indigo request: http://127.0.0.1:8176/devices.json/
Loading 0 accessories...
/usr/local/lib/node_modules/homebridge-indigo/node_modules/request/request.js:1173
self.redirects.push(
^

TypeError: Cannot read property 'push' of undefined
at Request.onRequestResponse (/usr/local/lib/node_modules/homebridge-indigo/node_modules/request/request.js:1173:19)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:415:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
at Socket.socketOnData (_http_client.js:305:20)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)


It was an issue with how node is handling authentication with Indigo and redirecting that I missed. Great catch! I pushed a fixed version. Just do sudo npm install -g homebridge-indigo to pick up the fixed version.

-Mike

Posted on
Sat Nov 07, 2015 5:34 pm
petematheson offline
Posts: 733
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

Now we're cooking - aside for some reason when I tried the re-install it's now decided to put it under a totally different directory under /opt instead of /usr
It scanned through all of my Indigo devices, but now I'm getting this error, possibly because of an Action Group?

[My Indigo Server] Ignoring unknown accessory type Plex Media Client
[My Indigo Server] Indigo request: http://127.0.0.1:8176/devices/Sonos%20Kitchen.json
[My Indigo Server] Discovered Sonos Zone Player (ID 1822020093): Sonos Kitchen
[My Indigo Server] Ignoring unknown accessory type Sonos Zone Player
[My Indigo Server] Indigo request: http://127.0.0.1:8176/devices/Sonos%20M ... droom.json
[My Indigo Server] Discovered Sonos Zone Player (ID 24514010): Sonos Master Bedroom
[My Indigo Server] Ignoring unknown accessory type Sonos Zone Player
[My Indigo Server] Indigo request: http://127.0.0.1:8176/devices/TekkersHQ%20Geofence.json
[My Indigo Server] Discovered Geofence Location Device (ID 1855040900): TekkersHQ Geofence
[My Indigo Server] Ignoring unknown accessory type Geofence Location Device
[My Indigo Server] Indigo request: http://127.0.0.1:8176/actions.json/
[My Indigo Server] Indigo request: http://127.0.0.1:8176/actions/0.json
[My Indigo Server] Discovered Action (ID 345151065): 0
/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:45
if (!displayName) throw new Error("Accessories must be created with a non-empty displayName.");
^

Error: Accessories must be created with a non-empty displayName.
at IndigoActionAccessory.Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:45:27)
at IndigoActionAccessory.IndigoAccessory (/usr/local/lib/node_modules/homebridge-indigo/index.js:302:15)
at new IndigoActionAccessory (/usr/local/lib/node_modules/homebridge-indigo/index.js:729:21)
at IndigoPlatform.createAccessoryFromJSON (/usr/local/lib/node_modules/homebridge-indigo/index.js:278:16)
at IndigoPlatform.<anonymous> (/usr/local/lib/node_modules/homebridge-indigo/index.js:196:42)
at IndigoPlatform.<anonymous> (/usr/local/lib/node_modules/homebridge-indigo/index.js:269:17)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-indigo/node_modules/request/request.js:373:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-indigo/node_modules/request/request.js:1318:14)

Posted on
Sat Nov 07, 2015 5:38 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

petematheson wrote:
Now we're cooking - aside for some reason when I tried the re-install it's now decided to put it under a totally different directory under /opt instead of /usr
It scanned through all of my Indigo devices, but now I'm getting this error, possibly because of an Action Group?


It looks like you have an action group that is named the single digit zero "0", which the Indigo RESTful API is returning as a number in JSON instead of a string. Can you rename the Action Group?

-Mike

Posted on
Sat Nov 07, 2015 5:42 pm
petematheson offline
Posts: 733
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

Awesome, that all loads up now - cheers !

Last issue I have is that it's not displaying in mytouchhome, but that's something I can probably figure out.... Just going to try restarting things first. Cheers!

Posted on
Sat Nov 07, 2015 5:45 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

webdeck wrote:
petematheson wrote:
Now we're cooking - aside for some reason when I tried the re-install it's now decided to put it under a totally different directory under /opt instead of /usr
It scanned through all of my Indigo devices, but now I'm getting this error, possibly because of an Action Group?


It looks like you have an action group that is named the single digit zero "0", which the Indigo RESTful API is returning as a number in JSON instead of a string. Can you rename the Action Group?

-Mike


FYI, I just pushed version 0.2.2 that converts the names to be strings. A device name of "0" may still cause fits however, because that evaluates to false in JavaScript if you compare it as a boolean.

-Mike

Posted on
Sat Nov 07, 2015 5:49 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

petematheson wrote:
Awesome, that all loads up now - cheers !

Last issue I have is that it's not displaying in mytouchhome, but that's something I can probably figure out.... Just going to try restarting things first. Cheers!


HomeKit easily gets confused. It's usually one of these two cases:

  1. Homebridge server thinks it's been paired with, but iOS thinks otherwise. Fix: delete the persist directory in your ~/.homebridge directory and restart homebridge.
  2. iOS device has gotten your Homebridge "username" (MAC address) "stuck" somehow, where it's in the database but inactive. Fix: change your "username" in the "bridge" section of config.json to be some new value (e.g. change the ending 30 to 31) and restart homebridge.

-Mike

Posted on
Sat Nov 07, 2015 6:02 pm
petematheson offline
Posts: 733
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

Almost there, still no luck though!
It now discovers Homebridge, but just says 'Adding Failed' Could not connect to accessory.

Posted on
Sat Nov 07, 2015 6:04 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

petematheson wrote:
Almost there, still no luck though!
It now discovers Homebridge, but just says 'Adding Failed' Could not connect to accessory.


Any errors from the homebridge output log?

-Mike

Posted on
Sat Nov 07, 2015 6:06 pm
petematheson offline
Posts: 733
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

Sorry, where do I find those exactly?

Posted on
Sat Nov 07, 2015 6:08 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Homebridge 2.0 with Indigo plugin brings Siri to Indigo

petematheson wrote:
Sorry, where do I find those exactly?


Sorry, by output log I meant what it is printing out in the Terminal window where you ran the homebridge command. It doesn't get saved to a file by default, it just prints it to the Terminal window.

-Mike

Who is online

Users browsing this forum: No registered users and 0 guests

cron