Page 13 of 86

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 19:10
by Marci
Nope, that all looks correct.

Double check paths for typos in homebridge.sh, or attach a copy of it / copy & paste contents of homebridge.sh to this post & I'll take a look

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 19:16
by Marci
You should be able to launch it manually just by typing...

Code: Select all

homebridge
...which should then tell you to create a config.json file in /home/pi/.homebridge/ (looks like you don't have one from results of that find command?)


forever start won't successfully launch homebridge if you haven't created a config file at that location.

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 19:21
by simon_rb
Thank you. I usually run it by typing homebridge at the command line or nohup homebridge&

Is this what your after?

#!/usr/bin/env node

//
// This executable sets up the environment and runs the HomeBridge CLI.
//

'use strict';

process.title = 'homebridge';

// Find the HomeBridge lib
var path = require('path');
var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');

// Run HomeBridge
require(lib + '/cli')();

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 19:22
by simon_rb
Marci wrote:You should be able to launch it manually just by typing...

Code: Select all

homebridge
...which should then tell you to create a config.json file in /home/pi/.homebridge/ (looks like you don't have one from results of that find command?)


forever start won't successfully launch homebridge if you haven't created a config file at that location.
No when I type homebridge it runs lol

Code: Select all

pi@raspberrypi ~ $ homebridge
*** 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>
*** 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>
[4/8/2016, 5:55:43 PM] Loaded plugin: homebridge-controllerlink
[4/8/2016, 5:55:44 PM] Registering platform 'homebridge-controllerlink.HomeBridgeControllerLink'
[4/8/2016, 5:55:44 PM] ---
[4/8/2016, 5:55:48 PM] Loaded plugin: homebridge-edomoticz
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-edomoticz.eDomoticz'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-edomoticz.eDomoticz'
[4/8/2016, 5:55:48 PM] ---
[4/8/2016, 5:55:48 PM] Loaded plugin: homebridge-legacy-plugins
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.AD2USB'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.Carwings'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.ELKM1'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.FileSensor'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.GenericRS232Device'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.HomeMatic'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.HomeMaticThermo'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.HomeMaticWindow'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.HttpGarageDoorOpener'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.HttpHygrometer'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.HttpThermometer'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.LiftMaster'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.Lockitron'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.Tesla'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.WeMo'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.X10'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.iControl'
[4/8/2016, 5:55:48 PM] Registering accessory 'homebridge-legacy-plugins.mpdclient'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.Domoticz'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.HomeAssistant'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.HomeSeer'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.ISY'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.LIFx'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.MiLight'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.Openhab'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.SmartThings'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.TelldusLive'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.Wink'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.YamahaAVR'
[4/8/2016, 5:55:48 PM] Registering platform 'homebridge-legacy-plugins.ZWayServer'
[4/8/2016, 5:55:48 PM] ---
[4/8/2016, 5:56:00 PM] Loaded plugin: homebridge-nest
[4/8/2016, 5:56:01 PM] Registering platform 'homebridge-nest.Nest'
[4/8/2016, 5:56:01 PM] ---
[4/8/2016, 5:56:01 PM] Loaded config.json with 0 accessories and 3 platforms.
[4/8/2016, 5:56:01 PM] ---
[4/8/2016, 5:56:01 PM] Loading 3 platforms...
[4/8/2016, 5:56:01 PM] [eDomoticz] Initializing eDomoticz platform...
[4/8/2016, 5:56:01 PM] [eDomoticz] Fetching Domoticz lights and switches...
[4/8/2016, 5:56:01 PM] Initializing HomeBridgeControllerLink platform...
[4/8/2016, 5:56:03 PM] Initializing Nest platform...
[4/8/2016, 5:56:03 PM] Fetching Nest devices.
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Babysitter Mode'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Bedroom'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Bedroom - TV'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Bedroom Film'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Bedroom Mode'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Bedroom Radio'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Bedroom Sky'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Bedroom Xbox'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Conservatory TV'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Curtains'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Devon Amp Media Power'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Dining Room - Celing Lights'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Dining Room - TV'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Dining Room - Tree Lights'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Dinner Time Switch'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Film'...
[4/8/2016, 5:56:31 PM] [eDomoticz] Initializing platform accessory 'Garage Toggle'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Garden Receiver'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Hall - Celing Lights'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Hallway - Christmas Tree Lights'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Home'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Jacks Bedroom - Ceiling Light'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Jacks TV'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Kitchen - TV'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Kitchen Blind'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Kitchen Radio'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Landing - Celing Lights'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room - Blue Lava Lamp'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room - Floor Standing Lamp'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room - Lights Mood 1'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room - Mood Lights 2'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room - Mood Lights 3'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room - Purple Lava Lamp'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room - Spare Socket 3'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room - Spare Socket 4'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room - TV'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room Celing Lights'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room Fire Place Lights'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room LED TV Backlight'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Living Room Wall Lights'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Lounge Touch'...
[4/8/2016, 5:56:32 PM] [eDomoticz] Initializing platform accessory 'Night Siri'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Outside - Front Door Light'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Outside - Main Lights'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Outside - Xmas Lights'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'PS4 Waker'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Play Bedroom Radio'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Play Kitchen Radio'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Play Music Touch'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Play PS4'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Play Xbox'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Play Xbox on PJ'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Projector Siri'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Server Off'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Sky Activity Dummy'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Transfer To TV'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Utility Blind'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Wake'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Wake Server'...
[4/8/2016, 5:56:33 PM] [eDomoticz] Initializing platform accessory 'Watch Film'...
[4/8/2016, 5:56:34 PM] [eDomoticz] Initializing platform accessory 'Watch Film on TV'...
[4/8/2016, 5:56:34 PM] [eDomoticz] Initializing platform accessory 'Xbox'...
[4/8/2016, 5:56:35 PM] Started HomeBridgeControllerLink on port 51828
[4/8/2016, 5:56:38 PM] Software version for Hallway Thermostat is: 5.2-6
[4/8/2016, 5:56:38 PM] Current temperature for Hallway Thermostat is: 20 C
[4/8/2016, 5:56:38 PM] Current humidity for Hallway Thermostat is: 40%
[4/8/2016, 5:56:38 PM] Target temperature for Hallway Thermostat is: 16 C
[4/8/2016, 5:56:38 PM] Target heating for Hallway Thermostat is: Heating
[4/8/2016, 5:56:38 PM] Away for Hallway Thermostat is: 0
[4/8/2016, 5:56:38 PM] Initializing platform accessory 'Hallway Thermostat'...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     
                       
[4/8/2016, 5:56:39 PM] Homebridge is running on port 51927.

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 19:25
by Marci
Righty... what happens when you type:

Code: Select all

forever start /usr/local/bin/homebridge
?

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 19:31
by simon_rb
Marci wrote:Righty... what happens when you type:

Code: Select all

forever start /usr/local/bin/homebridge
?
Looks like it works

Code: Select all

pi@raspberrypi ~ $ forever start /usr/local/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/local/bin/homebridge
pi@raspberrypi ~ $ 

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 20:02
by Marci
(Sorry, just had to pop out for a mo) Righty, so the final piece of the puzzle...

We’ve proven homebridge is working fine and we know where it’s installed... the correct place. The homebridge binary is installed at /usr/local/lib/node_modules/homebridge/bin/homebridge, and there’s a symbolic link to it located at /usr/local/bin/homebridge.

We’ve also proven ‘forever' is working fine with homebridge... so, where is ‘forever’ ?

Code: Select all

sudo find / -name forever

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 20:12
by simon_rb
Don't apologise, appreciate your help :)

Code: Select all

pi@raspberrypi ~ $ sudo find / -name forever
/root/.npm/forever
/root/.npm/registry.npmjs.org/forever
/usr/local/bin/forever
/usr/local/lib/node_modules/forever
/usr/local/lib/node_modules/forever/bin/forever
/usr/local/lib/node_modules/forever/lib/forever

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 20:26
by Marci
That’s been the problem then!

If you look at homebridge.sh, the script you use to start it at boot up...

Code: Select all

sudo pico /etc/init.d/homebridge.sh
You’ll find there’s a command issued depending on whether you’re starting or stopping or restarting, which contains the path to forever, and the path to homebridge. The path to forever is wrong for your system.

Ctrl-w (to find within nano / pico editor), and type in /usr/bin/forever and hit enter.

Change wherever it finds it to /usr/local/bin/forever - the first result will be in the start) block.

Ctrl-w, enter to find the next one, in the stop) block, and once more for the restart) block.

Ctrl-o to save, Ctrl-x to exit.

Then...

Code: Select all

sudo update-rc.d homebridge.sh defaults
...to register the changes with the init.d system.

Now...

Code: Select all

sudo reboot
When the Pi reboots and comes back online, Homebridge should be started automagically.
Confirm this with...

Code: Select all

 ps aux | grep homebridge
...and you should see something similar to:

Code: Select all

pi        2303  0.0  4.6  42404 23220 ?        Ss   01:18   0:15 /usr/local/bin/node /usr/local/lib/node_modules/forever/bin/monitor /usr/local/lib/node_modules/homebridge/bin/homebridge
pi        2334  0.4 11.3 111928 56208 ?        Sl   01:19   5:18 homebridge                                                               
pi        5329  0.0  0.3   3564  1792 pts/2    S+   19:20   0:00 grep --color=auto homebridge
You can check it’s forever index with...

Code: Select all

forever list
...and look for the number at the start of the data: line for your instance of homebridge (probably [0]).
You can now monitor it’s logs by issuing...

Code: Select all

forever logs 0
See https://github.com/foreverjs/forever for full commands for 'forever'

If you want to tail & watch the log live, then use the command from the first post... get the log file from output of 'forever list’ and tail -f it... e.g.:

Code: Select all

tail -f /home/pi/.forever/CsP6.log
or use:

Code: Select all

tail -f `ls -t ~/.forever/*.log | grep -v '^d' | head -n1`
...if you know it’s the only thing you’re running with ‘forever’.

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 20:33
by simon_rb
Thanks a million. Whats the best way to learn how to code etc.. I'd love to be able to troubleshoot and help others like you have helped me!

I assume forever will restart homebridge if it crashes unexpectedly?

Cheers

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 20:39
by Marci
Yep, forever launches and then monitors homebridge and if it dies or stops responding for any reason SHOULD restart it. If it doesn’t you can just manually issue forever restartall to give it a kick.

Err - not sure!! I taught myself everything I know just by dissecting the code of others and working out for myself what it did, and then later in life just with google, however I started doing this 26 years ago on a 16mHz 286 PC & a Spectrum 48K! https://www.codecademy.com ?

Re: eDomoticz Homebridge-Plugin

Posted: Friday 08 April 2016 21:09
by simon_rb
I have a question (another I know). I think I have found an issue with my homebridge. If I issue the halt command and power down my pi, then run home bridge it runs fine. If it crashes however I cannot run it again as I get this error. Even if I issue the reboot command I get the same error. If I issue the halt command and unplug then plug in the Pi it will work again unless it crashes. Error below was taken from the Forever log however its the same if I try and run it from command line.

(data: /usr/local/bin/homebridge:17418 - [4/8/2016, 7:58:57 PM] { [Error: dns service error: unknown] errorCode: -65537 }

Something to do with mdnsd maybe

Re: eDomoticz Homebridge-Plugin

Posted: Saturday 09 April 2016 1:16
by simon_rb
If I restart my router and the pi loses wifi connection thats when forever tries to shutdown homebridge and run it again. And once it has shut it down once it will never be able to start homebridge again until I actually shut the pi down and turning it back on again. The loop causes my CPU to run at over 95% constantly. I have grabbed a forever log just to see if you can see anything obvious? Cheers
(again I do appreciate your help with this since its nothing to do with your plugin, just exploiting your good nature :D )

Code: Select all

pi@raspberrypi ~ $ forever logs 0
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:50 AM] Registering platform 'homebridge-nest.Nest'
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:50 AM] ---
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:50 AM] Loaded config.json with 0 accessories and 3 platforms.
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:50 AM] ---
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:51 AM] Loading 3 platforms...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:51 AM] [eDomoticz] Initializing eDomoticz platform...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:51 AM] [eDomoticz] Fetching Domoticz lights and switches...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:51 AM] Initializing HomeBridgeControllerLink platform...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:52 AM] Initializing Nest platform...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:08:52 AM] Fetching Nest devices.
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:21 AM] [eDomoticz] Initializing platform accessory 'Babysitter Mode'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Bedroom'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Bedroom - TV'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Bedroom Film'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Bedroom Mode'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Bedroom Radio'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Bedroom Sky'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Bedroom Xbox'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Conservatory TV'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Curtains'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Devon Amp Media Power'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Dining Room - Celing Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Dining Room - TV'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Dining Room - Tree Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Dinner Time Switch'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Film'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Garage Toggle'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Garden Receiver'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Hall - Celing Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Hallway - Christmas Tree Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Home'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Jacks Bedroom - Ceiling Light'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Jacks TV'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Kitchen - TV'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:22 AM] [eDomoticz] Initializing platform accessory 'Kitchen Blind'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Kitchen Radio'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Landing - Celing Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room - Blue Lava Lamp'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room - Floor Standing Lamp'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room - Lights Mood 1'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room - Mood Lights 2'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room - Mood Lights 3'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room - Purple Lava Lamp'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room - Spare Socket 3'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room - Spare Socket 4'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room - TV'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room Celing Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room Fire Place Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room LED TV Backlight'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Living Room Wall Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Lounge Touch'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Night Siri'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Outside - Front Door Light'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Outside - Main Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Outside - Xmas Lights'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'PS4 Waker'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Play Bedroom Radio'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Play Kitchen Radio'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Play Music Touch'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:23 AM] [eDomoticz] Initializing platform accessory 'Play PS4'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Play Xbox'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Play Xbox on PJ'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Projector Siri'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Server Off'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Sky Activity Dummy'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Transfer To TV'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Utility Blind'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Wake'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Wake Server'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Watch Film'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Watch Film on TV'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - [4/9/2016, 12:09:24 AM] [eDomoticz] Initializing platform accessory 'Xbox'...
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - /usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/websocket_extensions.js:133
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     this._pipeline.processIncomingMessage(message, callback, context);
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -                   ^
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - TypeError: Cannot read property 'processIncomingMessage' of undefined
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at instance.processIncomingMessage (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/websocket_extensions.js:133:19)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at instance._emitMessage (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:442:22)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at instance._emitFrame (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:405:19)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at instance.parse (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:144:18)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at instance.parse (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/client.js:56:58)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at IO.write (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/streams.js:80:16)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at TLSSocket.ondata (_stream_readable.js:525:20)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at emitOne (events.js:77:13)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at TLSSocket.emit (events.js:169:7)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at readableAddChunk (_stream_readable.js:146:16)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at TLSSocket.Readable.push (_stream_readable.js:110:10)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 -     at TLSWrap.onread (net.js:523:20)
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - error: Forever detected script exited with code: 1
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - error: Script restart attempt #8
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - *** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - *** WARNING *** Please fix your application to use the native API of Avahi!
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - *** WARNING *** Please fix your application to use the native API of Avahi!
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - *** WARNING *** Please fix your application to use the native API of Avahi!
data:    /usr/local/lib/node_modules/homebridge/bin/homebridge:24123 - *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
pi@raspberrypi ~ $ 

Re: eDomoticz Homebridge-Plugin

Posted: Saturday 09 April 2016 14:19
by Marci
Well, it looks like the issue is something within the homebridge-nest plugin and their implementation of web sockets, but beyond that I couldn’t say. You’d need to take it up with it’s author (see https://github.com/kraigm/homebridge-nest/issues)... or open an issue at homebridge hq to see if it’s something that needs resolving within homebridge core, as it appears to be related to mdns / avahi (see https://github.com/nfarina/homebridge/issues).

When it dies and gets in to a non-restartable situation, have a look thru the output of ...

Code: Select all

ps aux
Look for any instances of firebase, faye-websocket, or libwebsockets that may still be running and locking up web socket port. Kill ‘em via...

Code: Select all

sudo kill -9 [pid]
...then try restarting,

Other solution - ditch homebridge-nest with:

Code: Select all

sudo rm -rf /usr/local/lib/node_modules/homebridge-nest
...and try to see if you can integrate the nest into Domoticz (no idea if possible - have a search on these ‘ere forums), and then let the eDomoticz plugin handle control thru HomeKit, seeing as it’s that particular plugin causing the grief.

Re: eDomoticz Homebridge-Plugin

Posted: Saturday 09 April 2016 14:21
by SwordFish
Marci wrote:Assuming you've added temp sensor to Living Room in your HomeKit app, s'just down to how you ask...

"Hey Siri, how warm is it in the living room?"
Thanks that works :P
Is there a frase for asking the power consumption?

Re: eDomoticz Homebridge-Plugin

Posted: Saturday 09 April 2016 14:23
by Marci
simon_rb wrote: I have grabbed a forever log just to see if you can see anything obvious? Cheers
(again I do appreciate your help with this since its nothing to do with your plugin, just exploiting your good nature :D )
Out of curiosity (having just read one of your other threads on Nest in Domoticz) - I notice you’re running master & slave Pi’s. What are these? e.g.: Master - Pi3, Slave, Pi1 B+ ...and what OS is each running? (Jessie, Wheezy etc). I know that web sockets can cause issues on wheezy for instance if not configured correctly, so if a plugin is coded for web sockets on Jessie, but is installed on Wheezy, it may not work properly. This may explain why you can only get your Nest working via Domoticz on your slave and not your master, should they be different hardware / different OS installs.

Re: eDomoticz Homebridge-Plugin

Posted: Saturday 09 April 2016 14:24
by Marci
SwordFish wrote:Is there a frase for asking the power consumption?
I’m afraid not as it’s not natively part of the HomeKit spec... it’s a custom sensor type. Siri can only query the official services and characteristics as defined within HAP-NodeJS (a dependence of Homebridge) at https://github.com/KhaosT/HAP-NodeJS/bl ... itTypes.js

Re: eDomoticz Homebridge-Plugin

Posted: Saturday 09 April 2016 16:52
by simon_rb
Marci wrote:
simon_rb wrote: I have grabbed a forever log just to see if you can see anything obvious? Cheers
(again I do appreciate your help with this since its nothing to do with your plugin, just exploiting your good nature :D )
Out of curiosity (having just read one of your other threads on Nest in Domoticz) - I notice you’re running master & slave Pi’s. What are these? e.g.: Master - Pi3, Slave, Pi1 B+ ...and what OS is each running? (Jessie, Wheezy etc). I know that web sockets can cause issues on wheezy for instance if not configured correctly, so if a plugin is coded for web sockets on Jessie, but is installed on Wheezy, it may not work properly. This may explain why you can only get your Nest working via Domoticz on your slave and not your master, should they be different hardware / different OS installs.
Thank you for taking the time to read through my log. Both are Pi B+ and they are both Wheezy images. I had issues trying to keep the wifi dongle alive over night when my router is off when using Jessie. I was running my main pi using latest domoticz and it would only connect with the nest 20% of the time then it would fail to get state and be off for days. I deleted it and added it again but it has never found it since. Decided to get another pi to open my garage door using the GPIO pins. I just duplicated my card but removed all the domoticz files so it started as fresh, got the garage door working and then decided to try finding my nest using domoticz on the garage pi. Bizarrely it added straight away. And been working great ever since although like I mentioned in the nest post I can't changed the temperature on my main pi however can on the slave.

Could the fault be related? As in my garage pi with domoticz sharing the nest thermostat is causing issue with homebridge? If I add my thermostat from domoticz with homebridge I could get rid of the nest plugin. Would all the temperature commands work with Siri when sharing it from domoticz? Only issue is my main pi can't change the temp, only the garage pi can. I guess it would be better to find out why the garage domoticz can find the nest and the main home pi domoticz can't. They are both the same image and version as I said earlier - I just cloned the card and deleted the domoticz files so it would start fresh.

Any logs I could send to help you or even give you VPN access to see what you what's going on, I'd trust you Image

Re: eDomoticz Homebridge-Plugin

Posted: Saturday 09 April 2016 17:15
by Marci
simon_rb wrote:I had issues trying to keep the wifi dongle alive over night when my router is off when using Jessie. I was running my main pi using latest domoticz and it would only connect with the nest 20% of the time then it would fail to get state and be off for days. I deleted it and added it again
but it has never found it since.
See https://www.raspberrypi.org/forums/view ... 9&p=647343 for the WiFi issues with Jessie. That’s the usual culprit.
Only issue is my main pi can't change the temp, only the garage pi can. I guess it would be better to find out why the garage domoticz can find the nest and the main home pi domoticz can't. They are both the same image and version as I said earlier - I just cloned the card and deleted the domoticz files so it would start fresh.
You could try adding a second platform in config.json for homebridge, that runs another instance of eDomoticz, connecting directly to the garage pi’s ip address to test... I’d probably need to see the json output for the garage pi domoticz thermostat device / nest control devices to advise how to set it up, but I’m controlling my Siemens RCR10 thermostat relay fine via siri here (Upper & Lower set point, and override on/off)

Re: eDomoticz Homebridge-Plugin

Posted: Saturday 09 April 2016 18:13
by simon_rb
Ok, if I could add my nest to the main domoticz then that would solve the issue. What sort of log would you need from both pis to compare what's gone wrong on my main one. Then I can ditch the nest plugin and just use your edomoticz. Or as you suggested add another edomoticz to connect to the pi and share the nest that way. Would that be stable enough to run and leave rather than test as that would solve the issue. Or if I try and change the set point temperature from my main pi and then the same from my garage pi and see where is going wrong. However I am going to go and remove the nest plugin and see if that solves the issue of homebridge not being able to restart

UPDATE:-

I have done as you suggested and ran two eDomoticz platforms and it all seems to be working at the moment. Not simulated the disconnection yet however if I exit homebridge, it loads fine when launching again..

Thanks for all your help! A Star!!!