We have moved at community.getvera.com

Author Topic: News about HomeKit and Vera  (Read 309029 times)

Offline acn

  • Sr. Newbie
  • *
  • Posts: 31
  • Karma: +5/-1
Re: News about HomeKit and Vera
« Reply #105 on: June 08, 2015, 04:58:48 pm »
Hi,

I'm trying to get the VeraHomeKitBridge instructions from GitHub working on a Synology DS412+ (Arm x86), like some other users here but not very successfully.

So, as I can't use apt-get on Synology root, I tried installing ipkg and bootstraping my NAS (using this guide here) and  building 'cmake' as well (I used the instructions found here, which are similar to those at GitHub).

In the end, I still get errors when trying to run 'npm install':

Code: [Select]
hive> npm install
npm WARN package.json VeraHomeKitBridge@1.0.0 No repository field.
 
> mdns@2.2.9 install /volume1/@appstore/VeraHomeKitBridge/node_modules/mdns
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/volume1/@appstore/VeraHomeKitBridge/node_modules/mdns/build'
Makefile:1: /env.mak: No such file or directory
make: *** No rule to make target `/env.mak'.  Stop.
make: Leaving directory `/volume1/@appstore/VeraHomeKitBridge/node_modules/mdns/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 3.10.35
gyp ERR! command "node" "/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
cwd /volume1/@appstore/VeraHomeKitBridge/node_modules/mdns
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 3.10.35
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! mdns@2.2.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mdns@2.2.9 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls mdns
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /volume1/@appstore/VeraHomeKitBridge/npm-debug.log
hive> make
make: *** No targets specified and no makefile found.  Stop.

Is there anything I can try?

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: News about HomeKit and Vera
« Reply #106 on: June 08, 2015, 05:05:11 pm »
Based on my experience, I would recommend to build Node.js using the source code as opposed to downloading the pre-built ones. I struggled with it for a while and finally found out that node.js was the problem. Also make sure to follow Hackworth's instructions. The recursive cloning is key.

@Hackworth. I will test it when I get home this evening. Thanks!
By the way I am having similar although not as bad issues with my lock still being recognized as a switch as well. Anyway to force the name of it as well without changing the function called by Homekit (I am also having to call it Door, if I mention lock, siri says there is no lock registered)
« Last Edit: June 08, 2015, 05:37:21 pm by anhman »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline Hackworth

  • Full Member
  • ***
  • Posts: 100
  • Karma: +13/-8
Re: News about HomeKit and Vera
« Reply #107 on: June 08, 2015, 05:23:04 pm »
@anhman - I'm not entirely sure what you mean about the lock. I know Siri gets upset if I call things "lights" so it could simply be a bug with Siri right now. In MyTouchHome, does your door lock show up as a lock device?

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: News about HomeKit and Vera
« Reply #108 on: June 08, 2015, 05:36:46 pm »
The lock shows up as a switch in mytouchhome. It is a lock in vera. Yeah siri struggles when you call anything light so I set up only one device with the name light and called all the other lights something else. Even Lighting works. category: 7 subCat:0

Edit: Actually I am not so sure and I will have to check. All the devices I added shows up to be the same color and I guess I need to look into the device options to see what they are recognized as?
« Last Edit: June 08, 2015, 05:40:08 pm by anhman »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline Hackworth

  • Full Member
  • ***
  • Posts: 100
  • Karma: +13/-8
Re: News about HomeKit and Vera
« Reply #109 on: June 08, 2015, 05:55:49 pm »
@anhman - Yeah, I would check MyTouchHome when you can, it should say in the top left of the device what it actually is. Anything in category 7 will be recognized as a lock. If it's showing up as a lock, then it's definitely a Siri bug.

Also, you can rename things in MyTouchHome if you don't want to rename them on the Vera side.
« Last Edit: June 08, 2015, 05:57:26 pm by Hackworth »

Offline steets250

  • Full Member
  • ***
  • Posts: 151
  • Karma: +3/-2

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: News about HomeKit and Vera
« Reply #111 on: June 08, 2015, 06:29:06 pm »
@anhman - I'm not entirely sure what you mean about the lock. I know Siri gets upset if I call things "lights" so it could simply be a bug with Siri right now. In MyTouchHome, does your door lock show up as a lock device?

By the way do I need to reinstall the app or can I just replace the modified files? The garagedoor.js and app.js? My understanding is that the device config gets uploaded to icloud. When I create a new bridge installation, it creates an mismatch and have some identification issues with what is in icloud.
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: News about HomeKit and Vera
« Reply #112 on: June 08, 2015, 11:17:20 pm »
Looks like I just had to replace the accessory Js file. Well I have some bad news:
Found a couple of errors in the Garagedoor.js file:

Line 25. I had a crash using "_veraIP" and "device.id" in the syntax. I replaced them with "this.veraIP" and "this.device" respectively
looks like a copy paste error.

Line 31:
The next error I get is about the "urn". The error says it is undefined even though you defined it on line 27 through the query request
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline Hackworth

  • Full Member
  • ***
  • Posts: 100
  • Karma: +13/-8
Re: News about HomeKit and Vera
« Reply #113 on: June 09, 2015, 03:12:44 am »
@anhman - Very sorry for breaking things, I think I've got everything sorted.

So, assuming you installed it by doing a git clone, you can just do a git pull to grab the latest changes.

Oh, I've never touched node.js or javascript before Friday. Apparently node is asynchronous, who knew?

Offline Brighters

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +1/-0
Re: News about HomeKit and Vera
« Reply #114 on: June 09, 2015, 03:57:13 am »
Awesome! thanks for this!

The next step would be to support more devices which will be available in iOS9. Also, supporting running scenes would be awesome, as well as supporting the 'house modes'.
http://shop.brighters.nl De slimste domotica shop van Nederland!

Offline Hackworth

  • Full Member
  • ***
  • Posts: 100
  • Karma: +13/-8
Re: News about HomeKit and Vera
« Reply #115 on: June 09, 2015, 04:04:50 am »
@brighters - running scenes works great, get the code from my repo. They don't, however show up as scenes (just switches) on the iPhone since that's not the way Homekit works.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: News about HomeKit and Vera
« Reply #116 on: June 09, 2015, 05:10:06 am »
@anhman - Very sorry for breaking things, I think I've got everything sorted.

So, assuming you installed it by doing a git clone, you can just do a git pull to grab the latest changes.

Oh, I've never touched node.js or javascript before Friday. Apparently node is asynchronous, who knew?

Yoohoo, it works! Except close and open are reversed... I am fixing it now but you should fix it on github too: just have to switch 0 and 1 in line 33 of the json when defining the "unlocked" binary variable
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline acn

  • Sr. Newbie
  • *
  • Posts: 31
  • Karma: +5/-1
Re: News about HomeKit and Vera
« Reply #117 on: June 09, 2015, 10:31:26 am »
@ahnman I think you were right, I had to compile Node JS instead of getting it from a package. The script is now connecting with my Vera 2 controller, but it's breaking and I'm baffled on what to do.

For other Synology users, I think I'm near making this run, at least it's only giving me errors on the actual run. There are probably (most definitely) easier and better ways of doing this, but I'm no expert on using ssh/linux. If you want to try what I did read this pastebin link, I'll post it here when/if I actually make it run.

So, below is the error I'm getting. I can see that it's reading something from Vera, because "Abrir Estores" (Portuguese for "open blinds") is actually a scene configured in Vera. After that it breaks:

Code: [Select]
root@hive:/home/VeraHomeKitBridge# npm run start

> VeraHomeKitBridge@1.0.0 start /home/VeraHomeKitBridge
> node app.js

Starting Vera HomeKit Bridge...
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
Create accessory: Abrir Estores
Cannot find secret key, creating One...
/home/VeraHomeKitBridge/lib/HAP-NodeJS/node_modules/mdns/lib/advertisement.js:56
  dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name,
         ^
Error: dns service error: unknown
    at Error (native)
    at new Advertisement (/home/VeraHomeKitBridge/lib/HAP-NodeJS/node_modules/mdns/lib/advertisement.js:56:10)
    at Object.create [as createAdvertisement] (/home/VeraHomeKitBridge/lib/HAP-NodeJS/node_modules/mdns/lib/advertisement.js:64:10)
    at Object.Advertiser (/home/VeraHomeKitBridge/lib/HAP-NodeJS/Advertiser.js:33:26)
    at Object.Accessory (/home/VeraHomeKitBridge/lib/HAP-NodeJS/Accessory.js:42:15)
    at createHomeKitAccessory (/home/VeraHomeKitBridge/app.js:156:19)
    at createScene (/home/VeraHomeKitBridge/app.js:65:3)
    at /home/VeraHomeKitBridge/app.js:31:7
    at Array.forEach (native)
    at processScenes (/home/VeraHomeKitBridge/app.js:28:10)

npm ERR! Linux 3.10.35
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! VeraHomeKitBridge@1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the VeraHomeKitBridge@1.0.0 start script 'node app.js'.
npm ERR! This is most likely a problem with the VeraHomeKitBridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls VeraHomeKitBridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/VeraHomeKitBridge/npm-debug.log
root@hive:/home/VeraHomeKitBridge#

Do you have any suggestions?

Offline Hackworth

  • Full Member
  • ***
  • Posts: 100
  • Karma: +13/-8
Re: News about HomeKit and Vera
« Reply #118 on: June 09, 2015, 10:45:54 am »
@anhman - Ah but it's not that simple! It's one way for locks and the other way for binary switches. I've spent entirely too much time on garage doors, haha. I'll have to do some magic at some point.

@acn - Looks like the avahi daemon isn't running, maybe.

Offline acn

  • Sr. Newbie
  • *
  • Posts: 31
  • Karma: +5/-1
Re: News about HomeKit and Vera
« Reply #119 on: June 09, 2015, 11:53:29 am »
@acn - Looks like the avahi daemon isn't running, maybe.

@Hackworth Many thanks, it wasn't running, I was able to repair it. Now 'npm run start' loads all devices/scenes, but I'm getting a new error in the end, on 'event.js':

EDIT 2: Nevermind, I changed the initial port in app.js from 50000 to 51100 because of it collides with some Synology service ports:

Code: [Select]
var nextPort = 50000;


Code: [Select]
root@hive:/home/VeraHomeKitBridge# npm run start

> VeraHomeKitBridge@1.0.0 start /home/VeraHomeKitBridge
> node app.js

Starting Vera HomeKit Bridge...
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
Create accessory: Abrir Estores
Cannot find secret key, creating One...
TCP server accepting connection on port: 50001
HAP Server is listening
Create accessory: Abrir Estores de Manh?
Cannot find secret key, creating One...
TCP server accepting connection on port: 50003
HAP Server is listening
Create accessory: Desligar TV
Cannot find secret key, creating One...
TCP server accepting connection on port: 50006
HAP Server is listening
Create accessory: Fechar Estores
Cannot find secret key, creating One...
TCP server accepting connection on port: 50010
HAP Server is listening
Create accessory: Open Bedroom Window
Cannot find secret key, creating One...
TCP server accepting connection on port: 50015
HAP Server is listening
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: listen EADDRINUSE
    at exports._errnoException (util.js:746:11)
    at Server._listen2 (net.js:1156:14)
    at listen (net.js:1182:10)
    at Server.listen (net.js:1267:5)
    at Object.startServer (/home/VeraHomeKitBridge/lib/HAP-NodeJS/TCPServer.js:31:15)
    at Object.publishAccessory (/home/VeraHomeKitBridge/lib/HAP-NodeJS/Accessory.js:13:28)
    at createHomeKitAccessory (/home/VeraHomeKitBridge/app.js:159:13)
    at createScene (/home/VeraHomeKitBridge/app.js:65:3)
    at /home/VeraHomeKitBridge/app.js:31:7
    at Array.forEach (native)

npm ERR! Linux 3.10.35
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! VeraHomeKitBridge@1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the VeraHomeKitBridge@1.0.0 start script 'node app.js'.
npm ERR! This is most likely a problem with the VeraHomeKitBridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls VeraHomeKitBridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/VeraHomeKitBridge/npm-debug.log


I guess that it's telling me that there is another process listening to that port (which port, which process?), and it's probably running on the underlying synology root session. I have tried rebooting, but that didn't make a difference. I'd appreciate any help on how to debug this.

Edit: could I change the scripts' listening port to something else?


Edit3:
One more thing though, I'm using the free Eve app (from Elgato) to add devices.
« Last Edit: June 09, 2015, 12:39:59 pm by acn »