ilcato / homebridge-Fibaro-HC2

Homebridge plugin for Fibaro Home Center 2 (and Home Center Lite ...)
Apache License 2.0
65 stars 27 forks source link

Version 0.6.6 - TypeError: Cannot read property 'host' of null #12

Closed lboue closed 8 years ago

lboue commented 8 years ago

Hello,

I am trying to use the latest version of this plugin on my Ubuntu PC.

npm install -g homebridge-fibaro-hc2

But when I start homebridge I am getting a TypeError: "Cannot read property 'host' of null "

homebridge
*** WARNING *** The program 'nodejs' 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=nodejs>
*** WARNING *** The program 'nodejs' 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=nodejs&f=DNSServiceRegister>
[2016-06-29 19:46:01] Warning: skipping plugin found at '/usr/local/lib/node_modules/homebridge-fibaro-hc2' since we already loaded the same plugin from '/usr/lib/node_modules/homebridge-fibaro-hc2'.
[2016-06-29 19:46:01] Loaded plugin: homebridge-fibaro-hc2
[2016-06-29 19:46:01] Registering platform 'homebridge-fibaro-hc2.FibaroHC2'
[2016-06-29 19:46:01] ---
Load homebridge-fibaro-hc2.FibaroHC2
/usr/lib/node_modules/homebridge-fibaro-hc2/index.js:80
      this.fibaroClient = require('./lib/fibaro-api').createClient(config["host"], config["username"], config["password"]);
                                                                         ^

TypeError: Cannot read property 'host' of null
    at new FibaroHC2Platform (/usr/lib/node_modules/homebridge-fibaro-hc2/index.js:80:71)
    at Server._loadDynamicPlatforms (/usr/lib/node_modules/homebridge/lib/server.js:294:30)
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:73:8)
    at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)

Can you tell me what is wrong with my setup?

Other version

I addition I don't have this error with the 0.5.4 version.

ubuntu@ubuntu:/media/ubuntu/SD/homebridge$ sudo npm install -g homebridge-fibaro-hc2@0.5.4
/usr/lib
└─┬ homebridge-fibaro-hc2@0.5.4
  └─┬ request@2.72.0
    ├── aws-sign2@0.6.0
    ├── aws4@1.4.1
    ├─┬ bl@1.1.2
    │ └─┬ readable-stream@2.0.6
    │   ├── core-util-is@1.0.2
    │   ├── inherits@2.0.1
    │   ├── isarray@1.0.0
    │   ├── process-nextick-args@1.0.7
    │   ├── string_decoder@0.10.31
    │   └── util-deprecate@1.0.2
    ├── caseless@0.11.0
    ├─┬ combined-stream@1.0.5
    │ └── delayed-stream@1.0.0
    ├── extend@3.0.0
    ├── forever-agent@0.6.1
    ├─┬ form-data@1.0.0-rc4
    │ └── async@1.5.2
    ├─┬ har-validator@2.0.6
    │ ├─┬ chalk@1.1.3
    │ │ ├── ansi-styles@2.2.1
    │ │ ├── escape-string-regexp@1.0.5
    │ │ ├─┬ has-ansi@2.0.0
    │ │ │ └── ansi-regex@2.0.0
    │ │ ├── strip-ansi@3.0.1
    │ │ └── supports-color@2.0.0
    │ ├─┬ commander@2.9.0
    │ │ └── graceful-readlink@1.0.1
    │ ├─┬ is-my-json-valid@2.13.1
    │ │ ├── generate-function@2.0.0
    │ │ ├─┬ generate-object-property@1.2.0
    │ │ │ └── is-property@1.0.2
    │ │ ├── jsonpointer@2.0.0
    │ │ └── xtend@4.0.1
    │ └─┬ pinkie-promise@2.0.1
    │   └── pinkie@2.0.4
    ├─┬ hawk@3.1.3
    │ ├── boom@2.10.1
    │ ├── cryptiles@2.0.5
    │ ├── hoek@2.16.3
    │ └── sntp@1.0.9
    ├─┬ http-signature@1.1.1
    │ ├── assert-plus@0.2.0
    │ ├─┬ jsprim@1.3.0
    │ │ ├── extsprintf@1.0.2
    │ │ ├── json-schema@0.2.2
    │ │ └── verror@1.3.6
    │ └─┬ sshpk@1.8.3
    │   ├── asn1@0.2.3
    │   ├── assert-plus@1.0.0
    │   ├─┬ dashdash@1.14.0
    │   │ └── assert-plus@1.0.0
    │   ├── ecc-jsbn@0.1.1
    │   ├─┬ getpass@0.1.6
    │   │ └── assert-plus@1.0.0
    │   ├── jodid25519@1.0.2
    │   ├── jsbn@0.1.0
    │   └── tweetnacl@0.13.3
    ├── is-typedarray@1.0.0
    ├── isstream@0.1.2
    ├── json-stringify-safe@5.0.1
    ├─┬ mime-types@2.1.11
    │ └── mime-db@1.23.0
    ├── node-uuid@1.4.7
    ├── oauth-sign@0.8.2
    ├── qs@6.1.0
    ├── stringstream@0.0.5
    ├── tough-cookie@2.2.2
    └── tunnel-agent@0.4.3

ubuntu@ubuntu:/media/ubuntu/SD/homebridge$
ubuntu@ubuntu:/media/ubuntu/SD/homebridge$
ubuntu@ubuntu:/media/ubuntu/SD/homebridge$ homebridge
*** WARNING *** The program 'nodejs' 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=nodejs>
*** WARNING *** The program 'nodejs' 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=nodejs&f=DNSServiceRegister>
[2016-06-29 20:16:07] Warning: skipping plugin found at '/usr/local/lib/node_modules/homebridge-fibaro-hc2' since we already loaded the same plugin from '/usr/lib/node_modules/homebridge-fibaro-hc2'.
[2016-06-29 20:16:07] Loaded plugin: homebridge-fibaro-hc2
[2016-06-29 20:16:07] Registering platform 'homebridge-fibaro-hc2.FibaroHC2'
[2016-06-29 20:16:07] ---
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

    ┌────────────┐    
    │ 031-45-154 │    
    └────────────┘    

[2016-06-29 20:16:07] Homebridge is running on port 51826.

Regards,

ilcato commented 8 years ago

It seems that the plugin is not able to read the config.json file. Which version of homebridge are you using?

lboue commented 8 years ago

I attached the config.json.txt file to this comment. I can't find a syntax error. Maybe you will.

I used 0.6.6 for the first test and then the 0.5.4 version

ilcato commented 8 years ago

Which version of homebridge are you using (not the version of the Fibaro plugin)?

lboue commented 8 years ago

Hello,

I am testing homebridge@0.3.4 with homebridge-fibaro-hc2@0.6.6. I attached my install script:homebridge-HC2-install.txt

ilcato commented 8 years ago

is your config.json in .homebridge ?

lboue commented 8 years ago

Is was not but in a SD card. Now with a config.json file in .homebridge it works. Thanks for your help.