Page 6 of 27

Re: Siri / HomeKit support for Domoticz

Posted: Sunday 14 June 2015 20:21
by simon_rb
Eduard wrote:
simon_rb wrote:For some reason it is only importing my scenes and none off the switches from the room. I called the room 123 just like in the code above. I have since removed the " from the 123 and that hasn't made any difference. Am I right in thinking its the room name and not some other ID like the IDX for the switches. Sorry I've taken some much of every bodies time up on here. I do sincerely appreciate it.
I think you have to use the room idx...
You were right - Thank you :D

Re: Siri / HomeKit support for Domoticz

Posted: Sunday 14 June 2015 22:22
by Heisenberg
gizmocuz wrote:is 'forever' not a better way to auto start nodejs applications?
(almost done with a new stable release, and installed forever on the sdcard image)
(homebridge is installed, but not active when you burn the sdcard image)

npm install forever
cd homebridge
forever start app.js
I get 'command not found' if i follow your advice

Re: Siri / HomeKit support for Domoticz

Posted: Sunday 14 June 2015 22:24
by simon_rb
Try sudo npm install forever -g

Re: Siri / HomeKit support for Domoticz

Posted: Sunday 14 June 2015 22:31
by Heisenberg
simon_rb wrote:Try sudo npm install forever -g
Thnx for the quick reply. It seems to installed correctly now, but what does this message means: "Your script will exit if it does not stay up for at least 1000ms"?

Code: Select all

pi@domoticzpi ~/homebridge $ sudo npm install forever -g
/usr/local/bin/forever -> /usr/local/lib/node_modules/forever/bin/forever
[email protected] /usr/local/lib/node_modules/forever
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
pi@domoticzpi ~/homebridge $ forever start app.js
warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info:    Forever processing file: app.js
pi@domoticzpi ~/homebridge $

Re: Siri / HomeKit support for Domoticz

Posted: Sunday 14 June 2015 22:33
by simon_rb
No probs, glad I can help others like they have me.

I think that means if it crashes within that time it won't restart it. However if it doesn't crash it will restart it if it lasts longer than that.

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 1:09
by simon_rb
Is anybody else getting a lot of devices that fail to sync and then disappear never to be seen again. This has happened after entering the correct pin. How do we get them back other then restarting the whole process again?

Cheers

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 6:53
by pvm
Simon, i had the same issue with a scene. Do not know how to resolve this. Deleting persistent data does not help?

Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 9:10
by geezerrr
I have the same, missing about 15 devices and haven't find out how to get them back... If someone have a solution? Please share with us!

I do have a additional thing the cpu of my pi go's after some time to 99,99%. Think idly has to do with this server..
Does someone noticed the same?

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 9:20
by Heisenberg
I noticed that Eve does not updates the status of the switches after a switch is turned on or off using Siri. Also when using another app (like Pilot) or Domoticz website Eve I have the same issue.

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 9:32
by Eduard
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": [
    ]
}

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 10:48
by simon_rb
pvm wrote:Simon, i had the same issue with a scene. Do not know how to resolve this. Deleting persistent data does not help?
I also had to reset the HomeKit data on my phone. Means you have to start again. Problem is when you start again the same thing happens and you lose more devices. It's a big circle and until we find a fix I think I'm going to abandon this project - just too buggy at the mo...

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 13:42
by simon_rb
Heisenberg wrote:I noticed that Eve does not updates the status of the switches after a switch is turned on or off using Siri. Also when using another app (like Pilot) or Domoticz website Eve I have the same issue.
I think this is the way the home bridge server is setup. I don't think it gets feedback at the mo. However I think it's being worked on..

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 13:44
by simon_rb
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
Great work. I may use the no scene file. I tend to use switches that activate scenes rather than use scenes directly.

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 14:27
by Eduard
I noticed that the devices that are being used by 1 HomeKit user, can not be used by another user. For example:

I have a roomplan with 3 devices, D1, D2 & D3.

1 iPhone with iCloud-user A, added D1 & D2
1 iPad with iCloud-user B, added D3 but cannot add D1 & D2, because they are already used by user A...

Another thing i noticed is that the devices stored in HomeKit are not synced between my devices; i have to make a new home in Eve, but cannot add the devices already added on my other device :cry:

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 14:32
by simon_rb
Eduard wrote:I noticed that the devices that are being used by 1 HomeKit user, can not be used by another user. For example:

I have a roomplan with 3 devices, D1, D2 & D3.

1 iPhone with iCloud-user A, added D1 & D2
1 iPad with iCloud-user B, added D3 but cannot add D1 & D2, because they are already used by user A...

Another thing i noticed is that the devices stored in HomeKit are not synced between my devices; i have to make a new home in Eve, but cannot add the devices already added on my other device :cry:
I haven't noticed that. I added everything using eve on my iPhone and Siri on my iPad can control all devices. I also added my wife as a user and her iphone can control the devices using Siri also. To be honest once a device has been registered it works well, it's just when you try and register and it fails the device disappears forever and that's the reason I'm not gonna spend anymore time on it.

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 14:40
by Eduard
simon_rb wrote:I also added my wife as a user and her iphone can control the devices using Siri also.
Do you both use the same iCloud-account?

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 14:43
by Heisenberg

Code: Select all

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

update-rc.d homebridge.sh defaults
This is what I get:

Code: Select all

pi@domoticzpi /etc/init.d $ update-rc.d 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 monit and homebridge.sh if stopped
insserv:  loop involving service homebridge.sh at depth 2
insserv:  loop involving service monit at depth 1
insserv: Stopping homebridge.sh depends on monit and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
pi@domoticzpi /etc/init.d $

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 14:45
by simon_rb
Eduard wrote:
simon_rb wrote:I also added my wife as a user and her iphone can control the devices using Siri also.
Do you both use the same iCloud-coount?
No, we have our own. Saying that I just tested it and it hasn't worked lol. I'm sure it did yesterday - maybe I used her iPad which is uses my iCloud account.

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 19:20
by Eduard
Heisenberg wrote:

Code: Select all

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

update-rc.d homebridge.sh defaults
This is what I get:

Code: Select all

pi@domoticzpi /etc/init.d $ update-rc.d 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 monit and homebridge.sh if stopped
insserv:  loop involving service homebridge.sh at depth 2
insserv:  loop involving service monit at depth 1
insserv: Stopping homebridge.sh depends on monit and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
pi@domoticzpi /etc/init.d $
I also still have problems running 'Forever' after reboot. Also tried to add it to my crontab, but this won't work either.
It has something to do with userrights because the persist directory in homebridge will not be created when starting it via startupscript or crontab.

Now is am starting it manually via ssh...

Code: Select all

sudo forever start /home/pi/homebridge/app.js
...until i find a good alternative

Re: Siri / HomeKit support for Domoticz

Posted: Monday 15 June 2015 22:11
by thebeetleuk
Hi All,

Giving this a go as it looks great. I have followed the Wiki but get the following error when doing the last steps:

Code: Select all

pi@domoticzpi ~/homebridge $ npm run start
Illegal instruction
OK so I have restarted the the pi and I get the following error now...

Code: Select all

pi@domoticzpi ~/homebridge $ npm run start

> [email protected] start /home/pi/homebridge
> node app.js

module.js:338
    throw err;
          ^
Error: Cannot find module 'node-persist'
    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/app.js:3:15)
    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)

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! [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
and this is the log...

Code: Select all

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start: `node app.js`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:14:12)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1008:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
10 verbose pkgid [email protected]
11 verbose cwd /home/pi/homebridge
12 error Linux 3.18.11+
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
14 error node v0.12.1
15 error npm  v2.5.1
16 error code ELIFECYCLE
17 error [email protected] start: `node app.js`
17 error Exit status 1
18 error Failed at the [email protected] start script 'node app.js'.
18 error This is most likely a problem with the homebridge package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     node app.js
18 error You can get their info via:
18 error     npm owner ls homebridge
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
Have now run:

Code: Select all

sudo npm install -g  node-persist
instead of

Code: Select all

npm install -g  node-persist
no joy :(