bryan-bartow / homebridge-alarm.com

Alarm.com plugin for Homebridge
ISC License
43 stars 11 forks source link

TypeError: Cannot read property 'panel' of undefined #47

Closed jdshkolnik closed 7 years ago

jdshkolnik commented 7 years ago

Introduced by latest merge.

Initializing Alarmdotcom platform...
/usr/local/lib/node_modules/homebridge-alarmdotcom/index.js:71
            if(this.config.accessories.panel === true) { accessoryPromises.push(this.getSecuritySystemAccessories()) }
                                      ^

TypeError: Cannot read property 'panel' of undefined
    at ADCPlatform.accessories (/usr/local/lib/node_modules/homebridge-alarmdotcom/index.js:71:30)
    at Server._loadPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:354:20)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:298:16)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:80:36)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
hadolphs commented 7 years ago

I am having the same problem... spent hours trying to figure out if it was something in my install...

hadolphs commented 7 years ago

Problem resolved... you need to add the new piece to the config file under the platforms section for alarm.com.

"accessories": { "panel": true, "lights": false, "locks": true }

hadolphs commented 7 years ago

Also, just in case, after the upgrade I also had to "bookmark" in wrapapi the getviewstate api call.

livefeed commented 7 years ago

I am not seeing anything different after the update and config add.

[2/17/2017, 8:06:36 PM] [Security Panel] Error while getting lock devices: TypeError: Cannot read property 'map' of undefined [2/17/2017, 8:06:36 PM] [Security Panel] Initializing platform accessory 'Alarm.com Security Panel'...

hadolphs commented 7 years ago

that error is typically due to a problem in the config. what did you put in? Since I didn't really have any accessories but the panel I only had to add: "accessories": { "panel": true }

livefeed commented 7 years ago

I put in all three as I have the panel and a Lock (garage door) but the Garage Door is not showing up, should it now with this update and config update?

bryanbartow commented 7 years ago

@livefeed No, this update does not address that issue. It only allows you to conditionally use the various accessory devices.

bryanbartow commented 7 years ago

@jdshkolnik As @hadolphs mentioned, this change requires an update to the config file, as found in the readme.