snOOrz / homebridge-aqara

HomeBridge plugin for Aqara gateway and devices
541 stars 73 forks source link

TypeError: Cannot read property 'sid' of null #21

Closed acrueda closed 7 years ago

acrueda commented 7 years ago

Hello, can someone help me with this error.

Thank you

/usr/lib/node_modules/homebridge-aqara/lib/AqaraPlatform.js:62 var sid = config['sid']; ^

TypeError: Cannot read property 'sid' of null

config.json

{ "platform": "AqaraPlatform", "sid": ["zzzzzzzzzzzzzz"], "password": ["xxxxxxxxxx"] },

snOOrz commented 7 years ago

Can you please paste the full text of config.json?

On 14 Dec 2016, 17:18 +0800, acrueda notifications@github.com, wrote:

Hello, can someone help me with this error.

Thank you

/usr/lib/node_modules/homebridge-aqara/lib/AqaraPlatform.js:62 var sid = config['sid']; ^

TypeError: Cannot read property 'sid' of null

config.json

{ "platform": "AqaraPlatform", "sid": ["zzzzzzzzzzzzzz"], "password": ["xxxxxxxxxx"] },

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/snOOrz/homebridge-aqara/issues/21, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ATm2YRVXGuzWLAxPB6dgUFz2gCCJoOkIks5rH7RjgaJpZM4LMsbC.

acrueda commented 7 years ago

Thank you

{ "bridge":{ "name":"Homebridge", "username":"CC:FF:3D:E3:CE:50", "port":51826, "pin":"031-55-354" }, "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":"MagicHome", "name":"tira salon", "ip":"172.16.0.160", "setup":"RGBWW", "purewhite":false }, { "accessory":"TemperatureCMD", "name":"Dormitorio Julio", "command":"/usr/bin/python /home/pi/scripts/RmTemp.py | cut -d ',' -f 2" }, { "accessory":"TemperatureCMD", "name":"Sensor A1 Tempe", "command":"/usr/bin/python /home/pi/scripts/BroadA1.py" }, { "accessory":"HumidityCMD", "name":"Sensor A1 Humi", "command":"/usr/bin/python /home/pi/scripts/BroadA1Humi.py" }, { "accessory":"OpenweathermapTemperature", "name":"Exterior", "url":"http://api.openweathermap.org/data/2.5/weather?q=Maracena,ES&APPID=3442726412ed4d7a5e656bdf47239657" }, { "accessory":"people", "name":"Ocupacion", "people":[ { "name":"Antonio", "target":"172.16.0.30" }, { "name":"Rocio", "target":"172.16.0.31" } ], "threshold":5 } ], "platforms":[ { "platform": "HarmonyHub", "name": "Harmony Hub" },

  {
    "platform": "AqaraPlatform",
    "sid": ["zzzzzzzzzzzz"],
    "password": ["zzzzzzzzzzz"]
  },

  {
     "platform": "Orvibo"
  },

  {
    "platform": "yeelight"
    "name": "yeelight"
  },

  {
     "platform":"Camera-ffmpeg",
     "cameras":[
        {
           "name":"Camera Garaje",
           "videoConfig":{
              "source":"-re -i rtsp://172.16.0.110:554/live.sdp",
              "stillImageSource":"-i http://172.16.0.110/cgi-bin/video.jpg",
              "maxStreams":2,
              "maxWidth":640,
              "maxHeight":480,
              "maxFPS":25
           }
        }
     ]
  },
  {
     "platform":"MiLight",
     "name":"MiLight",
     "bridges":[
        {
           "ip_address":"172.16.0.161",
           "type":"white",
           "zones":[
              "Living Room",
              "Dining Room"
           ],
           "repeat":1
        }
     ]
  },
  {
     "platform":"cmdSwitch2",
     "switches":[
        {
           "name":"Rejilla Julio",
           "on_cmd":"/home/pi/scripts/RejiOpen.sh",
           "off_cmd":"/home/pi/scripts/RejiClose.sh",
           "state_cmd":"cat /home/pi/scripts/status/flagRej.txt | grep -i 'on'"
        },
        {
           "name":"Aire Acondicionado",
           "on_cmd":"/home/pi/scripts/AC-ON.sh",
           "off_cmd":"/home/pi/scripts/AC-OFF.sh",
           "state_cmd":"cat /home/pi/scripts/status/flagAC.txt | grep -i 'on'"
        }
     ]
  }

] }

acrueda commented 7 years ago

Error mio sorry I miss one "," Thank you very much for your time everything working perfect

derekhuangxu commented 7 years ago

@acrueda whitch "," you missed in the config file?