naofireblade / homebridge-neato

A Neato vacuum robot plugin for homebridge.
MIT License
69 stars 18 forks source link

problems with config file. #10

Closed jodyw closed 6 years ago

jodyw commented 6 years ago

I am having problems with the config.json file. I have installed homebridge on iMac. I am getting the following error when starting homebridge with the config.json file listed at bottom.

[3/6/2018, 4:09:21 PM] Loaded plugin: homebridge-neato [3/6/2018, 4:09:21 PM] Registering platform 'homebridge-neato.NeatoVacuumRobot' [3/6/2018, 4:09:21 PM] --- [3/6/2018, 4:09:21 PM] Loaded config.json with 1 accessories and 1 platforms. [3/6/2018, 4:09:21 PM] --- [3/6/2018, 4:09:21 PM] Loading 1 platforms... [3/6/2018, 4:09:21 PM] [NeatoVacuumRobot] Initializing NeatoVacuumRobot platform... [3/6/2018, 4:09:21 PM] Loading 1 accessories... /usr/local/lib/node_modules/homebridge/lib/api.js:64 throw new Error("The requested accessory '" + name + "' was not registered by any plugin."); ^

Error: The requested accessory 'Neato' was not registered by any plugin. at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:264:42) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:86:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:662:30) at Object.Module._extensions..js (module.js:673:10) at Module.load (module.js:575:32) at tryModuleLoad (module.js:515:12) at Function.Module._load (module.js:507:3)

And this is the config.json file

{ "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 on$

"accessories": [
    {
        "accessory": "WeMo",
        "name": "Coffee Maker"
    }
],

"platforms": [
    {
        "platform": "NeatoVacuumRobot",
        "email": "my neato login",
        "password": "my neato password"
    }
]

}

I have tried changing the "accessories": block different ways. Not sure what is going on. Can you give any advise. Thanks.

naofireblade commented 6 years ago

That error looks strange. Do you have the most recent version of my plugin installed? Does your homebridge instance accesses the correct plugin folder?

jodyw commented 6 years ago

I did have the latest one. I found later that I had to remove the text after accessories and had it working for a while then it quit. Not that good with low level stuff so I have set it on the back burner.

On Apr 4, 2018, at 11:08 AM, Arne notifications@github.com wrote:

That error looks strange. Do you have the most recent version of my plugin installed? Does your homebridge instance accesses the correct plugin folder?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/naofireblade/homebridge-neato/issues/10#issuecomment-378634916, or mute the thread https://github.com/notifications/unsubscribe-auth/AMC4NtMda3J1lZniZx_yfvBjKKrR26VHks5tlOH5gaJpZM4Sfbl2.

RSVince76 commented 6 years ago

Good evening,

In my side i have this problem :

pi@raspberrypi:~/.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>
[4/18/2018, 9:19:31 PM] Loaded plugin: homebridge-neato
[4/18/2018, 9:19:31 PM] Registering platform 'homebridge-neato.NeatoVacuumRobot'
[4/18/2018, 9:19:31 PM] ---
[4/18/2018, 9:19:31 PM] There was a problem reading your config.json file.
[4/18/2018, 9:19:31 PM] Please try pasting your config.json file here to validate it: http://jsonlint.com
[4/18/2018, 9:19:31 PM] 
/usr/lib/node_modules/homebridge/lib/server.js:207
    throw err;
    ^

SyntaxError: Unexpected token : in JSON at position 11
    at JSON.parse (<anonymous>)
    at Server._loadConfig (/usr/lib/node_modules/homebridge/lib/server.js:201:19)
    at new Server (/usr/lib/node_modules/homebridge/lib/server.js:57:38)
    at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:26:16)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

And the config.json is :

"platforms": [{
        "platform": "https://neatorobotics.com/my-neato",
        "email": "xxxxxxxxxxxxxxx@gmail.com",
        "password": "xxxxxxxxxxxxx",
        "refresh": 60,
        "extraCareNavigation": true,
        "disabled": ["dock", "dockstate", "eco"]
    }]

Have you an idea about this problem?

Thank you in advance.

Vince

naofireblade commented 6 years ago

Hey, this is your only plugin right? The posted config is just the part for my plugin. In order to get homebridge working you need some basic config stuff. Here is a working example:

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

    "accessories": [],

    "platforms": [{
        "platform": "https://neatorobotics.com/my-neato",
        "email": "xxxxxxxxxxxxxxx@gmail.com",
        "password": "xxxxxxxxxxxxx",
        "refresh": 60,
        "extraCareNavigation": true,
        "disabled": ["dock", "dockstate", "eco"]
    }]
}