Jump to content

HomeKit Support via HomeBridge - Siri Voice Control


rayzor

Recommended Posts

Posted

I have just committed a change to the HomeBridge project which builds off the wonderful reverse engineer HomeKit protocol work that was done for HAPNode-JS. The HomeBridge allows you to define a platform to iterate through and automatically add devices to communicate with.

 

https://github.com/nfarina/homebridge

 

I have this working on a Raspberry Pi 2 - my basic steps were to

 1. apt-get install nodejs 

 2. apt-get install build-essential

 3. apt-get install libavahi-compat-libdnssd-dev

 4. git clone homebridge (follow installation instructions on the page)

 5. modify the config-sample.json and copy to config.json

 6. run "npm run start"

 

I hit a couple snags along the way. For example, I hit this error and used the solution that was proposed: https://github.com/stephen/nodetunes/issues/28

 

Please try it out - I can say "Turn on Front Porch light" and siri will turn it on. I can say "turn on great room lights to 50" to turn it to 50% (I used % rather than ISY's concept of 0-255).

 

If you get stuck or have any feedback let me know. I am working on more features, trying to get status updates back, and get garage door working.

 

Rayzor

  • Like 4
Posted

Thanks Michel.

 

Would like to hear if anybody got it working, and any issues they had. I am still working on it.

Posted

I tried, but got this error. (Already posted on Git website, but still waiting for some help)

 

Trying to install homebridge on my Raspberry pi and got this error

 

npm ERR! Error: 1995645456:error:10067066:elliptic curve routines:ec_GFp_simple_oct2point:invalid encoding:../deps/openssl/openssl/crypto/ec/ecp_smpl.c:939:

npm ERR! 1995645456:error:1408D132:SSL routines:SSL3_GET_KEY_EXCHANGE:bad ecpoint:../deps/openssl/openssl/ssl/s3_clnt.c:1566:

npm ERR!

npm ERR! at CleartextStream._puller (tls.js:618:24)

npm ERR! at CleartextStream.CryptoStream._pull (tls.js:552:19)

npm ERR! at SecurePair.cycle (tls.js:842:20)

npm ERR! at EncryptedStream.CryptoStream.write (tls.js:230:13)

npm ERR! at Socket.ondata (stream.js:38:26)

npm ERR! at Socket.EventEmitter.emit (events.js:88:17)

npm ERR! at TCP.onread (net.js:395:14)

npm ERR! If you need help, you may report this log at:

npm ERR! http://github.com/isaacs/npm/issues

npm ERR! or email it to:

npm ERR! npm-@googlegroups.com

 

 

 

MF_Bra

Posted

Tried on my FreeBSD server, had fun fixing the dns_sd.h not being found (I had it in /usr/local/include rather than in /usr/include, could not figure out how to tell the d@mn, thing to look under /usr/local/include), now it passed the install steps, trying to run and getting

 

Unexpected result while probing for avahi: { [Error: dns service error: unknown error code] errorCode: -65563 }
/usr/home/andrey/src/homebridge/lib/HAP-NodeJS/node_modules/mdns/lib/avahi.js:28
  dns_sd.DNSServiceRefDeallocate(sr);
Posted

I tried, but got this error. (Already posted on Git website, but still waiting for some help)

 

Trying to install homebridge on my Raspberry pi and got this error

 

npm ERR! Error: 1995645456:error:10067066:elliptic curve routines:ec_GFp_simple_oct2point:invalid encoding:../deps/openssl/openssl/crypto/ec/ecp_smpl.c:939:

npm ERR! 1995645456:error:1408D132:SSL routines:SSL3_GET_KEY_EXCHANGE:bad ecpoint:../deps/openssl/openssl/ssl/s3_clnt.c:1566:

npm ERR!

npm ERR! at CleartextStream._puller (tls.js:618:24)

npm ERR! at CleartextStream.CryptoStream._pull (tls.js:552:19)

npm ERR! at SecurePair.cycle (tls.js:842:20)

npm ERR! at EncryptedStream.CryptoStream.write (tls.js:230:13)

npm ERR! at Socket.ondata (stream.js:38:26)

npm ERR! at Socket.EventEmitter.emit (events.js:88:17)

npm ERR! at TCP.onread (net.js:395:14)

npm ERR! If you need help, you may report this log at:

npm ERR! http://github.com/isaacs/npm/issues

npm ERR! or email it to:

npm ERR! npm-@googlegroups.com

 

 

 

MF_Bra

 

What command are you trying to run when you get this? This looks like an issue with node and openssl. I would make sure you update and get the latest node version.

Posted

 

Tried on my FreeBSD server, had fun fixing the dns_sd.h not being found (I had it in /usr/local/include rather than in /usr/include, could not figure out how to tell the d@mn, thing to look under /usr/local/include), now it passed the install steps, trying to run and getting

Unexpected result while probing for avahi: { [Error: dns service error: unknown error code] errorCode: -65563 }
/usr/home/andrey/src/homebridge/lib/HAP-NodeJS/node_modules/mdns/lib/avahi.js:28
  dns_sd.DNSServiceRefDeallocate(sr);

 

Not sure how FreeBSD may differ. The packages may not be as up to date. Avahi is what is used for Bonjour service which apple uses, and the error code you are getting has to do with DNS. From what I have found this may mean the mdns service is not started, so I would focus around checking libavahi

Posted

avahi works fine, I can do avahi-browse -at no prob, you saying you have to have some kind of mdns process running?

Posted (edited)

Ok, thanks for the tip, I've started mdnsd (didn't know I need it) and it got me past that error.

 

Now - another thing - what should I have in accessories ? I mean right now I only have a platform - ISY, accessories is empty and it does not seem to like it.

[andrey@penguin ~/src/homebridge]$ npm run start
 
> homebridge@0.0.0 start /usr/home/andrey/src/homebridge
> node app.js
 
Starting HomeBridge server...
Loading 1 platforms...
[ISY] Initializing ISY platform...
[ISY] Fetching ISY Devices.
Loading 1 accessories...
module.js:338
    throw err;
    ^
Error: Cannot find module './accessories/undefined.js'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at loadAccessories (/usr/home/andrey/src/homebridge/app.js:41:31)
    at startup (/usr/home/andrey/src/homebridge/app.js:28:29)
    at Object.<anonymous> (/usr/home/andrey/src/homebridge/app.js:188:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)

UPDATE: Never mind this, deleting accessories altogether fixed the above as well. Sorry about the extra confusion :( Server seems like it's up now, going to try to add something.

 

UPDATE2: It works!! Kind of :) Would not let me add the Z Wave device but added Insteon device no problem :) And Siri can turn it on/off! Unfortunately it does not work from the Watch - Siri just says something like "I can help you control your home when you using handoff on your iPhone".

 

But still very cool, thanks! :)

Edited by xKing
Posted

What command are you trying to run when you get this? This looks like an issue with node and openssl. I would make sure you update and get the latest node version.

The coommand is :sudo npm install

Complete error

npm http GET https://registry.npmjs.org/request

npm http GET https://registry.npmjs.org/node-persist

npm http GET https://registry.npmjs.org/xmldoc

npm http GET https://registry.npmjs.org/node-hue-api

npm http GET https://registry.npmjs.org/xml2js

npm http GET https://registry.npmjs.org/carwingsjs

npm http GET https://registry.npmjs.org/sonos

npm http GET https://registry.npmjs.org/wemo

npm http GET https://registry.npmjs.org/wink-js/0.0.5

npm http GET https://registry.npmjs.org/elkington

npm http GET https://registry.npmjs.org/request

npm http GET https://registry.npmjs.org/node-persist

npm http GET https://registry.npmjs.org/xmldoc

npm http GET https://registry.npmjs.org/node-hue-api

npm http GET https://registry.npmjs.org/wemo

npm http GET https://registry.npmjs.org/carwingsjs

npm http GET https://registry.npmjs.org/wink-js/0.0.5

npm http GET https://registry.npmjs.org/elkington

npm http GET https://registry.npmjs.org/sonos

npm http GET https://registry.npmjs.org/xml2js

npm http GET https://registry.npmjs.org/node-persist

npm http GET https://registry.npmjs.org/node-hue-api

npm http GET https://registry.npmjs.org/xmldoc

npm http GET https://registry.npmjs.org/wemo

npm ERR! Error: 1996251664:error:10067066:elliptic curve routines:ec_GFp_simple_oct2point:invalid encoding:../deps/openssl/openssl/crypto/ec/ecp_smpl.c:939:

npm ERR! 1996251664:error:1408D132:SSL routines:SSL3_GET_KEY_EXCHANGE:bad ecpoint:../deps/openssl/openssl/ssl/s3_clnt.c:1566:

npm ERR!

npm ERR! at CleartextStream._puller (tls.js:618:24)

npm ERR! at CleartextStream.CryptoStream._pull (tls.js:552:19)

npm ERR! at SecurePair.cycle (tls.js:842:20)

npm ERR! at EncryptedStream.CryptoStream.write (tls.js:230:13)

npm ERR! at Socket.ondata (stream.js:38:26)

npm ERR! at Socket.EventEmitter.emit (events.js:88:17)

npm ERR! at TCP.onread (net.js:395:14)

npm ERR! If you need help, you may report this log at:

npm ERR! <http://github.com/isaacs/npm/issues>

npm ERR! or email it to:

npm ERR! <npm-@googlegroups.com>

 

npm ERR! System Linux 3.18.7-v7+

npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"

npm ERR! cwd /homebridge

npm ERR! node -v v0.8.8

npm ERR! npm -v 1.1.59

npm http GET https://registry.npmjs.org/carwingsjs

npm http GET https://registry.npmjs.org/wink-js/0.0.5

npm http GET https://registry.npmjs.org/elkington

npm http GET https://registry.npmjs.org/sonos

npm http GET https://registry.npmjs.org/xml2js

npm http GET https://registry.npmjs.org/request

npm ERR!

npm ERR! Additional logging details can be found in:

npm ERR! /homebridge/npm-debug.log

npm ERR! not ok code 0

 

 

 

MF_Bra

Posted

ing accessories altogether fixed the above as well. Sorry about the extra confusion :( Server seems like it's up now, going to try to add something.

 

UPDATE2: It works!! Kind of :) Would not let me add the Z Wave device but added Insteon device no problem :) And Siri can turn it on/off! Unfortunately it does not work from the Watch - Siri just says something like "I can help you control your home when you using handoff on your iPhone".

 

But still very cool, thanks! :)

 

Can you login to your REST API for your ISY and show me what a Z-wave device looks like? http://192.168.1.20:8200/rest/nodesfor example is my ISY URL, port, and the path and it will list out all of your devices. Paste me what a zwave one looks like. I will try a custom code fix and send it to you for testing if you are up for it.

 

The siri thing I do not think will work until 9.0 but I could be wrong.

Posted

BTW, it seems like it dies daily with this:

 

 

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: read ECONNRESET
    at exports._errnoException (util.js:746:11)
    at TCP.onread (net.js:559:26)
  • 2 weeks later...
Posted

I get the following error on startup for the ISY (when i edit ISY out of the config then i have a Nest that initializes ok and will work.

 

[iSY] Fetching ISY Devices.
events.js:85
      throw er; // Unhandled 'error' event
            ^
TypeError: Cannot read property '0' of undefined
    at /lib/homebridge/platforms/ISY.js:70:45
    at Array.forEach (native)
    at /lib/homebridge/platforms/ISY.js:57:35
    at Parser.<anonymous> (/lib/homebridge/node_modules/xml2js/lib/xml2js.js:459:18)
    at Parser.emit (events.js:107:17)
    at Object.onclosetag (/lib/homebridge/node_modules/xml2js/lib/xml2js.js:420:26)
    at emit (/lib/homebridge/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
    at emitNode (/lib/homebridge/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
    at closeTag (/lib/homebridge/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
    at Object.write (/lib/homebridge/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
 
Any ideas?
Posted

Can you show the config? Edit out the password (replace with secret or 1111 or something)

 

 

Sent from my iPhone using Tapatalk

Posted
{

    "description": "This is an example configuration file with all supported devices. You can use this as a template for creating your own configuration file containing devices you actually own.",

 

    "platforms": [

        {

            "platform" : "Nest",

            "name" : "Nest",

            "username" : "me@somewhere.com",

            "password" : "11111111"

        },

        {

            "platform": "ISY",

            "name": "ISY",

            "host": "10.10.10.121",

            "port": "80",

            "username": "user",

            "password": "secret"

        }

        

    ]

 

And if i delete the ISY part and leave Nest in the it will start.

 

Thank you

Posted

 

{
    "description": "This is an example configuration file with all supported devices. You can use this as a template for creating your own configuration file containing devices you actually own.",
 
    "platforms": [
        {
            "platform" : "Nest",
            "name" : "Nest",
            "username" : "me@somewhere.com",
            "password" : "11111111"
        },
        {
            "platform": "ISY",
            "name": "ISY",
            "host": "10.10.10.121",
            "port": "80",
            "username": "user",
            "password": "secret"
        }
        
    ]
 
And if i delete the ISY part and leave Nest in the it will start.
 
Thank you

 

 

don't you need a ", " after the ISY block of configuration ?

Posted

i don't think so because when i look at the last item in the sample then it does not have one.  But i tried it and got the following:

 

Starting HomeBridge server...
undefined:20
    ]
    ^
SyntaxError: Unexpected token ]
 
Maybe it does not like something it found in my /rest/nodes xml... They don't all have a "property" data item.
Posted

 

i don't think so because when i look at the last item in the sample then it does not have one.  But i tried it and got the following:

 

Starting HomeBridge server...
undefined:20
    ]
    ^
SyntaxError: Unexpected token ]
 
Maybe it does not like something it found in my /rest/nodes xml... They don't all have a "property" data item.

 

Sorry, with a closer review indeed all final parameters don't use the coma.

 

But you are far closer to play with, I'm still waiting for some help with npm install  as i get an error probably from openssl....

 

 

npm ERR! Error: 1996251664:error:10067066:elliptic curve routines:ec_GFp_simple_oct2point:invalid encoding:../deps/openssl/openssl/crypto/ec/ecp_smpl.c:939:

npm ERR! 1996251664:error:1408D132:SSL routines:SSL3_GET_KEY_EXCHANGE:bad ecpoint:../deps/openssl/openssl/ssl/s3_clnt.c:1566:

Posted

If the paste above was the complete file - you missing the closing }

 

There is mine:

 

{
    "description": "This is an example configuration file with all supported devices. You can use this as a template for creating your own configuration file containing devices you actually own.",
 
    "platforms": [
        {
            "platform": "ISY",
            "name": "ISY",
            "host": "1.1.1.1",
            "port": "80",
            "username": "user",
            "password": "top-secret"
        }
    ]
 
}
Posted

Has anybody already managed to change the http.js from lightswitch to something else (garagedoor?). I want to open/close my maingate. It would work wt the Https.js but then I have to tell siri to switch my lights when I want to open the door. 

I guess I'll be able to change that myself, but if anybody has already done that... I'll have to find out what type of device supports which methods etc. and that will take me quite some time..

Posted

Finally i could install it in my raspberry.

 

If I go to insteon + I can see the devices in the "add" section, and besides it doesn't  update the device status, i can control them in the software but if i ask siri to do something, "she" always respond that wasn't able to find any device.

 

Not sure if someone faced the same.

Guest
This topic is now closed to further replies.

×
×
  • Create New...