Page 11 of 27

Re: Siri / HomeKit support for Domoticz

Posted: Wednesday 22 July 2015 0:18
by nigels0
Thanks. That brought some back (the ones I removed) but not all.

Re: Siri / HomeKit support for Domoticz

Posted: Wednesday 22 July 2015 23:13
by G3rard
I would suggest to delete the persist directory and reset the Homekit config once more.

Re: Siri / HomeKit support for Domoticz

Posted: Thursday 23 July 2015 22:11
by h143
is there a way to show in homekit my gas usage en temperature of my sensors i can see in domoticz?

Re: Siri / HomeKit support for Domoticz

Posted: Monday 10 August 2015 21:34
by h143
nobody?

Autostart

Posted: Thursday 13 August 2015 21:29
by ivom74
I got homekit also running. Only a little problem with auto starting. I only get it to work with manually:
cd homebridge
npm start run

the process is running and everything is working. I tried the scripts below but the devices are not recognized then.
Any idea?

thanks'
Eduard wrote:As an addition to the roomid-config, i made a new domoticz.js with a parameter to disable the scenes...

Code: Select all

{
    "description": "Configuration file for Domoticz platform.",
    "platforms": [
        {
            "platform": "Domoticz",
            "name": "Domoticz",
            "server": "127.0.0.1",
            "port": "8080",
            "roomid": 123 (0=no roomplan),
            "usescenes": 0 (0=off, 1=on)
        }
    ],
    "accessories": [
    ]
}

Also made HomeBridge start at reboot with a startup-script:

Code: Select all

#!/bin/sh
#/etc/init.d/homebridge.sh

export PATH=$PATH:/usr/local/bin
export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules

case "$1" in
  start)
    exec forever start /home/pi/homebridge/app.js -p /home/pi/.forever
    ;;
  stop)
    exec forever stop /home/pi/homebridge/app.js
    ;;
  *)
    echo "Usage: homebridge.sh {start|stop}"
    exit 1
    ;;
esac

exit 0

Code: Select all

sudo chmod 755 /etc/init.d/homebridge.sh

update-rc.d homebridge.sh defaults
To remove from startup at reboot:

Code: Select all

update-rc.d -f homebridge.sh remove

Re: Siri / HomeKit support for Domoticz

Posted: Friday 14 August 2015 17:35
by ivom74
Domoticz is starting now automatically.
I use Eve app to add devices to switch by using SIRi.

How does it work? The devices I add with a alias name, where is the database stored? If i use a other iphone or ipad the commands are not recognized?

For each IOS hardware you have to programm the commands?

Re: Autostart

Posted: Saturday 15 August 2015 16:15
by drogert
ivom74 wrote:I got homekit also running. Only a little problem with auto starting. I only get it to work with manually:
cd homebridge
npm start run

the process is running and everything is working. I tried the scripts below but the devices are not recognized then.
Any idea?

thanks'
Eduard wrote:As an addition to the roomid-config, i made a new domoticz.js with a parameter to disable the scenes...

Code: Select all

{
    "description": "Configuration file for Domoticz platform.",
    "platforms": [
        {
            "platform": "Domoticz",
            "name": "Domoticz",
            "server": "127.0.0.1",
            "port": "8080",
            "roomid": 123 (0=no roomplan),
            "usescenes": 0 (0=off, 1=on)
        }
    ],
    "accessories": [
    ]
}

Also made HomeBridge start at reboot with a startup-script:

Code: Select all

#!/bin/sh
#/etc/init.d/homebridge.sh

export PATH=$PATH:/usr/local/bin
export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules

case "$1" in
  start)
    exec forever start /home/pi/homebridge/app.js -p /home/pi/.forever
    ;;
  stop)
    exec forever stop /home/pi/homebridge/app.js
    ;;
  *)
    echo "Usage: homebridge.sh {start|stop}"
    exit 1
    ;;
esac

exit 0

Code: Select all

sudo chmod 755 /etc/init.d/homebridge.sh

update-rc.d homebridge.sh defaults
To remove from startup at reboot:

Code: Select all

update-rc.d -f homebridge.sh remove
When using the "update-rc.d homebridge.sh defaults" Command I get this:

Code: Select all

root@domoticzpi:~# update-rc.d -f homebridge.sh defaults
update-rc.d: using dependency based boot sequencing
insserv: warning: script 'homebridge.sh' missing LSB tags and overrides
insserv: There is a loop between service watchdog and homebridge.sh if stopped
insserv:  loop involving service homebridge.sh at depth 2
insserv:  loop involving service watchdog at depth 1
insserv: Stopping homebridge.sh depends on watchdog and therefore on system facility `$all' which can not be true!
Any ideas?

Re: Siri / HomeKit support for Domoticz

Posted: Wednesday 19 August 2015 0:14
by Eduard
i got my HomeBridge running with autostart @reboot (rpi) :D

I used PM2 instead of forever. If you follow the instructions below, it will autostart HomeBridge after a reboot of you pi...

Code: Select all

sudo npm install pm2 -g
cd ~/homebridge/
pm2 start app.js --name HomeBridge

pm2 save

pm2 startup raspberry
sudo su -c "env PATH=$PATH:/usr/local/bin pm2 startup raspberry -u pi"

sudo chmod +x /etc/init.d/pm2-init.sh
Edit /etc/init.d/pm2-init.sh so that
export PM2_HOME="/home/pi/.pm2"
(was export PM2_HOME="/root/.pm2" but this causes errors)

Code: Select all

sudo update-rc.d pm2-init.sh defaults
Reboot and check proceslist...

Code: Select all

sudo reboot
pm2 list
Should something look like...

Code: Select all

┌────────────┬────┬──────┬──────┬────────┬─────────┬────────┬────────────┬──────────┐
│ App name   │ id │ mode │ pid  │ status │ restart │ uptime │ memory     │ watching │
├────────────┼────┼──────┼──────┼────────┼─────────┼────────┼────────────┼──────────┤
│ HomeBridge │ 0  │ fork │ 9092 │ online │ 0       │ 0s     │ 9.113 MB   │ disabled │
└────────────┴────┴──────┴──────┴────────┴─────────┴────────┴────────────┴──────────┘
Enjoy!

Re: Siri / HomeKit support for Domoticz

Posted: Wednesday 19 August 2015 18:37
by abplus
Hi all,

Every time I do npm run start I get the following. Can someone give me a hand please ? :)
  • 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=libdn ... ceRegister>
    Loading 1 platforms...
    [Domoticz] Initializing Domoticz platform...
    [Domoticz] Fetching Domoticz lights and switches...
    Loading 0 accessories...
    [Domoticz] There was a problem connecting to Domoticz.
    [Domoticz] There was a problem connecting to Domoticz.
I'm using the latest SDCard image from SoulForge.
If I add "roomid": "<2>" to the config.json I get a syntax error, roomid is undefined.

Thanks very much.

Re: Siri / HomeKit support for Domoticz

Posted: Wednesday 19 August 2015 20:14
by G3rard
You have to define room id as follows:

Code: Select all

"roomid": "2"
So without <> around it.

Re: Siri / HomeKit support for Domoticz

Posted: Wednesday 19 August 2015 21:33
by abplus
Thanks, but now I get:
  • Starting HomeBridge server...
    undefined:9
    "roomid": "2"

Re: Siri / HomeKit support for Domoticz

Posted: Wednesday 19 August 2015 22:01
by G3rard
Share your complete config so we can have a look at it.

Re: Siri / HomeKit support for Domoticz

Posted: Wednesday 19 August 2015 23:05
by abplus
Thanks very much for your help:

Code: Select all

{
    "description": "Configuration file for Domoticz platform.",
    "platforms": [
        {
            "platform": "Domoticz",
            "name": "Domoticz",
            "server": "127.0.0.1",
            "port": "8080"
            "roomid": "2"
        }
    ],
    "accessories": [
    ]
}
If I take the roomid line out of the config I get this error:

Code: Select all

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] There was a problem connecting to Domoticz.
[Domoticz] There was a problem connecting to Domoticz.
Any ideas ?

Re: Siri / HomeKit support for Domoticz

Posted: Thursday 20 August 2015 7:15
by Eduard
abplus wrote:Thanks very much for your help:

Code: Select all

{
    "description": "Configuration file for Domoticz platform.",
    "platforms": [
        {
            "platform": "Domoticz",
            "name": "Domoticz",
            "server": "127.0.0.1",
            "port": "8080"
            "roomid": "2"
        }
    ],
    "accessories": [
    ]
}
A comma is missing after "8080"
Should be

Code: Select all

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

Re: Siri / HomeKit support for Domoticz

Posted: Thursday 20 August 2015 10:16
by abplus
Thanks Eduard, its working now. Good learning experience for me !

Re: Siri / HomeKit support for Domoticz

Posted: Friday 21 August 2015 20:33
by ivom74
It was working but now I got some errors. I deleted the configs on my iphone and Ipad.
Try to change the room but it looks like it's ignoring the configs.

How can I see on what device it's hanging? Is it hanging on a device?

Can I delete the configs/database from homebridge on the raspberry device?
This question was asked before in this thread but I couldn't find the answer.
I hope someone can help.



pi@raspberrypi ~/homebridge $ npm run start

> [email protected] 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=libdn ... ceRegister>
Loading 1 platforms...
[Domoticz] Initializing Domoticz platform...
[Domoticz] Fetching Domoticz lights and switches...
Loading 0 accessories...
[Domoticz] Initializing device with name Eettafel lamp...
[Domoticz] Loaded services for Eettafel lamp
Cannot find secret key, creating One...
TCP server accepting connection on port: 51826
HAP Server is listening
[Domoticz] Initializing device with name Kast spotjes...
[Domoticz] Loaded services for Kast spotjes
Cannot find secret key, creating One...
TCP server accepting connection on port: 51828
HAP Server is listening
[Domoticz] Initializing device with name RGB Kast...
[Domoticz] Loaded services for RGB Kast
Cannot find secret key, creating One...
TCP server accepting connection on port: 51832
HAP Server is listening
[Domoticz] Initializing device with name Schemerlamp links...
[Domoticz] Loaded services for Schemerlamp links
Cannot find secret key, creating One...
TCP server accepting connection on port: 51838
HAP Server is listening
[Domoticz] Initializing device with name Schemerlamp rechts...
[Domoticz] Loaded services for Schemerlamp rechts
Cannot find secret key, creating One...
TCP server accepting connection on port: 51846
HAP Server is listening
[Domoticz] Initializing device with name Voork Plafond...
[Domoticz] Loaded services for Voork Plafond
Cannot find secret key, creating One...
TCP server accepting connection on port: 51856
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/pi/homebridge/node_modules/HAP-NodeJS/TCPServer.js:31:15)
at Object.publishAccessory (/home/pi/homebridge/node_modules/HAP-NodeJS/Accessory.js:13:28)
at createHAPServer (/home/pi/homebridge/app.js:169:15)
at /home/pi/homebridge/app.js:92:17
at Request._callback (/home/pi/homebridge/platforms/Domoticz.js:109:6)
at Request.self.callback (/home/pi/homebridge/node_modules/request/request.js:373:22)

npm ERR! Linux 4.1.4-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.6
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

Re: Siri / HomeKit support for Domoticz

Posted: Friday 21 August 2015 20:49
by G3rard
Stop Homekit, delete the files in the persist folder and clear settings on iOS, see http://www.domoticz.com/forum/viewtopic ... 864#p49201. Then start Homekit again.
If that does not work, also delete the app you are using and reboot the phone.

Re: Siri / HomeKit support for Domoticz

Posted: Friday 21 August 2015 20:55
by ivom74
G3rard wrote:Stop Homekit, delete the files in the persist folder and clear settings on iOS, see http://www.domoticz.com/forum/viewtopic ... 864#p49201. Then start Homekit again.
If that does not work, also delete the app you are using and reboot the phone.
Thank you for your fast reply, i'll try that.

Re: Siri / HomeKit support for Domoticz

Posted: Friday 21 August 2015 21:09
by ivom74
G3rard wrote:Stop Homekit, delete the files in the persist folder and clear settings on iOS, see http://www.domoticz.com/forum/viewtopic ... 864#p49201. Then start Homekit again.
If that does not work, also delete the app you are using and reboot the phone.
Errors still there, how can I know what device it hangs on?
What can be the reason why it is loading many devices and then stops with an unknown error?

Re: Siri / HomeKit support for Domoticz

Posted: Friday 21 August 2015 21:14
by G3rard
I don't know how many devices you have, but you can add them one at a time in the room in Domoticz and restart Homekit until you know which one gives the error.