Page 15 of 86

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 10 May 2016 15:03
by deejc
Seems a bit quiet here for a while, anyway I'm thinking of coming back to domoticz from Vera!
I am running domoticz in a docker but did I see the official domoticz SD image now contains your Siri stuff ?

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 10 May 2016 17:19
by Marci
Er... dunno! If it does, no-one's said anything to me!!

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 10 May 2016 17:21
by simon_rb
The image has Homebridge but I don't think it has this plugin.

It's quiet here as it just works :-)
Marci can relax lol


Sent from my iPhone using Tapatalk

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 10 May 2016 17:49
by Marci
Cool! Could do with knowing the homebridge install location on the image so I can update OP instructions accordingly, so if anyone checks it out do let me know!

Re: eDomoticz Homebridge-Plugin

Posted: Friday 13 May 2016 11:49
by m0rph13
Some days ago my homekit app failed to be able to control my homebridge bridged stuff.
I removed the data from my phone.
I removed the persist directory from homebridge and started it up with sudo forever.
According to the homebridge logs all is well with an output like:

Code: Select all

[Fri May 13 2016 11:39:20 GMT+0200 (CEST)] Loaded plugin: homebridge-edomoticz
[Fri May 13 2016 11:39:20 GMT+0200 (CEST)] Registering accessory 'homebridge-edomoticz.eDomoticz'
[Fri May 13 2016 11:39:20 GMT+0200 (CEST)] Registering platform 'homebridge-edomoticz.eDomoticz'
[Fri May 13 2016 11:39:20 GMT+0200 (CEST)] ---
[Fri May 13 2016 11:39:20 GMT+0200 (CEST)] Loaded config.json with 0 accessories and 1 platforms.
[Fri May 13 2016 11:39:20 GMT+0200 (CEST)] ---
[Fri May 13 2016 11:39:21 GMT+0200 (CEST)] Loading 1 platforms...
[Fri May 13 2016 11:39:21 GMT+0200 (CEST)] [eDomoticz] Initializing eDomoticz platform...
[Fri May 13 2016 11:39:21 GMT+0200 (CEST)] [eDomoticz] Fetching Domoticz lights and switches...
[Fri May 13 2016 11:39:21 GMT+0200 (CEST)] Loading 0 accessories...
[Fri May 13 2016 11:39:21 GMT+0200 (CEST)] [eDomoticz] Initializing platform accessory 'Barometer'...
[Fri May 13 2016 11:39:21 GMT+0200 (CEST)] [eDomoticz] Initializing platform accessory 'Hörnlampa'...
....
[Fri May 13 2016 11:39:21 GMT+0200 (CEST)] [eDomoticz] Initializing platform accessory 'Övervåning'...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     
                       
[Fri May 13 2016 11:39:21 GMT+0200 (CEST)] Homebridge is running on port 51826.
I fired up the app on my phone, added the new (as I removed the old) home, added homebridge and entered the key.
the app then tries to find accessories but fails to find any.

I am not sure how to debug this to find out where the fault might be.. Any suggestion?

Re: eDomoticz Homebridge-Plugin

Posted: Friday 13 May 2016 13:11
by Marci
shouldn't need sudo forever... just forever. Using sudo puts persist & pairing info etc in /root/.homebridge rather than ~/.homebridge

Remove persist etc from both these locations, relaunch homebridge via forever WITHOUT using sudo, then head to HomeKit and set yourself back up. Might need to delete the default home again first.

Re: eDomoticz Homebridge-Plugin

Posted: Saturday 14 May 2016 12:40
by m0rph13
Thanks for your help Marci!

The problem seems to have been on the phone. I borrowed my daughters and then it worked as it should.
I removed the data from my phone, removed the app, restarted the phone and reinstalled the app and after that I could successfully receive the accessories again!

/M

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 18 May 2016 0:31
by markk
I've been trying for quite some time to get this working but I get stumped at the same point everytime.

I follow all the instruction but when I get here: "forever start /usr/local/lib/node_modules/homebridge/bin/homebridge"

This is the result:
siri.png
siri.png (2.93 KiB) Viewed 3111 times
What am I doing wrong?

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 18 May 2016 11:03
by deejc
Looks like forever isn't installed or isn't in your path


Sent from my iPhone using Tapatalk

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 18 May 2016 13:25
by markk
How do I do that?

I run "sudo apt-get update && sudo apt-get upgrade" and this process runs

Then when I get back to "pi@raspberrypi:~$" I do "sudo npm install -g homebridge && sudo npm install -g forever" but it just immediately reverts back to "pi@raspberrypi:~$"!!

I also tried

sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} /var/db/receipts/org.nodejs.*
hash -r
sudo curl -sL https://deb.nodesource.com/setup_0.12 | sudo -E bash -
sudo apt-get install nodejs

and

sudo apt-get install libavahi-compat-libdnssd-dev

I can't remember the exact outcome from these but I get a reply so as to imply that all the latest versions were already installed.

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 18 May 2016 16:26
by Bigted
markk wrote:How do I do that?

I run "sudo apt-get update && sudo apt-get upgrade" and this process runs

Then when I get back to "pi@raspberrypi:~$" I do "sudo npm install -g homebridge && sudo npm install -g forever" but it just immediately reverts back to "pi@raspberrypi:~$"!!

I also tried

sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} /var/db/receipts/org.nodejs.*
hash -r
sudo curl -sL https://deb.nodesource.com/setup_0.12 | sudo -E bash -
sudo apt-get install nodejs

and

sudo apt-get install libavahi-compat-libdnssd-dev

I can't remember the exact outcome from these but I get a reply so as to imply that all the latest versions were already installed.
What happens when you type either

node -v
npm -v

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 18 May 2016 17:30
by gomario
markk wrote:How do I do that?

I run "sudo apt-get update && sudo apt-get upgrade" and this process runs

Then when I get back to "pi@raspberrypi:~$" I do "sudo npm install -g homebridge && sudo npm install -g forever" but it just immediately reverts back to "pi@raspberrypi:~$"!!

I also tried

sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} /var/db/receipts/org.nodejs.*
hash -r
sudo curl -sL https://deb.nodesource.com/setup_0.12 | sudo -E bash -
sudo apt-get install nodejs

and

sudo apt-get install libavahi-compat-libdnssd-dev

I can't remember the exact outcome from these but I get a reply so as to imply that all the latest versions were already installed.

I had the exact thing happening.
The only way I was finally able to get eDomoticz working (there is so many outdated tutorials) was:

1. install Node Version Manager https://github.com/creationix/nvm/blob/ ... E.markdown
2. Followed their instructions and used

Code: Select all

nvm install 4.2.6
3. Activated it

Code: Select all

. ~/.nvm/nvm.sh
4. Checked for all instaled node versions

Code: Select all

nvm ls
5. uninstalled any other versions than 4.2.6

Code: Select all

nvm unstall x.x.x
6. set default version to use

Code: Select all

 nvm alias default 4.2.6
After that (I'm a newb) I copied config.json out using winscp(owned by root), deleted it and copied it back (now owned by pi).

- that finally fixed all illegal instructions errors or nothing happening after using any npm related command
npm takes a little while before it start installing but all works now. Finally I am able to use edomoticz.. no other way worked for me.

now every time I want to use nvm I just have to activate it again" . ~/.nvm/nvm.sh" but I might add this as a startup thingy....

I might be wrong with this, but I really worked for me. Linux is a complete nightmare (IMHO) when it comes to following guides etc. there is ALWAYS one package that is outdated and causes problems, or some repo dependency crap, or something just weird... on top of that there is supposed to be that issue with detecting ARM architecture in the old and new version of node...

eDomoticz Homebridge-Plugin

Posted: Wednesday 18 May 2016 18:26
by Marci
There's only ONE guide for eDomoticz - first page of this thread. The issue tends to be people following guidance for an ancient version of homebridge & the previous Domoticz plugin (nothing to do with me!) before realising their error, and THEN trying to install eDomoticz & the latest homebridge... or they’re working on a system that has been in-use and has had a shafted node installation for ages without actually realising it.


Run each command separately...

Code: Select all

sudo npm install -g homebridge
Post the output

Code: Select all

sudo npm install -g forever
Post the output

Now find where forever is installed...

Code: Select all

sudo find / -name forever
Post the output

And now find where homebridge is installed...

Code: Select all

sudo find / -name homebridge
Post the output

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 18 May 2016 18:30
by Marci
( or read back through this thread, as this has already been covered - read onwards from viewtopic.php?f=36&t=10272&start=220#p82466 )

Re: eDomoticz Homebridge-Plugin

Posted: Friday 20 May 2016 0:32
by markk
Marci wrote:There's only ONE guide for eDomoticz - first page of this thread. The issue tends to be people following guidance for an ancient version of homebridge & the previous Domoticz plugin (nothing to do with me!) before realising their error, and THEN trying to install eDomoticz & the latest homebridge... or they’re working on a system that has been in-use and has had a shafted node installation for ages without actually realising it.


Run each command separately...

Code: Select all

sudo npm install -g homebridge
Post the output

Code: Select all

sudo npm install -g forever
Post the output

Now find where forever is installed...

Code: Select all

sudo find / -name forever
Post the output

And now find where homebridge is installed...

Code: Select all

sudo find / -name homebridge
Post the output
OK, i followed these instructions and this is what I got:

output.png
output.png (34.8 KiB) Viewed 3010 times

Re: eDomoticz Homebridge-Plugin

Posted: Friday 20 May 2016 3:48
by gomario
markk wrote:
Marci wrote:There's only ONE guide for eDomoticz - first page of this thread. The issue tends to be people following guidance for an ancient version of homebridge & the previous Domoticz plugin (nothing to do with me!) before realising their error, and THEN trying to install eDomoticz & the latest homebridge... or they’re working on a system that has been in-use and has had a shafted node installation for ages without actually realising it.


....

OK, i followed these instructions and this is what I got:

output.png

That was exactly what happened to me. With a fresh, latest install of the Domoticz Raspi image, logged in as pi. Just no output, exactly like in the image above.

@Marci:
What I meant when I said that there are multiple guides...I meant going down the rabbit hole to get npm working,
Most of my searches ended pointing to outdated homebridge how-tos or previous Domoticz plugins, exactly as you said...
I finally found a solution using nvm to try different versions of node.js/npm ... some resulting in outputting: "illegal instruction" and some in nothing at all. After I got node.js 4.2.6 installed npm started working too and all went well.

Thanks again Marci for all you have done, your plugin is simply awesome. I did not want to sound like I haven't bothered reading through the thread or ungrateful in any way.

Re: eDomoticz Homebridge-Plugin

Posted: Friday 20 May 2016 8:47
by Marci
markk wrote:
OK, i followed these instructions and this is what I got:


output.png
Ok - we can see from the output there that homebridge appears to be installed, but forever has failed to install. So, let's put npm in verbose mode, as it (now) defaults to quiet mode...

Code: Select all

sudo npm -dd install -g forever
...and post the output. You should be able to left click-drag over text in the console and use Ctrl+c to copy, then paste that into your reply rather than use screenshots... That way you can post longer more-than-one-page output if necessary. Hit the 'code' button before and after pasting to get the forum to format it properly.

Re: eDomoticz Homebridge-Plugin

Posted: Friday 20 May 2016 10:19
by markk
@Gomario and @Marci
Thanks for your replies. I'll give this a go this evening. I really appreciate your support.

Re: eDomoticz Homebridge-Plugin

Posted: Friday 20 May 2016 22:56
by markk
I tried that and nothing happened :(

Code: Select all

pi@raspberrypi:~$ sudo npm -dd install -g forever
pi@raspberrypi:~$

eDomoticz Homebridge-Plugin

Posted: Saturday 21 May 2016 11:51
by Marci
Hmmm.... I suspect forever is failing to build in it's repo. Will investigate further. In meantime, use instructions for loading on boot here: https://github.com/nfarina/homebridge/w ... spberry-Pi (but note path differences - refer to your last screencap for paths to homeBridge, IE: yours is in /usr/bin not /usr/local/bin etc)

You can still run everything fine, just not via forever... so just skip the forever steps in the first post and continue on with the rest, then use details at link above to get it running on boot.

If forever is looking to be terminally screwed I'll update all the instructions to remove it, but as it stands, forever isn't required for anything else involved to work.