SphtKr / homebridge-zway

Homebridge plugin for (better) HomeKit support of RaZBerry and Z-Way Server
ISC License
85 stars 37 forks source link

Show error message when authentication fails #60

Closed AlexMoskvin28 closed 7 years ago

AlexMoskvin28 commented 7 years ago

Hello!

Im using homebridge with Razberry and Z-Wave. When I run homebridge instance, i have got this error:

*** 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>
[10/26/2016, 2:17:40 PM] Loaded plugin: homebridge-zway
[10/26/2016, 2:17:40 PM] Registering accessory 'homebridge-zway.ZWayServer'
[10/26/2016, 2:17:40 PM] Registering platform 'homebridge-zway.ZWayServer'
[10/26/2016, 2:17:40 PM] ---
[10/26/2016, 2:17:40 PM] Loaded config.json with 1 accessories and 1 platforms.
[10/26/2016, 2:17:40 PM] ---
[10/26/2016, 2:17:40 PM] Loading 1 platforms...
[10/26/2016, 2:17:40 PM] Initializing ZWayServer platform...
[10/26/2016, 2:17:41 PM] Loading 1 accessories...
[10/26/2016, 2:17:41 PM] [HomeBridgeZWay] Initializing ZWayServer accessory...
/usr/lib/node_modules/homebridge-zway/index.js:393
  this.log      = platform.log;
                          ^

TypeError: Cannot read property 'log' of undefined
    at Object.ZWayServerAccessory (/usr/lib/node_modules/homebridge-zway/index.js:393:27)
    at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:262:29)
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:78:38)
    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:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)

My config.json is:

{
        "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",

 "accessories": [{
        "accessory": "ZWayServer",
        "name": "HomeBridgeZWay"
        }
     ],

    "platforms": [
        {
            "platform" : "ZWayServer",
            "url": "http://127.0.0.1:8083/",
            "login": "[admin]",
            "password": "[password]"
        }
    ]
}

I hope, you can help me resolve this problem. Thank you.

SphtKr commented 7 years ago

Hello, you should only define ZWayServer in the platforms section of config.json. You should not need an accessories section at all if Z-Way is your only Homebridge plugin. The ZWayServer platform adds all of its managed accessories on its own. I think this is your issue, let me know if it does or does not resolve your problem.

AlexMoskvin28 commented 7 years ago

Yes, when i configured homebridge in first time, i defined only platforms section. And it worked, i saw accessory with Apple HomeKatalog application. But when i run homebridge in second time, i didn't saw any accessories with HomeKatalog application. Output in console was that:

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>
[10/28/2016, 10:34:18 AM] Loaded plugin: homebridge-zway
[10/28/2016, 10:34:18 AM] Registering accessory 'homebridge-zway.ZWayServer'
[10/28/2016, 10:34:18 AM] Registering platform 'homebridge-zway.ZWayServer'
[10/28/2016, 10:34:18 AM] ---
[10/28/2016, 10:34:18 AM] Loaded config.json with 0 accessories and 1 platforms.
[10/28/2016, 10:34:18 AM] ---
[10/28/2016, 10:34:18 AM] Loading 1 platforms...
[10/28/2016, 10:34:18 AM] Initializing ZWayServer platform...
pi@raspberrypi ~ $ 

But i remember, that this log was more informative in first time launch(at least, it had a PIN). So, yes, when i don't define accessories, it works, but i have got another problem. Can you help me with this one?

AlexMoskvin28 commented 7 years ago

Sorry, i find where i make a mistake: a use incorrect password in config file. Thank you for help.

SphtKr commented 7 years ago

Glad you got it. Hmm. I should probably do something more helpful in the case authentication fails. Noted.