seikan / homebridge-xiaomi-mi-robot-vacuum

XiaoMi Mi robot vacuum plugin for Homebridge.
Other
64 stars 8 forks source link

Errors when I add code to config.json #18

Closed bertybassett closed 6 years ago

bertybassett commented 6 years ago

I have this working in Home Assistant so I know the IP address and token are good but in Homebridge I get this error

Error: The requested accessory 'MiRobotVacuum' 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:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3

My config.json

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

    "accessories": [
        {
            "accessory": "MiRobotVacuum",
            "name": "Vacuum",
            "ip": "192.168.0.84",
            "token": "454c38796b586374534e6e6f50675171",
            "pause": false
        }
    ],

    "platforms": [
        {
            "platform": "HomeAssistant",
            "name": "HomeAssistant",
            "host": "http://192.168.0.22:8123",
            "password": "*******",
            "supported_types": [
                "binary_sensor",
                "climate",
                "cover",
                "device_tracker",
                "fan",
                "input_boolean",
                "light",
                "lock",
                "media_player",
                "remote",
                "script",
                "sensor",
                "switch",
                "vacuum"
            ],
            "default_visibility": "visible",
            "logging": false,
            "verify_ssl": true
        }
    ]
}
patwae commented 6 years ago

Hi, perhaps you can try this config (in my home it works):

{ "platform" : "MiRobotVacuumPlatform", "deviceCfgs" : [ { "ip" : "192.168.0.84", "token" : "xxx", "enablePauseToCharge" : true, "type" : "MiRobotVacuum", "robotVacuumName" : "Vacuum", "robotVacuumDisable" : false }

GBen88 commented 6 years ago

Try to use

sudo npm install -g miio@0.14.1

I had the same issue and now it's Ok.

bertybassett commented 6 years ago

sudo npm install -g miio@0.14.1 still same issue?

bertybassett commented 6 years ago

this fails? Isn't that from a different plugin? Not the plug in I am using?

{ "platform" : "MiRobotVacuumPlatform", "deviceCfgs" : [ { "ip" : "192.168.0.84", "token" : "xxx", "enablePauseToCharge" : true, "type" : "MiRobotVacuum", "robotVacuumName" : "Vacuum", "robotVacuumDisable" : false }

patwae commented 6 years ago

Did you test this config?

bertybassett commented 6 years ago

yes however the code appears wrong

"deviceCfgs" : [

where is the close bracket

ps thanks for the help so far.

patwae commented 6 years ago

Oh, my mistake...

{ "platform" : "MiRobotVacuumPlatform", "deviceCfgs" : [ { "ip" : "192.168.0.84", "token" : "xxx", "enablePauseToCharge" : true, "type" : "MiRobotVacuum", "robotVacuumName" : "Vacuum", "robotVacuumDisable" : false } ] }

patwae commented 6 years ago

Does it work?

bertybassett commented 6 years ago

same error

/usr/local/lib/node_modules/homebridge/lib/api.js:122
throw new Error("The requested platform '" + name + "' was not registered by any plugin.");
^
Error: The requested platform 'MiRobotVacuumPlatform' was not registered by any plugin.
at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:122:13)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:294:45)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:85:36)
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:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3

bertybassett commented 6 years ago

this worked full uninstall then npm install -g homebridge-xiaomi-mi-robot-vacuum miio@0.14.1

You can now close this thread.