Re: Siri / HomeKit support for Domoticz
Posted: Tuesday 16 June 2015 20:23
No, the homebridge/lib/HAP-NodeJS folderthebeetleuk wrote:Code: Select all
/usr/local/lib/node_modules/
Open source Home Automation System
https://forum.domoticz.com/
No, the homebridge/lib/HAP-NodeJS folderthebeetleuk wrote:Code: Select all
/usr/local/lib/node_modules/
Still no luckpepijn wrote:No, the homebridge/lib/HAP-NodeJS folderthebeetleuk wrote:Code: Select all
/usr/local/lib/node_modules/
Code: Select all
pi@domoticzpi ~/homebridge/lib/HAP-NodeJS $ sudo npm run start
> [email protected] start /home/pi/homebridge/lib/HAP-NodeJS
> node BridgedCore.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/lib/HAP-NodeJS/BridgedCore.js:1:77)
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 BridgedCore.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node BridgedCore.js'.
npm ERR! This is most likely a problem with the HAP-NodeJS package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node BridgedCore.js
npm ERR! You can get their info via:
npm ERR! npm owner ls HAP-NodeJS
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/lib/HAP-NodeJS/npm-debug.log
Did you sudo npm run start that folder? You need to do sudo npm install in that folderthebeetleuk wrote:Still no luckpepijn wrote:No, the homebridge/lib/HAP-NodeJS folderthebeetleuk wrote:Code: Select all
/usr/local/lib/node_modules/
Code: Select all
pi@domoticzpi ~/homebridge/lib/HAP-NodeJS $ sudo npm run start > [email protected] start /home/pi/homebridge/lib/HAP-NodeJS > node BridgedCore.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/lib/HAP-NodeJS/BridgedCore.js:1:77) 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 BridgedCore.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script 'node BridgedCore.js'. npm ERR! This is most likely a problem with the HAP-NodeJS package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node BridgedCore.js npm ERR! You can get their info via: npm ERR! npm owner ls HAP-NodeJS 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/lib/HAP-NodeJS/npm-debug.log
OK so I guess I must have skipped the multiple install on the Wikisimon_rb wrote:Did you sudo npm run start that folder? You need to do sudo npm install in that folder
I'll let you know how it goes when finished.git clone https://github.com/nfarina/homebridge.git
cd homebridge
git submodule init
git submodule update
npm install (Should this be sudo nmp install?)
cd lib/HAP-NodeJS <- MISSED THIS
npm install<- MISSED THIS (Should this be sudo nmp install?)
Code: Select all
pi@raspberrypi /etc/init.d $ sudo update-rc.d homebridge.sh defaults
update-rc.d: using dependency based boot sequencing
insserv: warning: script 'homebridge.sh' missing LSB tags and overrides
Code: Select all
[Domoticz] Initializing device with name Staande lamp...
[Domoticz] Loaded services for Staande lamp
Cannot create another accessory with the same name 'Staande lamp'. The 'name' property must be unique for each accessory.
Have you been able to figure out in which config file these settings are actually stored?simon_rb wrote:I have the same message about the name needing to be unique. I hope there is a way to fix this.. Like you said it's a great script.
Just iron out the kinks.
No it's under homebridge/persist I think.. I'm not at home to check.. It's full of what looks like MAC address.. Delete that and it should all come back.D'rMorris wrote:Hi Simon,
I also reset the homekit config on my iPhone, but the devices that I once added do not come back. I even deleted Eve from the phone, reset the HK config, then rebooted, but the devices do not come back.
Then, I tried reinstalling homebridge on the Pi, also to no avail. I even did this part again (first deleted the whole homekit folder):
git clone https://github.com/nfarina/homebridge.git
cd homebridge
git submodule init
git submodule update
npm install
cd lib/HAP-NodeJS
npm install
Could you tell me what the persistent folder is so that I can try to delete them from there? For the rest, the Siri integration works beautiful!
EDIT: Is it this folder: /homebridge/lib/HAP-NodeJS/node_modules/node-persist? If so, do you just delete the whole contents of that folder?
Once iOS 9 launches in September then you should be able too..D'rMorris wrote:Ah found it! It's not in the homebridge folder, but in root. I deleted the files in there, hope that it works when I get home.
Too bad homebridge / homekit does not work across IP ranges. I've set my VPN so that clients get different adresses than my local devices. Maybe I have to give them the same range, but then addresses outside of the normal DHCP range at home. That way, I can create a VPN connection and tell my oven to start heating .
looks like I have it working. well I'm past that error now so looking good to progress.simon_rb wrote:Fingers crossed it'll work. Let us all know how you get on once it's running.. I've given up on it as on my system is too unreliable.. Both for executing commands and adding devices.
Excellent. Good luck!thebeetleuk wrote:looks like I have it working. well I'm past that error now so looking good to progress.simon_rb wrote:Fingers crossed it'll work. Let us all know how you get on once it's running.. I've given up on it as on my system is too unreliable.. Both for executing commands and adding devices.
I clearly missed something during the install process. Deleted the homebridge directory and installed from the start
thanks for everyone's help so far. I'm sure I'll be back with more questions
I have some more insights into the 'device already exists in HomeBridge / Unreachable from Eve'.D'rMorris wrote:Ah found it! It's not in the homebridge folder, but in root. I deleted the files in there, hope that it works when I get home.
Too bad homebridge / homekit does not work across IP ranges. I've set my VPN so that clients get different adresses than my local devices. Maybe I have to give them the same range, but then addresses outside of the normal DHCP range at home. That way, I can create a VPN connection and tell my oven to start heating .
Good find, wonder if the developer watches this thread. If that's causing the error I don't think it would be too hard to fix.. Fingers crossed.RvD wrote:I have some more insights into the 'device already exists in HomeBridge / Unreachable from Eve'.D'rMorris wrote:Ah found it! It's not in the homebridge folder, but in root. I deleted the files in there, hope that it works when I get home.
Too bad homebridge / homekit does not work across IP ranges. I've set my VPN so that clients get different adresses than my local devices. Maybe I have to give them the same range, but then addresses outside of the normal DHCP range at home. That way, I can create a VPN connection and tell my oven to start heating .
There are in fact two folders that are called 'persists', one in the root (/) and one in ~/homebridge (/home/pi/homebridge).
It would appear that sometimes, HomeKit creates files in the /persists folder.
However, most of the times files are created in ~/homebridge/persists.
Now, it would seem, that domoticz.js somehow checks the folder ~/homebridge/persists to see if a device has already been created.
There, it doesn't find the find and wants to create a new device.
However, the HomeKit-framework checks the /persists-folder as well and therefore the error is thrown.
I can't really replicate this issue, but it seems to be something like this. I might be a little off on the details, but is seems the problem has to do with two folders with the same name/purpose in different locations and sometimes the one and sometimes the other being used.