joe-ng / homebridge-dyson-link

MIT License
206 stars 40 forks source link

Dyson Link Plugin not intiating in homebridge instead giving error. #75

Open TheHomekitWayFinder opened 5 years ago

TheHomekitWayFinder commented 5 years ago

i have added the homebridge-dyson-link plugin to homebridge and have set up my device with the details in the config.json file however the plugin dosent discover the device and also gives an error to do with a line of code in the aps.js file as part of the plugin.

Here is my config.json file: (code below) { "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "847-63-982" },

"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": [
{
    "ip": "192.168.x.xxx",
    "displayName": "Fan",
    "serialNumber": "DYSON-xxx-AU-xxxxxxxx-475",
    "password": "xxxxxxx"
}
],

"platforms": [
{
    "platform": "DysonPlatform",
    "name": "Dyson"

    }

    ]

}

Here is the error that homebridge is giving me: (Code Below) [1/18/2019, 7:21:30 PM] Loading 1 platforms... [1/18/2019, 7:21:30 PM] [Dyson] Initializing DysonPlatform platform... [1/18/2019, 7:21:30 PM] Loading 1 accessories... /usr/local/lib/node_modules/homebridge/lib/api.js:50 if (name.IndexOf('.') == -1) { ^

TypeError: Cannot read property 'IndexOf' of undefined
at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:50:12)
at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:286:42)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:87:38)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:45:10)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)`

Any help would be very much appreciated. Thanks

joe-ng commented 5 years ago

you need to put accessories inside platforms pls check the sample - https://github.com/joe-ng/homebridge-dyson-link/blob/master/config-sample.json for details