Page 18 of 86

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 22 June 2016 0:47
by bxlouis
Thank you Marci for your awesome work ! The blinds do work with Siri now.

I still have 2 questions, though :

- I set one of my blinds as "Inverted blind" in Domoticz, and I think it is not recognized as a blind by eDomoticz.

- It seems the 2 other blinds I use (set as "blind" in Domoticz) work inverted. They close when I say "open my blinds" and open when I say "close my blinds". It is strange since it works well with Domoticz. I tried to change that behavior through Elgato Eve or Insteon+ apps but there is no setting that allows to do that.

Thank you again for your help !

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 22 June 2016 12:42
by SeaTea
Marci wrote:Looks like the nodejs package from Raspbian Jessie repos now only installs the node binary. You'll have to then install npm separately:

Code: Select all

sudo apt-get install npm
In my case this was not the solution, as npm seems to be installed, just not working without errors. (segmentation faults and illegal instruction)

After (lots of) digging via google I found a solution which seems to work. At least I can install everything now.

I am using a Raspberry-PI model 1, which has a ARM-6 on board. It seems that the default installation of nodejs which was pre-installed on the domoticz SD-image was for ARM-7, which wil probably work on the RPI-2 and 3.

So I removed the pre-installed installed nodejs :

Code: Select all

sudo apt-get remove nodejs
and to be sure:

Code: Select all

sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} /var/db/receipts/org.nodejs.*
hash -r
and after that installed latest node 6.2.2 for ARM6 (armv6l) binaries:

Code: Select all

wget https://nodejs.org/dist/latest-v6.x/node-v6.2.2-linux-armv6l.tar.gz
tar -xvf node-v6.2.2-linux-armv6l.tar.gz
cd node-v6.2.2-linux-armv6l
sudo cp -R * /usr/local/
cd
Then tried to install homebridge, but that failed also with errors with 'bignum' installation. This can be solved by installing homebridge with the option --unsafe-perm, after that installed forever and finally homebridge-edomoticz :

Code: Select all

sudo npm install -g homebridge --unsafe-perm
...

sudo npm install -g forever
...

sudo npm install -g homebridge-edomoticz
...
And follow the rest of the guide in the startpost.

I still have to configure and test the rest but at least installation worked now and logfile shows that it found some "platform accessory's" from my domoticz installation.

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 22 June 2016 15:36
by adjego
adjego wrote:Using this config i'm trying to get it to work. Something with authentication is going wrong. If i disable login all devices are fetched, if enabled with correct username and password set in config i get this:

Somebody has any pointers for me?
Marci wrote:Will have a look at it this weekend...
Did you by any change managed to have a look at this??

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 22 June 2016 16:29
by SeaTea
I found the following in .forever log after restart/update of the plugin:

Code: Select all

[6/22/2016, 3:27:31 PM] Warning: skipping plugin found at '/usr/local/lib/node_modules/homebridge-edomoticz' since we already loaded the same plugin from '/usr/lib/node_modules/homebridge-edomoticz'.
[6/22/2016, 3:27:35 PM] Loaded plugin: homebridge-edomoticz
It seems that I have 2 places with node_modules. I don't know if this is something from the installation which did not succeed (see my previous message), but how can I check if the right homebridge-edomoticz module is used / updated ? Can I check actual (used) version somewhere ?

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 22 June 2016 23:45
by Marci
I still have 2 questions, though :

- I set one of my blinds as "Inverted blind" in Domoticz, and I think it is not recognized as a blind by...
Inverted blinds have a different switchtypeval that hasn't been enabled yet.
- It seems the 2 other blinds I use (set as "blind" in Domoticz) work inverted. They close when I say "open my blinds" and open when I say "close my blinds". It is strange since it works well with Domoticz. I tried to change that behavior through Elgato Eve or Insteon+ apps but there is no setting that allows to do that.
These will need a manual override to invert them in the plugin. Leave them with me.

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 22 June 2016 23:47
by Marci
SeaTea wrote: It seems that I have 2 places with node_modules. I don't know if this is something from the installation which did not succeed (see my previous message), but how can I check if the right homebridge-edomoticz module is used / updated ? Can I check actual (used) version somewhere ?
Whichever node_modules folder you're running homeBridge itself from is the correct one. Delete the other.

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 22 June 2016 23:49
by Marci
adjego wrote:Did you by any change managed to have a look at this??
Nope - next on the list...

Re: eDomoticz Homebridge-Plugin

Posted: Sunday 26 June 2016 12:24
by Marci
Have a look for systemctl for running things at boot on jessie rather than the rc.d method of wheezy... odds on bet it's down to that.

Re: eDomoticz Homebridge-Plugin

Posted: Monday 27 June 2016 11:04
by Purejet
Yesterday i've tried to run the homebridge + plugin on the stable domoticz image.
But i failed inside the installation process (Messed up with installing from pi users, which install commands run with sudo). Can someone tell me which steps are necessary to do for this running completely on domoticz 4384?
When i only want to have the sensors that are already inside domoticz throug homebridge, what do i have to configure inside the json? Only the roomid + Platform and no extra accessoires?

Re: eDomoticz Homebridge-Plugin

Posted: Monday 27 June 2016 17:43
by Marci
Just follow steps in the first post...

Re: eDomoticz Homebridge-Plugin

Posted: Monday 27 June 2016 20:02
by Purejet
Marci wrote:Just follow steps in the first post...
I know. At the moment i'm trying to install everything on a clean raspbian jessie image. But also get errors from the npm section. Lots of "gyp ERR!"?

EDIT: Now i get:
pi@raspberrypi:~ $ sudo npm install -g homebridge
pi@raspberrypi:~ $

Re: eDomoticz Homebridge-Plugin

Posted: Monday 27 June 2016 22:40
by Marci
Purejet wrote:
Marci wrote:Just follow steps in the first post...
I know. At the moment i'm trying to install everything on a clean raspbian jessie image. But also get errors from the npm section. Lots of "gyp ERR!"?

EDIT: Now i get:
pi@raspberrypi:~ $ sudo npm install -g homebridge
pi@raspberrypi:~ $
Redo the npm lines with --unsafe-perm

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 28 June 2016 12:46
by BasPost
@Marci,
First off all, thanks for the excellent plugin! I've managed to install it with your excellent tutorial in the first post on my raspberry Pi, running Domoticz.
Everything works, except the .sh script which for starting at boot.
I've followed every step in your post: viewtopic.php?f=36&t=10272&p=72791#p72791
But when I start the script with:

Code: Select all

/etc/init.d/homebridge.sh start
I've got the following error in terminal:

Code: Select all

pi@raspberrypi:~$ /etc/init.d/homebridge.sh start
/etc/init.d/homebridge.sh: line 30: unexpected EOF while looking for matching `"'
/etc/init.d/homebridge.sh: line 34: syntax error: unexpected end of file
pi@raspberrypi:~$ 
I've attached the shell script which I created.

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 28 June 2016 19:04
by Purejet
Marci wrote:
Purejet wrote:
Marci wrote:Just follow steps in the first post...
I know. At the moment i'm trying to install everything on a clean raspbian jessie image. But also get errors from the npm section. Lots of "gyp ERR!"?

EDIT: Now i get:
pi@raspberrypi:~ $ sudo npm install -g homebridge
pi@raspberrypi:~ $
Redo the npm lines with --unsafe-perm
I did that. But every time i get more errors. I've also the error in the post above this. And another one;
Error: Cannot find module 'hap-nodejs'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/cli.js:2:11)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
error: Forever detected script exited with code: 1
error: Script restart attempt #11

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 28 June 2016 21:05
by Marci
Purejet wrote: I did that. But every time i get more errors. I've also the error in the post above this. And another one;
Sounds like npm hasn't installed dependencies...

Head to /usr/local/lib/node_modules/... Then go into each sub folder you find there and run 'sudo npm install --unsafe-perm' for each module (homebridge, and homebridge-eDomoticz)

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 28 June 2016 21:53
by BasPost
Justinb81 wrote:
BasPost wrote:@Marci,
First off all, thanks for the excellent plugin! I've managed to install it with your excellent tutorial in the first post on my raspberry Pi, running Domoticz.
Everything works, except the .sh script which for starting at boot.
I've followed every step in your post: viewtopic.php?f=36&t=10272&p=72791#p72791
But when I start the script with:

Code: Select all

/etc/init.d/homebridge.sh start
I've got the following error in terminal:

Code: Select all

pi@raspberrypi:~$ /etc/init.d/homebridge.sh start
/etc/init.d/homebridge.sh: line 30: unexpected EOF while looking for matching `"'
/etc/init.d/homebridge.sh: line 34: syntax error: unexpected end of file
pi@raspberrypi:~$ 
I've attached the shell script which I created.

Here is your corrected script the " was wrong

homebridge.sh.zip
Thank you so much @Justinb81, the script wants to start, but now with the following error:

Code: Select all

pi@raspberrypi:/etc/init.d$ /etc/init.d/homebridge.sh start
Starting HomeBridge
Password: 
bash: /usr/bin/forever: No such file or directory
Just to clarify, I've setup a new SD-card image of Domoticz this weekend and installed eDomoticz plugin as described in the first post of @Marci. I just now want to auto-start at boot, but no succes...

EDIT:
Manual start with

Code: Select all

forever start /usr/bin/homebridge
works though with the following result:

Code: Select all

pi@raspberrypi:~$ forever start /usr/bin/homebridge
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: /usr/bin/homebridge
EDIT2:
I think I've managed it!
I was reading the post of Justinb81: viewtopic.php?f=36&t=10272&start=340#p89413
And tried his sh script. And now no errors and everything seems to work. I did sudo reboot and it seems to start. I can control my lights with Siri.
I'm a beginner with Linux, so I would like to now what the difference is what I did

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 28 June 2016 23:38
by Marci
Aye - the current Domoticz image differs to the one that was around when I wrote all that. I need to do a fresh build and update the instructions.

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 29 June 2016 14:11
by NewFolk
Marci wrote:Am currently awaiting files from a contributor which add in RGB support... soon as they arrive I'll update the repos.
Do you know about https://github.com/dotsam/homebridge-milight ?

I`m using it 2 weeks and it is pretty stable.

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 29 June 2016 16:22
by BasPost
Ok, I tottaly screwed up my installation. I re-installed the domoticz-raspberrypi-sdcard-4834.7z image and restored my domoticz.db
Domoticz is running fine. But for now I don't installed the eDomoticz plugin.
So my RPi is a clean install on Rasbian Jessy, if I'm correct.
I also did apt-get update and apt-get upgrade

When I do in terminal "node -v" I get: "illegal instruction"
Also when I do: "homebridge" in terminal, as suggested in this topic: viewtopic.php?f=31&t=12460 I get: "illegal instruction"

So I don't wan't to continue, trying to install the eDomoticz plugin.

What to do?

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 29 June 2016 16:58
by NewFolk
I used this tutorial on Jessie and Rpi3 https://github.com/nfarina/homebridge/w ... spberry-Pi