node-alarm-dot-com / homebridge-node-alarm-dot-com

Alarm.com plugin for Homebridge using Node.js
MIT License
58 stars 23 forks source link

TypeError: Cannot read property 'ARMED_STAY' of undefined #54

Closed alex-taffe closed 3 years ago

alex-taffe commented 3 years ago

Describe the bug

When running this plugin, after making any adjustment or on startup, I receive the following:

[12/01/2021, 11:56:23] [Security System] Error: Failed to change partition state: TypeError: Cannot read property 'ARMED_STAY' of undefined
    at getPartitionState (/usr/lib/node_modules/homebridge-node-alarm-dot-com/index.js:1291:32)
    at ADCPlatform.statPartitionState (/usr/lib/node_modules/homebridge-node-alarm-dot-com/index.js:435:19)
    at /usr/lib/node_modules/homebridge-node-alarm-dot-com/index.js:524:31
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
[12/01/2021, 11:56:24] [Security System] TypeError: Cannot read property 'ARMED_STAY' of undefined
    at getPartitionState (/usr/lib/node_modules/homebridge-node-alarm-dot-com/index.js:1291:32)
    at ADCPlatform.statPartitionState (/usr/lib/node_modules/homebridge-node-alarm-dot-com/index.js:435:19)
    at /usr/lib/node_modules/homebridge-node-alarm-dot-com/index.js:273:20
    at Array.forEach (<anonymous>)
    at /usr/lib/node_modules/homebridge-node-alarm-dot-com/index.js:268:31
    at Array.forEach (<anonymous>)
    at /usr/lib/node_modules/homebridge-node-alarm-dot-com/index.js:265:22
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

After performing any action in the Home app, the panel receives the command, but the app continually seems to think the device is offline.

To Reproduce Occurs on startup

Expected behavior No errors

Screenshots

N/A

ADC-SystemStates.json

[{"id":3919811,"attributes":{"description":"Taffe","hasSnapShotCameras":false,"supportsSecureArming":true,"remainingImageQuota":0,"systemGroupName":"","unitId":93882512},"partitions":[{"id":"93882512-127","type":"devices/partition","attributes":{"partitionId":1,"state":1,"desiredState":1,"extendedArmingOptions":{"Disarmed":[],"ArmedStay":[2,1,0],"ArmedAway":[2,1],"ArmedNight":[]},"invalidExtendedArmingOptions":{"Disarmed":[],"ArmedStay":[],"ArmedAway":[],"ArmedNight":[]},"needsClearIssuesPrompt":false,"canEnableAlexa":false,"isAlexaEnabled":false,"managedDeviceType":8,"canBeRenamed":true,"canAccessWebSettings":true,"canAccessAppSettings":true,"webSettings":1002,"hasState":true,"canBeDeleted":false,"macAddress":"","manufacturer":"","isOAuth":false,"isZWave":false,"isMalfunctioning":false,"canBeSaved":true,"canChangeDescription":true,"description":"Panel","deviceModelId":6778,"canConfirmStateChange":true,"canReceiveCommands":true,"remoteCommandsEnabled":true,"hasPermissionToChangeState":true,"deviceIcon":{"icon":184},"batteryLevelNull":null,"lowBattery":false,"criticalBattery":false},"relationships":{"sensors":{"data":[{"id":"93882512-5","type":"devices/sensor"},{"id":"93882512-6","type":"devices/sensor"},{"id":"93882512-4","type":"devices/sensor"},{"id":"93882512-1","type":"devices/sensor"},{"id":"93882512-3","type":"devices/sensor"},{"id":"93882512-8","type":"devices/sensor"}],"meta":{"count":"6"}},"system":{"data":{"id":"3919811","type":"systems/system"}},"stateInfo":{"data":{"id":"93882512-127-4","type":"devices/state-info"}}}}],"sensors":[{"id":"93882512-5","type":"devices/sensor","attributes":{"deviceType":1,"openClosedStatus":2,"state":1,"isFlexIO":false,"deviceRole":0,"stateText":"Closed","isMonitoringEnabled":true,"managedDeviceType":9,"hasState":true,"canBeRenamed":true,"canBeDeleted":false,"canAccessWebSettings":true,"canAccessAppSettings":false,"webSettings":400,"macAddress":"","manufacturer":"","isOAuth":false,"isZWave":false,"isMalfunctioning":false,"canBeSaved":true,"canChangeDescription":true,"description":"Family Room Door Left","deviceModelId":5053,"canConfirmStateChange":true,"canReceiveCommands":false,"remoteCommandsEnabled":true,"hasPermissionToChangeState":true,"deviceIcon":{"icon":317},"batteryLevelNull":null,"lowBattery":false,"criticalBattery":false},"relationships":{"system":{"data":{"id":"3919811","type":"systems/system"}},"stateInfo":{"data":null}}},{"id":"93882512-6","type":"devices/sensor","attributes":{"deviceType":1,"openClosedStatus":2,"state":1,"isFlexIO":false,"deviceRole":0,"stateText":"Closed","isMonitoringEnabled":true,"managedDeviceType":9,"hasState":true,"canBeRenamed":true,"canBeDeleted":false,"canAccessWebSettings":true,"canAccessAppSettings":false,"webSettings":400,"macAddress":"","manufacturer":"","isOAuth":false,"isZWave":false,"isMalfunctioning":false,"canBeSaved":true,"canChangeDescription":true,"description":"Family Room Door Right","deviceModelId":5053,"canConfirmStateChange":true,"canReceiveCommands":false,"remoteCommandsEnabled":true,"hasPermissionToChangeState":true,"deviceIcon":{"icon":317},"batteryLevelNull":null,"lowBattery":false,"criticalBattery":false},"relationships":{"system":{"data":{"id":"3919811","type":"systems/system"}},"stateInfo":{"data":null}}},{"id":"93882512-4","type":"devices/sensor","attributes":{"deviceType":1,"openClosedStatus":2,"state":1,"isFlexIO":false,"deviceRole":0,"stateText":"Closed","isMonitoringEnabled":true,"managedDeviceType":9,"hasState":true,"canBeRenamed":true,"canBeDeleted":false,"canAccessWebSettings":true,"canAccessAppSettings":false,"webSettings":400,"macAddress":"","manufacturer":"","isOAuth":false,"isZWave":false,"isMalfunctioning":false,"canBeSaved":true,"canChangeDescription":true,"description":"Front Door","deviceModelId":5053,"canConfirmStateChange":true,"canReceiveCommands":false,"remoteCommandsEnabled":true,"hasPermissionToChangeState":true,"deviceIcon":{"icon":317},"batteryLevelNull":null,"lowBattery":false,"criticalBattery":false},"relationships":{"system":{"data":{"id":"3919811","type":"systems/system"}},"stateInfo":{"data":null}}},{"id":"93882512-1","type":"devices/sensor","attributes":{"deviceType":1,"openClosedStatus":2,"state":1,"isFlexIO":false,"deviceRole":0,"stateText":"Closed","isMonitoringEnabled":true,"managedDeviceType":9,"hasState":true,"canBeRenamed":true,"canBeDeleted":false,"canAccessWebSettings":true,"canAccessAppSettings":false,"webSettings":400,"macAddress":"","manufacturer":"","isOAuth":false,"isZWave":false,"isMalfunctioning":false,"canBeSaved":true,"canChangeDescription":true,"description":"Garage Door","deviceModelId":5053,"canConfirmStateChange":true,"canReceiveCommands":false,"remoteCommandsEnabled":true,"hasPermissionToChangeState":true,"deviceIcon":{"icon":317},"batteryLevelNull":null,"lowBattery":false,"criticalBattery":false},"relationships":{"system":{"data":{"id":"3919811","type":"systems/system"}},"stateInfo":{"data":null}}},{"id":"93882512-3","type":"devices/sensor","attributes":{"deviceType":2,"openClosedStatus":3,"state":4,"isFlexIO":false,"deviceRole":0,"stateText":"Activated","isMonitoringEnabled":true,"managedDeviceType":9,"hasState":true,"canBeRenamed":true,"canBeDeleted":false,"canAccessWebSettings":true,"canAccessAppSettings":false,"webSettings":400,"macAddress":"","manufacturer":"","isOAuth":false,"isZWave":false,"isMalfunctioning":false,"canBeSaved":true,"canChangeDescription":true,"description":"Motion Detector","deviceModelId":5053,"canConfirmStateChange":true,"canReceiveCommands":false,"remoteCommandsEnabled":true,"hasPermissionToChangeState":true,"deviceIcon":{"icon":317},"batteryLevelNull":null,"lowBattery":false,"criticalBattery":false},"relationships":{"system":{"data":{"id":"3919811","type":"systems/system"}},"stateInfo":{"data":null}}},{"id":"93882512-8","type":"devices/sensor","attributes":{"deviceType":5,"openClosedStatus":2,"state":1,"isFlexIO":false,"deviceRole":0,"stateText":"Not Reset","isMonitoringEnabled":false,"managedDeviceType":2,"hasState":false,"canBeRenamed":true,"canBeDeleted":false,"canAccessWebSettings":true,"canAccessAppSettings":false,"webSettings":400,"macAddress":"","manufacturer":"","isOAuth":false,"isZWave":false,"isMalfunctioning":false,"canBeSaved":true,"canChangeDescription":true,"description":"Second Floor Smoke","deviceModelId":5053,"canConfirmStateChange":true,"canReceiveCommands":false,"remoteCommandsEnabled":true,"hasPermissionToChangeState":true,"deviceIcon":{"icon":218},"batteryLevelNull":null,"lowBattery":false,"criticalBattery":false},"relationships":{"system":{"data":{"id":"3919811","type":"systems/system"}},"stateInfo":{"data":null}}}],"lights":[],"locks":[],"garages":[],"relationships":{"partitions":{"data":[{"id":"93882512-127","type":"devices/partition"}],"meta":{"count":"1"}},"locks":{"data":[],"meta":{"count":"0"}},"accessControlAccessPointDevices":{"data":[],"meta":{"count":"0"}},"cameras":{"data":[],"meta":{"count":"0"}},"sdCardCameras":{"data":[],"meta":{"count":"0"}},"garageDoors":{"data":[],"meta":{"count":"0"}},"waterValves":{"data":[],"meta":{"count":"0"}},"scenes":{"data":[{"id":"2906005","type":"automation/scene"},{"id":"2906006","type":"automation/scene"},{"id":"2906007","type":"automation/scene"},{"id":"2906008","type":"automation/scene"}],"meta":{"count":"4"}},"sensors":{"data":[{"id":"93882512-5","type":"devices/sensor"},{"id":"93882512-6","type":"devices/sensor"},{"id":"93882512-4","type":"devices/sensor"},{"id":"93882512-1","type":"devices/sensor"},{"id":"93882512-3","type":"devices/sensor"},{"id":"93882512-8","type":"devices/sensor"}],"meta":{"count":"6"}},"waterSensors":{"data":[],"meta":{"count":"0"}},"sumpPumps":{"data":[],"meta":{"count":"0"}},"waterMeters":{"data":[],"meta":{"count":"0"}},"lights":{"data":[],"meta":{"count":"0"}},"x10Lights":{"data":[],"meta":{"count":"0"}},"smartChimeDevices":{"data":[],"meta":{"count":"0"}},"thermostats":{"data":[],"meta":{"count":"0"}},"remoteTemperatureSensors":{"data":[],"meta":{"count":"0"}},"commercialTemperatureSensors":{"data":[],"meta":{"count":"0"}},"valveSwitches":{"data":[],"meta":{"count":"0"}},"boilerControlSystem":{"data":null},"geoDevices":{"data":[{"id":"93882512-2200","type":"geolocation/geo-device"},{"id":"93882512-2201","type":"geolocation/geo-device"},{"id":"93882512-2202","type":"geolocation/geo-device"},{"id":"93882512-2203","type":"geolocation/geo-device"}],"meta":{"count":"4"}},"fences":{"data":[{"id":"246205","type":"geolocation/fence"}],"meta":{"count":"1"}},"imageSensors":{"data":[],"meta":{"count":"0"}},"configuration":{"data":{"id":"3919811","type":"systems/configuration"}},"shades":{"data":[],"meta":{"count":"0"}},"gates":{"data":[],"meta":{"count":"0"}},"switches":{"data":[],"meta":{"count":"0"}}}}]

Homebridge System (please complete the following information):

Additional context

chase9 commented 3 years ago

What version of homebridge-node-alarm-dot-com are you running? I'm seeing this with the beta version I'm testing right now. You can see by running this from your supervisor: npm -g list homebridge-node-alarm-dot-com

alex-taffe commented 3 years ago

@chase9 v1.6.5

chase9 commented 3 years ago

Sorry for the trouble, Alex. This was caused by me pushing the wrong package to npm. I pushed a new package and things should be fixed if you either reinstall the package or run npm -g install node-alarm-dot-com@latest.

Please let me know if this fixes the problem for you.

alex-taffe commented 3 years ago

Working now, thanks @chase9 !!