joe-ng / homebridge-dyson-link

MIT License
206 stars 40 forks source link

Homebridge crashes if I include the platform config #39

Open Sebastian1989101 opened 6 years ago

Sebastian1989101 commented 6 years ago

As soon as I attach the platform config to my home bridge it crashes.

Here is my config:

{
  "accessories" : [
    {
      "name" : "Pi Temp",
      "accessory" : "RaspberryPiTemperature"
    }
  ],
  "platforms": [
    {
      "platform": "DysonPlatform",
      "name": "DysonPlatform",
      "email": "my@mail.com",
      "password": "mypassword",
      "country": "DE",
      "accessories": [
        {
          "ip": "10.10.20.2",
          "displayName": "Dyson-PureCool",
          "serialNumber": "Vxx-EU-xxxxx80A",
          "sensitivity": 1,
          "nightModeVisible" : true,
          "focusModeVisible" : true
        }
      ]
    }
  ],
  "bridge" : {
    "username" : "11:22:33:44:55:66",
    "name" : "Homebridge",
    "pin" : "031-42-666",
    "port" : 9999
  }
}

And this is the exception I got:

/usr/local/lib/node_modules/homebridge/node_modules/mkdirp/index.js:90
                    throw err0;
                    ^

Error: ENOTDIR: not a directory, mkdir '/root/.homebridge/config.json/persist'
    at Object.fs.mkdirSync (fs.js:885:18)
    at Function.sync (/usr/local/lib/node_modules/homebridge/node_modules/mkdirp/index.js:71:13)
    at LocalStorage.parseDirSync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/local-storage.js:642:20)
    at LocalStorage.parseDataDirSync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/local-storage.js:572:21)
    at LocalStorage.initSync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/local-storage.js:145:14)
    at Object.nodePersist.initSync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/node-persist.js:41:29)
    at Object.init (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/index.js:31:13)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:24:7)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:643:30)

I installed everything through the Homebridge App and so far everything works fine. The config above is shortened only for the Dyson TP04 and filled with blind data (I'm using the correct data within my real config and currently I have about 30 devices in it).

joe-ng commented 6 years ago

the error was from homebridge itself so i would think this was related to how you set up homebridge as it seemed that it could not create a directory to save the persist state of device

Sebastian1989101 commented 6 years ago

@joe-ng well the homebridge was installed with the iOS homebridge app. 9 other Plugins run fine without any problem just this one will not start. The directory he wants to use does not make sense because it is impossible to exists. '/root/.homebridge/config.json' is my config file. So "config.json" cannot be a directory and a file at the same time. Therefor it is not possible to create the directoy at '/root/.homebridge/config.json/persist'.

Because all other tried plugins are working without a problem (I tried 17 plugins total and none of them had a problem. Currently there are 9 plugins running), I'm sure this is a fault of this plugin.

tkaudioservices commented 5 years ago

This exact thing happens for me too. Homebridge setup via the app. Was any progress made on this?