Page 17 of 86

eDomoticz Homebridge-Plugin

Posted: Sunday 12 June 2016 11:34
by NewFolk
Marci Thank you for this great plugin!

PS Is there any news about RGB support?
PPS there is good manual about installing homebridge on raspberry https://github.com/nfarina/homebridge/w ... spberry-Pi

Re: eDomoticz Homebridge-Plugin

Posted: Sunday 12 June 2016 12:03
by Marci
Am currently awaiting files from a contributor which add in RGB support... soon as they arrive I'll update the repos.

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 14:07
by adjego
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:

Output:

Code: Select all

pi@raspberrypi ~/homebridge $ 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>
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] Loaded plugin: homebridge-edomoticz
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] Registering accessory 'homebridge-edomoticz.eDomoticz'
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] Registering platform 'homebridge-edomoticz.eDomoticz'
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] ---
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] Loaded config.json with 0 accessories and 1 platforms.
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] ---
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] Loading 1 platforms...
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] [eDomoticz] Initializing eDomoticz platform...
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] [eDomoticz] Fetching Domoticz lights and switches...
[Tue Jun 14 2016 14:04:56 GMT+0200 (CEST)] Loading 0 accessories...
[Tue Jun 14 2016 14:04:57 GMT+0200 (CEST)] [eDomoticz] There was a problem connecting to Domoticz.
pi@raspberrypi ~/homebridge $
config.json:

Code: Select all

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },
    "description": "Configuration file for Domoticz platform.",
    "platforms": [
        {
            "platform": "eDomoticz",
            "name": "eDomoticz",
            "server": "xxx:[email protected]",
            "port": "8080"
        }
    ],
    "accessories": [
    ]

}
Somebody has any pointers for me?

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 14:33
by markk
I got stuck with this. In the end I think I removed the login details from the config and then adjusted the permissions on the Domoticz settings page to allow the PC I was connecting from to do so without having to login.

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 15:10
by adjego
Well if i do that, then it does not use authentication anymore because i have a reverse proxy running on the same raspberry pi so all incoming connections are coming from 127.0.0.1.

I read for other people it is working using the username and password in the server setting but for some kind of reason it does not work for me.

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 15:49
by jantb
I am also having this problem.

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 19:16
by Marci
Will have a look at it this weekend...

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 19:49
by bxlouis
Hello everyone, :)

I have a problem understanding the "SwitchTypeVal" thing. :?

My roller blinds are controlled by Fibaro Roller Shutter 2 modules but they are recognized as light switches by Homekit.
How do I turn them into blinds switches ???

From what I read from the first post, the blinds are supported as "Blinds - Domoticz SwitchTypeVal: 3".
But how do I create a SwitchTypeVal 3 ???

Also, even if I set the switch type to "blind" or "inverted blind" the "Type" column still shows "Light/Switch" in the settings "device panel".

Thank you very much for your help !

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 20:04
by Marci
Blind support existed for half a day then was removed again...

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 20:22
by bxlouis
Oh... And there is no way to customize that behavior within Domoticz ?

I mean the goal is to be able to tell Siri "Open/Close my blind" instead of "Turn it On/Off" which doesn't make sense !!!

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 20:28
by simon_rb
bxlouis wrote:Oh... And there is no way to customize that behavior within Domoticz ?

I mean the goal is to be able to tell Siri "Open/Close my blind" instead of "Turn it On/Off" which doesn't make sense !!!
I set up a scene called "Close Curtains" "Close Utility Blind" etc.. And that scene switches the switch in domoticz.. If that makes sense..

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 20:37
by bxlouis
simon_rb wrote:
bxlouis wrote:Oh... And there is no way to customize that behavior within Domoticz ?

I mean the goal is to be able to tell Siri "Open/Close my blind" instead of "Turn it On/Off" which doesn't make sense !!!
I set up a scene called "Close Curtains" "Close Utility Blind" etc.. And that scene switches the switch in domoticz.. If that makes sense..
Thanks for your answer !

However, I added a scene and it is not shown it the accessories list. How do you add it to your accessories list ?

Cheers!

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 20:38
by simon_rb
I mean create a scene within HomeKit...

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 20:41
by bxlouis
simon_rb wrote:I mean create a scene within HomeKit...
Right! I get what you mean. I'll give it a try. Thanks !

Still it is really frustrating the "blind" type does not exist... I mean it looks so obvious I don't get it ! :shock:

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 14 June 2016 20:45
by simon_rb
Marci got it working but the blinds that ship with HomeKit give feedback to HomeKit stating how open they are where as most blinds within domoticz are either open or closed. Plus I have curtains and blinds and if it's set as blind within HomeKit it starts to get complicated as it isn't a blind.

Something like that anyways..

Re: eDomoticz Homebridge-Plugin

Posted: Wednesday 15 June 2016 6:58
by bxlouis
simon_rb wrote:Marci got it working but the blinds that ship with HomeKit give feedback to HomeKit stating how open they are where as most blinds within domoticz are either open or closed. Plus I have curtains and blinds and if it's set as blind within HomeKit it starts to get complicated as it isn't a blind.

Something like that anyways..
Well I use Fibaro Roller Shutter 2 and they do give feedback stating how open they are!

Marci, would it be possible to give it a new try? Blinds support is a major topic in home automation and I am sure I am not the only one interested in that ! :roll:

Re: eDomoticz Homebridge-Plugin

Posted: Friday 17 June 2016 20:59
by SeaTea
Trying to install homebridge-eDomoticz after moving Domoticz from another homeserver pc to a RPI. Domoticz itself is working fine, I have installed the latest beta-image and updated/upgraded RPI and Domoticz.

Following the Startpost to install Homebridge, but it seems that npm is not working as should. All commands starting with 'sudo npm ....' just show the prompt again. Also 'forever' seems to be not installed:

Code: Select all

pi@raspberrypi:~$ sudo npm -v homebridge
pi@raspberrypi:~$ npm -v homebridge
Illegal instruction
pi@raspberrypi:~$ forever -v
-bash: forever: command not found
pi@raspberrypi:~$
First I tried to remove nodejs and reinstall as described in startpost, but when trying to reinstall, I got the warning that is was already installed (I deleted as described in startpost). Then removed nodejs with :

Code: Select all

sudo apt-get remove nodejs
That worked, now I could re-install nodejs, but after installation, the same reactions: npm does not react when called via sudo and gives a 'illegal instruction' when run as user pi. See below:

Code: Select all

pi@raspberrypi:~/.homebridge$ sudo apt-get remove nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  rlwrap
Use 'apt-get autoremove' to remove it.
The following packages will be REMOVED:
  nodejs
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
After this operation, 37.7 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 35137 files and directories currently installed.)
Removing nodejs (4.4.5-1nodesource1~jessie1) ...
Processing triggers for man-db (2.7.0.2-5) ...
pi@raspberrypi:~/.homebridge$ cd ..
pi@raspberrypi:~$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 6,608 kB of archives.
After this operation, 31.8 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_0.12/ jessie/main nodejs armhf 0.12.13-1nodesource1~jessie1 [6,608 kB]
Fetched 6,608 kB in 8s (806 kB/s)
Selecting previously unselected package nodejs.
(Reading database ... 31697 files and directories currently installed.)
Preparing to unpack .../nodejs_0.12.13-1nodesource1~jessie1_armhf.deb ...
Unpacking nodejs (0.12.13-1nodesource1~jessie1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up nodejs (0.12.13-1nodesource1~jessie1) ...
pi@raspberrypi:~$ sudo npm -v
pi@raspberrypi:~$ sudo npm install
pi@raspberrypi:~$ sudo npm install -g homebridge && sudo npm install -g forever
I don't think this is caused by too many sensors as others had, because the installation itself seems to be not working. But as no screen information (of logfiles) show anything I am a bit lost. How to proceed now ? Did anyone install this starting with the latest domoticz image on RPI ?

Re: eDomoticz Homebridge-Plugin

Posted: Monday 20 June 2016 22:31
by TakeAway
I have exactly the same issue as mentioned above. Using RPI 3. Started all over again with a fresh install, same problem.

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 21 June 2016 17:57
by Marci
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

Re: eDomoticz Homebridge-Plugin

Posted: Tuesday 21 June 2016 22:27
by Marci
NPMJS repo updated to v0.2.0...

Code: Select all

V0.2.0  - 2016/06/21
    - Switch Total & Current Power Consumption UUIDs to Elgato types
    - Enable SwitchType 13 blinds(%) - Fibaro controlled etc.
    - Enable Location and Occupancy sensors - Location being Domoticz text type sensors with "Location" in title,
      and Occupancy sensors being on/off type sensors with "Occupied" in title. Should work with most PIRs etc.
To disable Type3 Blind Support (as I know some don’t like it), just edit index.js and add // to the beginning of each of the following lines:

Code: Select all

case this.swTypeVal == 3:{ //blinds
              var blindService = new Service.WindowCovering(this.name);
              blindService.getCharacteristic(Characteristic.CurrentPosition).on('get', this.getBlindStatus.bind(this));
              blindService.getCharacteristic(Characteristic.TargetPosition).on('get', this.getBlindStatus.bind(this)).on('set', this.setBlindStatus.bind(this));
              blindService.getCharacteristic(Characteristic.PositionState).on('get', this.getBlindPStatus.bind(this));
              services.push(blindService);
              break;
            }
...becomes...

Code: Select all

//case this.swTypeVal == 3:{ //blinds
//              var blindService = new Service.WindowCovering(this.name);
//              blindService.getCharacteristic(Characteristic.CurrentPosition).on('get', this.getBlindStatus.bind(this));
//              blindService.getCharacteristic(Characteristic.TargetPosition).on('get', this.getBlindStatus.bind(this)).on('set', this.setBlindStatus.bind(this));
//              blindService.getCharacteristic(Characteristic.PositionState).on('get', this.getBlindPStatus.bind(this));
//              services.push(blindService);
//              break;
//            }

If using an IDE editor, this should begin at line 1114.