Re: Siri / HomeKit support for Domoticz
Posted: Wednesday 22 July 2015 0:18
Thanks. That brought some back (the ones I removed) but not all.
Open source Home Automation System
https://forum.domoticz.com/
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
To remove from startup at reboot:Code: Select all
sudo chmod 755 /etc/init.d/homebridge.sh update-rc.d homebridge.sh defaults
Code: Select all
update-rc.d -f homebridge.sh remove
When using the "update-rc.d homebridge.sh defaults" Command I get this: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
To remove from startup at reboot:Code: Select all
sudo chmod 755 /etc/init.d/homebridge.sh update-rc.d homebridge.sh defaults
Code: Select all
update-rc.d -f homebridge.sh remove
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!
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
Code: Select all
sudo update-rc.d pm2-init.sh defaults
Code: Select all
sudo reboot
pm2 list
Code: Select all
┌────────────┬────┬──────┬──────┬────────┬─────────┬────────┬────────────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │
├────────────┼────┼──────┼──────┼────────┼─────────┼────────┼────────────┼──────────┤
│ HomeBridge │ 0 │ fork │ 9092 │ online │ 0 │ 0s │ 9.113 MB │ disabled │
└────────────┴────┴──────┴──────┴────────┴─────────┴────────┴────────────┴──────────┘
Code: Select all
"roomid": "2"
Code: Select all
{
"description": "Configuration file for Domoticz platform.",
"platforms": [
{
"platform": "Domoticz",
"name": "Domoticz",
"server": "127.0.0.1",
"port": "8080"
"roomid": "2"
}
],
"accessories": [
]
}
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.
A comma is missing after "8080"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": [ ] }
Code: Select all
{
"description": "Configuration file for Domoticz platform.",
"platforms": [
{
"platform": "Domoticz",
"name": "Domoticz",
"server": "127.0.0.1",
"port": "8080",
"roomid": "2"
}
],
accessories": [
]
}
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
Thank you for your fast reply, i'll try that.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?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.