Homebridge for HomeKit hack

Posted on
Sun Oct 18, 2015 2:23 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Homebridge for HomeKit hack

cd homebridge
npm install async

Posted on
Sun Oct 18, 2015 2:29 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Homebridge for HomeKit hack

Argh.. i almost tried that and thought to myself 'nah it can't be that'.. honestly i could slap myself.

thanks :D

Computer says no.

Posted on
Sun Oct 18, 2015 2:46 pm
webdeck offline
Posts: 436
Joined: May 07, 2005

Re: Homebridge for HomeKit hack

dgarozzo wrote:
cd homebridge
npm install async


Sorry about that extra step being necessary. Hopefully your pull request that fixes that will be merged soon.

-Mike

Posted on
Sun Oct 18, 2015 2:48 pm
Londonmark offline
Posts: 509
Joined: Feb 29, 2012

Re: Homebridge for HomeKit hack

I've made some progress but am still stuck with this error:

Starting HomeBridge server...
_____________________________________________________________________
IMPORTANT: Homebridge is in the middle of some big changes.
Read more about it here:
https://github.com/nfarina/homebridge/w ... tion-Guide
_____________________________________________________________________

Loading 0 platforms...
Loading 27 accessories...
module.js:460
return process.dlopen(module, path._makeLong(filename));
^

Error: Module did not self-register.
at Error (native)
at Object.Module._extensions..node (module.js:460:18)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at new require (module.js:385:17)
at Object.<anonymous> (/Users/markcaines/homebridge/node_modules/HAP-NodeJS/node_modules/srp/node_modules/bignum/index.js:4:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)

Posted on
Sun Oct 18, 2015 2:50 pm
webdeck offline
Posts: 436
Joined: May 07, 2005

Re: Homebridge for HomeKit hack

They renamed the HAP-NodeJS module to be all lower case. Download it again and redo the
npm install
and that may fix it.

Londonmark wrote:
I've made some progress but am still stuck with this error:

Starting HomeBridge server...
_____________________________________________________________________
IMPORTANT: Homebridge is in the middle of some big changes.
Read more about it here:
https://github.com/nfarina/homebridge/w ... tion-Guide
_____________________________________________________________________

Loading 0 platforms...
Loading 27 accessories...
module.js:460
return process.dlopen(module, path._makeLong(filename));
^

Error: Module did not self-register.
at Error (native)
at Object.Module._extensions..node (module.js:460:18)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at new require (module.js:385:17)
at Object.<anonymous> (/Users/markcaines/homebridge/node_modules/HAP-NodeJS/node_modules/srp/node_modules/bignum/index.js:4:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)

Posted on
Sun Oct 18, 2015 2:54 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Homebridge for HomeKit hack

I was able to somehow get Homebridge "working" again, and started adding my changes to add Actions support, but then I ran into some problems, and now I'm stuck with Homebridge "not broadcasting" again. Or at least, when I click "Add a Device" on my iPhone (Insteon+), nothing is found. I reverted back to your Indigo.js file, and it still can't find Homebridge. So frustrating.

Posted on
Sun Oct 18, 2015 2:57 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Homebridge for HomeKit hack

Londonbridge,

Are you sure your config.json file is set up correctly? Your log shows:

Loading 0 platforms...
Loading 27 accessories...

But I think it should load 1 platform and 0 accessories.

Posted on
Sun Oct 18, 2015 3:03 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Homebridge for HomeKit hack

I may have found my problem.... I believe it has to do with the contents of the persist folder - AccessoryInfo and IdentifierCache. If I blow those away, I think Homebridge starts up clean.

Posted on
Sun Oct 18, 2015 3:10 pm
BassMint offline
Posts: 105
Joined: Dec 24, 2013

Re: Homebridge for HomeKit hack

doing a new install to get the new additions got the async requirement
running this in the home bridge directory from the terminal took that away,
Code: Select all
npm install async


edit: but thats already mentioned..
Last edited by BassMint on Sun Oct 18, 2015 3:20 pm, edited 1 time in total.

Posted on
Sun Oct 18, 2015 3:16 pm
Londonmark offline
Posts: 509
Joined: Feb 29, 2012

Re: Homebridge for HomeKit hack

dgarozzo

You found the problem for me. I have edited the config file adding a platform and deleting all of the accessories. It now seems to be working (although I have some device names to simplify).

Not sure why I need to delete all the accessories though - I was hoping to edit those to give me the names I wanted (and to exclude some).

LM

Posted on
Sun Oct 18, 2015 3:23 pm
webdeck offline
Posts: 436
Joined: May 07, 2005

Re: Homebridge for HomeKit hack

webdeck wrote:
FYI, I've submitted a pull request for what I think will fix the connection reset error that some people are seeing. I changed it to discover one device at a time so it doesn't overwhelm Indigo with REST calls. I also added more error checking so that if Indigo returns JSON that doesn't parse correctly, it will ignore it and log an error instead of crashing. I'll post here when the new version has been merged into the mainline.

-Mike


These updates have been added to nfarina's repository. This should address the connection reset error some people saw. It also incorporates dgarozzo's fix to automatically install the async dependency when you do an npm install.

-Mike

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

Re: Homebridge for HomeKit hack

Hmm.. so i've updated to the latest version but i've got an odd issue where when adding to the HomeKit app on my iPhone i'm getting an error stating:

"Adding Failed: Could not connect to the accessory"

Code: Select all
accent:~ Mike$ cd homebridge
accent:homebridge Mike$ npm run start

> homebridge@0.1.1 start /Users/Mike/homebridge
> DEBUG=* node app.js || true

Starting HomeBridge server...
_____________________________________________________________________
IMPORTANT: Homebridge is in the middle of some big changes.
           Read more about it here:
           https://github.com/nfarina/homebridge/wiki/Migration-Guide
_____________________________________________________________________

Loading 1 platforms...
[Indigo] Initializing Indigo platform...
[Indigo] Discovering Indigo Devices.
Loading 0 accessories...
[Indigo] Discovered undefined: Bedroom 1 - Blinds
[Indigo] Discovered undefined: Dining - Fish Tank Light
[Indigo] Discovered undefined: Dining - Patio Doors Lock Sensor
[Indigo] Discovered undefined: Gym - Air Cooler
[Indigo] Discovered undefined: Gym - Main Light
[Indigo] Discovered undefined: Hall - Front Door Lock Sensor
[Indigo] Discovered undefined: Hall - Letterbox Sensor
[Indigo] Discovered undefined: Hall - Stairs Sensor (Bottom)
[Indigo] Discovered undefined: Hall - Stairs Sensor (Top)
[Indigo] Discovered undefined: Heating: Solar Water Heating
[Indigo] Discovered undefined: Kitchen - George Grill
[Indigo] Discovered undefined: Kitchen - iKettle
[Indigo] Discovered undefined: Kitchen - Worktop Lights (LWRF Under Microwave)
[Indigo] Discovered undefined: Landing - Cupboard Door Sensor
[Indigo] Discovered undefined: Loft - Hatch Door Sensor
[Indigo] Discovered undefined: Lounge - Blinds
[Indigo] Discovered undefined: Lounge - TV Unit LEDs
[Indigo] Discovered undefined: Outdoors - Electric Meter
[Indigo] Discovered undefined: Outdoors - Front Door Motion Sensor
[Indigo] Discovered undefined: Outdoors - Garden Lights
[Indigo] Discovered undefined: Outdoors - Gas Meter
[Indigo] Discovered undefined: Outdoors - Gate Lock
[Indigo] Discovered undefined: Outdoors - Gate Sensor
[Indigo] Discovered undefined: Outdoors - Lux Sensor
[Indigo] Discovered undefined: Outdoors - Path Lights
[Indigo] Discovered undefined: Outdoors - Water Meter
[Indigo] Discovered undefined: Server - Cupboard UPS
[Indigo] Discovered undefined: Utility - Back Door Lock Sensor
[Indigo] Discovered undefined: Utility - Extractor Fan
[Indigo] Discovered Combined Fibaro RGBW device: ZZ Fibaro rgbw test!
[Indigo] Discovered Random Lighting Group: ZZ Random Lighting Mocupancy
[Indigo] Initializing platform accessory 'Bedroom 1 - Blinds'...
[Indigo] Loaded services for Bedroom 1 - Blinds
[Indigo] Initializing platform accessory 'Dining - Fish Tank Light'...
[Indigo] Loaded services for Dining - Fish Tank Light
[Indigo] Initializing platform accessory 'Dining - Patio Doors Lock Sensor'...
[Indigo] Loaded services for Dining - Patio Doors Lock Sensor
[Indigo] Initializing platform accessory 'Gym - Air Cooler'...
[Indigo] Loaded services for Gym - Air Cooler
[Indigo] Initializing platform accessory 'Gym - Main Light'...
[Indigo] Loaded services for Gym - Main Light
[Indigo] Initializing platform accessory 'Hall - Front Door Lock Sensor'...
[Indigo] Loaded services for Hall - Front Door Lock Sensor
[Indigo] Initializing platform accessory 'Hall - Letterbox Sensor'...
[Indigo] Loaded services for Hall - Letterbox Sensor
[Indigo] Initializing platform accessory 'Hall - Stairs Sensor (Bottom)'...
[Indigo] Loaded services for Hall - Stairs Sensor (Bottom)
[Indigo] Initializing platform accessory 'Hall - Stairs Sensor (Top)'...
[Indigo] Loaded services for Hall - Stairs Sensor (Top)
[Indigo] Initializing platform accessory 'Heating: Solar Water Heating'...
[Indigo] Loaded services for Heating: Solar Water Heating
[Indigo] Initializing platform accessory 'Kitchen - George Grill'...
[Indigo] Loaded services for Kitchen - George Grill
[Indigo] Initializing platform accessory 'Kitchen - Worktop Lights (LWRF Under Microwave)'...
[Indigo] Loaded services for Kitchen - Worktop Lights (LWRF Under Microwave)
[Indigo] Initializing platform accessory 'Kitchen - iKettle'...
[Indigo] Loaded services for Kitchen - iKettle
[Indigo] Initializing platform accessory 'Landing - Cupboard Door Sensor'...
[Indigo] Loaded services for Landing - Cupboard Door Sensor
[Indigo] Initializing platform accessory 'Loft - Hatch Door Sensor'...
[Indigo] Loaded services for Loft - Hatch Door Sensor
[Indigo] Initializing platform accessory 'Lounge - Blinds'...
[Indigo] Loaded services for Lounge - Blinds
[Indigo] Initializing platform accessory 'Lounge - TV Unit LEDs'...
[Indigo] Loaded services for Lounge - TV Unit LEDs
[Indigo] Initializing platform accessory 'Outdoors - Electric Meter'...
[Indigo] Loaded services for Outdoors - Electric Meter
[Indigo] Initializing platform accessory 'Outdoors - Front Door Motion Sensor'...
[Indigo] Loaded services for Outdoors - Front Door Motion Sensor
[Indigo] Initializing platform accessory 'Outdoors - Garden Lights'...
[Indigo] Loaded services for Outdoors - Garden Lights
[Indigo] Initializing platform accessory 'Outdoors - Gas Meter'...
[Indigo] Loaded services for Outdoors - Gas Meter
[Indigo] Initializing platform accessory 'Outdoors - Gate Lock'...
[Indigo] Loaded services for Outdoors - Gate Lock
[Indigo] Initializing platform accessory 'Outdoors - Gate Sensor'...
[Indigo] Loaded services for Outdoors - Gate Sensor
[Indigo] Initializing platform accessory 'Outdoors - Lux Sensor'...
[Indigo] Loaded services for Outdoors - Lux Sensor
[Indigo] Initializing platform accessory 'Outdoors - Path Lights'...
[Indigo] Loaded services for Outdoors - Path Lights
[Indigo] Initializing platform accessory 'Outdoors - Water Meter'...
[Indigo] Loaded services for Outdoors - Water Meter
[Indigo] Initializing platform accessory 'Server - Cupboard UPS'...
[Indigo] Loaded services for Server - Cupboard UPS
[Indigo] Initializing platform accessory 'Utility - Back Door Lock Sensor'...
[Indigo] Loaded services for Utility - Back Door Lock Sensor
[Indigo] Initializing platform accessory 'Utility - Extractor Fan'...
[Indigo] Loaded services for Utility - Extractor Fan
[Indigo] Initializing platform accessory 'ZZ Fibaro rgbw test!'...
[Indigo] Loaded services for ZZ Fibaro rgbw test!
[Indigo] Initializing platform accessory 'ZZ Random Lighting Mocupancy'...
[Indigo] Loaded services for ZZ Random Lighting Mocupancy
Scan this code with your HomeKit App on your iOS device:
                       
    ┌────────────┐     
    │ 123-45-123 │     
    └────────────┘     
                       
  Accessory [Homebridge] Creating new AccessoryInfo for our HAP server +0ms
  Accessory [Homebridge] Creating new IdentifierCache +5ms
  EventedHTTPServer Server listening on port 51826 +26ms
  EventedHTTPServer [::ffff:192.168.1.107] New connection from client +19s
  EventedHTTPServer [::ffff:192.168.1.107] HTTP server listening on port 54826 +2ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP request: /pair-setup +6ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-setup +1ms
  HAPServer [CC:22:3D:E3:CE:30] Pair step 1/5 +1ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP Repsonse is finished +17ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP request: /pair-setup +6s
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-setup +1ms
  HAPServer [CC:22:3D:E3:CE:30] Pair step 2/5 +1ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP Repsonse is finished +15ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP request: /pair-setup +9ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-setup +0ms
  HAPServer [CC:22:3D:E3:CE:30] Pair step 3/5 +1ms
  HAPServer [CC:22:3D:E3:CE:30] Pair step 4/5 +6ms
  HAPServer [CC:22:3D:E3:CE:30] Pair step 5/5 +1ms
  Accessory [Homebridge] Paired with client C251D8D3-AC8F-47FE-9844-3A82399BDC61 +5ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP Repsonse is finished +4ms
  EventedHTTPServer [::ffff:192.168.1.107] Client connection closed +28ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP connection was closed +2ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP server was closed +1ms
  EventedHTTPServer [::ffff:192.168.1.107] New connection from client +2ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP server listening on port 54826 +0ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP request: /pair-verify +2ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2 +2ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP Repsonse is finished +2ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP request: /pair-verify +11ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2 +1ms
  HAPServer [CC:22:3D:E3:CE:30] Client C251D8D3-AC8F-47FE-9844-3A82399BDC61 verification complete +4ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP Repsonse is finished +2ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP request: /accessories +10ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories +0ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP Repsonse is finished +20ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP request: /pairings +55ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pairings +1ms
  HAPServer [CC:22:3D:E3:CE:30] Removing pairing info for client +1ms
  Accessory [Homebridge] Unpairing with client C251D8D3-AC8F-47FE-9844-3A82399BDC61 +0ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP Repsonse is finished +3ms
  EventedHTTPServer [::ffff:192.168.1.107] Client connection closed +18ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP connection was closed +1ms
  EventedHTTPServer [::ffff:192.168.1.107] HTTP server was closed +0ms


As it stands right now my DB only has 1 item ticked for remote display. I've cleared out the persist folder, deleted all existing items from the iOS app, and made a sacrifice to my god but no joy. Now interestingly if i create a new DB and just adding one device to it works perfectly, so i suspect there's something in my existing DB that's causing the issue but i can't identify what it is.

Computer says no.

Posted on
Sun Oct 18, 2015 8:03 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Homebridge for HomeKit hack

Webdeck/Mike,

I'm stuck trying to add actions. I checked my code in here: https://github.com/dgarozzo/homebridge/. Can you have a look? Maybe you can tell what I've done wrong. When I go to connect from my iPhone to Homebridge, it tells me that my "device" doesn't conform to Homekit. Right now, I have the lines commented out that are responsible for adding the action, so you won't see the problem until you uncomment those lines.

The plan was to make actions the same as switches that you can "turn on (or off)" to execute the action.

On the failed run, when I attempt to connect, I get the following:

Code: Select all
EventedHTTPServer [::ffff:192.168.1.2] HTTP request: /pair-verify +6ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +3ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2 +8ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP Repsonse is finished +7ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP request: /pair-verify +17ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2 +1ms
  HAPServer [CC:22:3D:E3:CE:30] Client 031B7152-2168-4561-8AB3-668269B32E0A verification complete +3ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP Repsonse is finished +1ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP request: /accessories +6ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories +0ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP Repsonse is finished +8ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP request: /pairings +218ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pairings +0ms
  HAPServer [CC:22:3D:E3:CE:30] Removing pairing info for client +1ms
  Accessory [Homebridge] Unpairing with client 031B7152-2168-4561-8AB3-668269B32E0A +0ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP Repsonse is finished +2ms
  EventedHTTPServer [::ffff:192.168.1.2] Client connection closed +14ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP connection was closed +0ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP server was closed +0ms


On a successful run (without Actions), after /accessories comes /characteristics. For some reason, above, that never happens.

Code: Select all
EventedHTTPServer [::ffff:192.168.1.2] HTTP request: /pair-verify +2ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2 +1ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP Repsonse is finished +5ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP request: /pair-verify +16ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +1ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2 +1ms
  HAPServer [CC:22:3D:E3:CE:30] Client 031B7152-2168-4561-8AB3-668269B32E0A verification complete +28ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP Repsonse is finished +2ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP request: /accessories +8ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories +1ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP Repsonse is finished +7ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP request: /characteristics +2s
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
  Accessory [Homebridge] Processing characteristic set: {"characteristics":[{"aid":68,"iid":9,"ev":true}]} +1ms
  Accessory [Homebridge] Registering Characteristic "Change the power state" for events +1ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP Repsonse is finished +0ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP request: /characteristics +7ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
  Accessory [Homebridge] Processing characteristic set: {"characteristics":[{"aid":69,"iid":9,"ev":true}]} +0ms
  Accessory [Homebridge] Registering Characteristic "Adjust Brightness of Light" for events +0ms
  EventedHTTPServer [::ffff:192.168.1.2] HTTP Repsonse is finished +1ms

Posted on
Sun Oct 18, 2015 10:15 pm
webdeck offline
Posts: 436
Joined: May 07, 2005

Re: Homebridge for HomeKit hack

dgarozzo wrote:
Webdeck/Mike,

I'm stuck trying to add actions. I checked my code in here: https://github.com/dgarozzo/homebridge/. Can you have a look? Maybe you can tell what I've done wrong. When I go to connect from my iPhone to Homebridge, it tells me that my "device" doesn't conform to Homekit. Right now, I have the lines commented out that are responsible for adding the action, so you won't see the problem until you uncomment those lines.

The plan was to make actions the same as switches that you can "turn on (or off)" to execute the action.


I don't know for sure, but if I had to guess, HomeKit doesn't like the concept of a "write-only" switch. Try giving it read permission and always returning 0 as the value.

-Mike

Posted on
Mon Oct 19, 2015 4:57 am
peteinau offline
Posts: 65
Joined: Jan 10, 2015

Re: Homebridge for HomeKit hack

Hi Mike,

Just wanted to let you know that your swift work fixed the reset issue, all working perfectly now! Thanks so much!

Thanks,
Pete

Page 5 of 10 1, 2, 3, 4, 5, 6, 7, 8 ... 10

Who is online

Users browsing this forum: No registered users and 8 guests