Page 9 of 27

Siri / HomeKit support for Domoticz

Posted: Wednesday 17 June 2015 20:41
by simon_rb
thebeetleuk wrote:Right I now have this working using the following app on my iphone:

https://itunes.apple.com/US/app/id919270334

I did notice however when I ran "npm run start" it looks like its found all my devices. I'm assuming you want to create a room plan to limit the ones on the list?

Also, what app do I need to use to get siri working with this?
Good good. You don't need an app to use Siri. Just add devices using that app then ask Siri to turn them on of off - simples. Oh and yes make a room plan of the devices you wish to control, you only need to do this if you have a lot of devices. I have 170+ switches/scenes etc.. And that was too many... It's up to you. If you only have a few then there's no need for the room plan...

Re: Siri / HomeKit support for Domoticz

Posted: Friday 19 June 2015 21:01
by thebeetleuk
ok folks. after a few days of this I can say 2 things... 1. how cool!!! siri responds as you would expect all all works great. 2. its a bit temperamental on the identification of devices on restart. I have seen a few comments on here about devices vanishing. Lets hope all gets fixed in future updates (wherever that may be).

I also noticed that everything seems to get treated as a light. Anyone seen anything different?

Re: Siri / HomeKit support for Domoticz

Posted: Friday 19 June 2015 21:27
by gflvern
I'm getting the error below when I try to run npm run start, the only thing I haven't done as part shown in the wiki is add a room plan.

Any ideas as what to try to get this working, please?

Code: Select all

Starting HomeBridge server...
module.js:338
    throw err;
          ^
Error: Cannot find module '../build/Release/dns_sd_bindings'
    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 Object.<anonymous> (/home/pi/homebridge/lib/HAP-NodeJS/node_modules/mdns/lib/dns_sd.js:32:22)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

npm ERR! Linux 3.12.28+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.1
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! homebridge@0.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the homebridge@0.0.0 start script 'node app.js'.
npm ERR! This is most likely a problem with the homebridge 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 homebridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/homebridge/npm-debug.log
pi@
Thanks

gfl

Re: Siri / HomeKit support for Domoticz

Posted: Friday 19 June 2015 23:26
by simon_rb
thebeetleuk wrote:ok folks. after a few days of this I can say 2 things... 1. how cool!!! siri responds as you would expect all all works great. 2. its a bit temperamental on the identification of devices on restart. I have seen a few comments on here about devices vanishing. Lets hope all gets fixed in future updates (wherever that may be).

I also noticed that everything seems to get treated as a light. Anyone seen anything different?
Everything seems to be recognised as a light for me also. My problem other than the disappearing devices is that if I add my devices to say the living room... Half the time will I ask for the wall lights to turn on it ends up turning everything on in the living room. And sometimes it just does the wall lights. I can't seem to workout why it does that...

Re: Siri / HomeKit support for Domoticz

Posted: Saturday 20 June 2015 13:19
by gflvern
Ok, so I made progress by starting the install again. However still appear to have an issue.

Firstly how do I find the idx of my room plan, I want to add that to the config.json but can't find it.

When I run npm run start, it throws some errors as it tries to add switches twice, could I have something set up wrong in Domoticz? Error is below. Terminal hangs at this point, the command prompt doesn't appear.

Code: Select all

domoticzpi ~/homebridge $ npm run start

> homebridge@0.0.0 start /home/pi/homebridge
> node app.js

Starting HomeBridge server...
*** 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>
Loading 1 platforms...
[Domoticz] Initializing Domoticz platform...
[Domoticz] Fetching Domoticz lights and switches...
Loading 0 accessories...
[Domoticz] Initializing device with name Ceiling Lights...
[Domoticz] Loaded services for Ceiling Lights
TCP server accepting connection on port: 51826
HAP Server is listening
[Domoticz] Initializing device with name LightState...
[Domoticz] Loaded services for LightState
TCP server accepting connection on port: 51828
HAP Server is listening
[Domoticz] Initializing device with name Wall Lights...
[Domoticz] Loaded services for Wall Lights
TCP server accepting connection on port: 51832
HAP Server is listening
[Domoticz] Initializing device with name iPhone...
[Domoticz] Loaded services for iPhone
TCP server accepting connection on port: 51838
HAP Server is listening
[Domoticz] Initializing device with name Ceiling Lights...
[Domoticz] Loaded services for Ceiling Lights
Cannot create another accessory with the same name 'Ceiling Lights'. The 'name' property must be unique for each accessory.
[Domoticz] Initializing device with name LightState...
[Domoticz] Loaded services for LightState
Cannot create another accessory with the same name 'LightState'. The 'name' property must be unique for each accessory.
[Domoticz] Initializing device with name Wall Lights...
[Domoticz] Loaded services for Wall Lights
Cannot create another accessory with the same name 'Wall Lights'. The 'name' property must be unique for each accessory.
[Domoticz] Initializing device with name iPhone...
[Domoticz] Loaded services for iPhone
Cannot create another accessory with the same name 'iPhone'. The 'name' property must be unique for each accessory.
^
I set the npm log level to verbose and get more detail, terminal doesn't hang either.

Code: Select all

i@domoticzpi ~/homebridge $ npm run start --loglevel verbosenpm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'run',
npm verb cli   'start',
npm verb cli   '--loglevel',
npm verb cli   'verbose' ]
npm info using npm@2.5.1
npm info using node@v0.12.1
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info prestart homebridge@0.0.0
npm info start homebridge@0.0.0

> homebridge@0.0.0 start /home/pi/homebridge
> node app.js

Starting HomeBridge server...
*** 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>
Loading 1 platforms...
[Domoticz] Initializing Domoticz platform...
[Domoticz] Fetching Domoticz lights and switches...
Loading 0 accessories...
[Domoticz] Initializing device with name Ceiling Lights...
[Domoticz] Loaded services for Ceiling Lights
TCP server accepting connection on port: 51826
HAP Server is listening
[Domoticz] Initializing device with name LightState...
[Domoticz] Loaded services for LightState
TCP server accepting connection on port: 51828
HAP Server is listening
[Domoticz] Initializing device with name Wall Lights...
[Domoticz] Loaded services for Wall Lights
TCP server accepting connection on port: 51832
HAP Server is listening
[Domoticz] Initializing device with name iPhone...
[Domoticz] Loaded services for iPhone
TCP server accepting connection on port: 51838
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:1129:14)
    at listen (net.js:1155:10)
    at Server.listen (net.js:1240:5)
    at Object.startServer (/home/pi/homebridge/lib/HAP-NodeJS/TCPServer.js:31:15)
    at Object.publishAccessory (/home/pi/homebridge/lib/HAP-NodeJS/Accessory.js:13:28)
    at createHAPServer (/home/pi/homebridge/app.js:167:15)
    at /home/pi/homebridge/app.js:92:17
    at Request._callback (/home/pi/homebridge/platforms/Domoticz.js:68:6)
    at Request.self.callback (/home/pi/homebridge/node_modules/request/request.js:373:22)

npm verb unsafe-perm in lifecycle true
npm info homebridge@0.0.0 Failed to exec start script
npm verb stack Error: homebridge@0.0.0 start: `node app.js`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
npm verb stack     at EventEmitter.emit (events.js:110:17)
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:14:12)
npm verb stack     at ChildProcess.emit (events.js:110:17)
npm verb stack     at maybeClose (child_process.js:1008:16)
npm verb stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
npm verb pkgid homebridge@0.0.0
npm verb cwd /home/pi/homebridge
npm ERR! Linux 3.18.11+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start" "--loglevel" "verbose"
npm ERR! node v0.12.1
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! homebridge@0.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the homebridge@0.0.0 start script 'node app.js'.
npm ERR! This is most likely a problem with the homebridge 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 homebridge
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]

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

Thanks

gfl

Re: Siri / HomeKit support for Domoticz

Posted: Sunday 21 June 2015 0:46
by G3rard
gflvern wrote:Ok, so I made progress by starting the install again. However still appear to have an issue.
Firstly how do I find the idx of my room plan, I want to add that to the config.json but can't find it.
The idx of your room plan is visible on the roomplan page (setup, more options, plans, roomplan). If you add a plan then in the list it shows the idx and the name of the roomplan.

Re: Siri / HomeKit support for Domoticz

Posted: Sunday 21 June 2015 15:16
by gflvern
G3rard wrote:The idx of your room plan is visible on the roomplan page (setup, more options, plans, roomplan). If you add a plan then in the list it shows the idx and the name of the roomplan.
Ah yes, spotted now, it's obvious when you look!! Thanks.

Now I get a DNS Name Conflict error!

Code: Select all

/home/pi/homebridge/lib/HAP-NodeJS/node_modules/mdns/lib/advertisement.js:56
  dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name,
         ^
Error: dns service error: name conflict
    at Error (native)
    at new Advertisement (/home/pi/homebridge/lib/HAP-NodeJS/node_modules/mdns/lib/advertisement.js:56:10)
    at Object.create [as createAdvertisement] (/home/pi/homebridge/lib/HAP-NodeJS/node_modules/mdns/lib/advertisement.js:64:10)
    at Object.startAdvertising (/home/pi/homebridge/lib/HAP-NodeJS/Advertiser.js:7:28)
    at Object.publishAccessory (/home/pi/homebridge/lib/HAP-NodeJS/Accessory.js:10:29)
    at createHAPServer (/home/pi/homebridge/app.js:167:15)
    at /home/pi/homebridge/app.js:92:17
    at Request._callback (/home/pi/homebridge/platforms/Domoticz.js:91:6)
    at Request.self.callback (/home/pi/homebridge/node_modules/request/request.js:373:22)
    at Request.emit (events.js:110:17)

gfl

Re: Siri / HomeKit support for Domoticz

Posted: Monday 22 June 2015 12:10
by grant
Hello,

I have been working through this tutorial and reading over other peoples comments in this thread.
I am trying to set home this home kit integration using the stable build of Domoticz (v2.2553) on a Raspberry Pi built from the pre-built image.
All of the packages should be installed and I have moved directly to the configuration task outlines in the wiki instructions. I have configured the config.json file with the following settings:
{
"description": "Configuration file for Domoticz platform.",
"platforms": [
{
"platform": "Domoticz",
"name": "Domoticz",
"server": "127.0.0.1",
"port": "8080"
"roomid": 2 (0=no roomplan),
"usescenes": 0 (0=off, 1=on)
}
],
"accessories": [
]
}

2 is the idx value beside the room plan that I have selected for use with home kit.

2 is the idx value beside the room plan that I have selected for use with home kit. I have noticed that other people have much higher idx values such as 123, but all of mine are below ten, not sure if this is causing an issue.
When I run the “npm run start” command I get the following error:
pi@raspberrypi:~/homebridge$ npm run start

> homebridge@0.0.0 start /home/pi/homebridge
> node app.js

Starting HomeBridge server...
undefined:9
"roomid": 2 (0=no roomplan),
^
SyntaxError: Unexpected string
at Object.parse (native)
at Object.<anonymous> (/home/pi/homebridge/app.js:21:19)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

npm ERR! Linux 3.18.11+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.1
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! homebridge@0.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the homebridge@0.0.0 start script 'node app.js'.
npm ERR! This is most likely a problem with the homebridge 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 homebridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/homebridge/npm-debug.log
pi@raspberrypi:~/homebridge$

Am I doing something basic wrong?

Thanks in advance for any help on this.

G

Re: Siri / HomeKit support for Domoticz

Posted: Monday 22 June 2015 13:15
by Eduard
grant wrote: When I run the “npm run start” command I get the following error:
pi@raspberrypi:~/homebridge$ npm run start

> homebridge@0.0.0 start /home/pi/homebridge
> node app.js

Starting HomeBridge server...
undefined:9
"roomid": 2 (0=no roomplan),
U should use:

Code: Select all

{
"description": "Configuration file for Domoticz platform.",
"platforms": [
{
"platform": "Domoticz",
"name": "Domoticz",
"server": "127.0.0.1",
"port": "8080"
"roomid": 2,
"usescenes": 0
}
That is, leaving away the comment (0=no roomplan) and (0=off, 1=on)

Re: Siri / HomeKit support for Domoticz

Posted: Monday 22 June 2015 13:40
by gflvern
grant wrote:Hello,

Am I doing something basic wrong?

Thanks in advance for any help on this.

G

You are missung the , after "port": "8080" in the config. In addition to the other code that needs removing from the 'scenes' line.

gfl

Re: Siri / HomeKit support for Domoticz

Posted: Monday 22 June 2015 18:05
by grant
Thanks for all the help :)

so I have change the configuration file and it is now as follows:

{
"description": "Configuration file for Domoticz platform.",
"platforms": [
{
"platform": "Domoticz",
"name": "Domoticz",
"server": "127.0.0.1",
"port": "8080",
"roomid": 2,
"usescenes": 0,

}
],
"accessories": [
]
}

I am now getting the following error:

pi@raspberrypi:~/homebridge$ npm run start

> homebridge@0.0.0 start /home/pi/homebridge
> node app.js

Starting HomeBridge server...
undefined:12
}
^
SyntaxError: Unexpected token }
at Object.parse (native)
at Object.<anonymous> (/home/pi/homebridge/app.js:21:19)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

npm ERR! Linux 3.18.11+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.1
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! homebridge@0.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the homebridge@0.0.0 start script 'node app.js'.
npm ERR! This is most likely a problem with the homebridge 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 homebridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/homebridge/npm-debug.log
pi@raspberrypi:~/homebridge$

any more idea's?

Thanks G

Re: Siri / HomeKit support for Domoticz

Posted: Monday 22 June 2015 18:36
by gflvern
grant wrote:Thanks for all the help :)

any more idea's?

Thanks G
You don't need the , after "usescenes": 0

gfl

Re: Siri / HomeKit support for Domoticz

Posted: Monday 22 June 2015 18:51
by grant
Many Thanks glf,

just work that out by trial and error :0) have it working now..... Thanks for all your help!

Do you know if you can add more than one room plan or is it best just to create a home kit room plan and add all devices to that one room plan?

Do you know if you can control your devices remotely, ie on 3g?

Thanks G

Re: Siri / HomeKit support for Domoticz

Posted: Monday 22 June 2015 19:45
by gflvern
grant wrote:Many Thanks glf,

just work that out by trial and error :0) have it working now..... Thanks for all your help!

Do you know if you can add more than one room plan or is it best just to create a home kit room plan and add all devices to that one room plan?

Do you know if you can control your devices remotely, ie on 3g?

Thanks G
Don't know about room plans, I'm sure you can use multiple ids, just trail and error on how to enter that into the config file.

From what I've read it won't work in 3G, you need to be on the same WiFi network.

I can't actually get it working myself, still getting a DNS error!

gfl

Re: Siri / HomeKit support for Domoticz

Posted: Friday 26 June 2015 0:23
by G3rard
Information regarding the Siri commands possible with Homekit.
https://support.apple.com/en-us/HT204893

Re: Siri / HomeKit support for Domoticz

Posted: Friday 26 June 2015 11:07
by Heisenberg
Hi guys, Which steps to perform when the accessories aren't recognized anymore? Is there a solution or workaround yet?

Re: Siri / HomeKit support for Domoticz

Posted: Friday 26 June 2015 20:22
by drogert
WOW, looks nice! I am going to try it out!

Re: Siri / HomeKit support for Domoticz

Posted: Friday 26 June 2015 23:54
by G3rard
Heisenberg wrote:Hi guys, Which steps to perform when the accessories aren't recognized anymore? Is there a solution or workaround yet?
What I do is the following.
- Stop Homebridge
- Delete the files in the homebridge/persist folder
- Start Homebridge

Then all items will be added again.

I sometimes have that the items are unreachable in Eve (and Insteon) and than after a while it works again.
Any ideas what causes this and how it can be solved?

Re: Siri / HomeKit support for Domoticz

Posted: Saturday 27 June 2015 10:57
by Heisenberg
G3rard wrote:
Heisenberg wrote:Hi guys, Which steps to perform when the accessories aren't recognized anymore? Is there a solution or workaround yet?
What I do is the following.
- Stop Homebridge
- Delete the files in the homebridge/persist folder
- Start Homebridge

Then all items will be added again.
When I follow these steps I get this:

Code: Select all

[Domoticz] Initializing device with name Zonnescherm...
[Domoticz] Loaded services for Zonnescherm
Cannot create another accessory with the same name 'Zonnescherm'. The 'name' property must be unique for each accessory.
[Domoticz] Initializing device with name Alle Lampen AAN...
[Domoticz] Loaded services for Alle Lampen AAN
Cannot find secret key, creating One...

Re: Siri / HomeKit support for Domoticz

Posted: Saturday 27 June 2015 11:03
by G3rard
I get those messages of accesory not being unique as well, but it's working fine.

After the steps I described you also have to add the devices to the Eve / Insteon app again.