mrjackyliang / homebridge-adt-pulse

Homebridge security system platform for ADT Pulse
Apache License 2.0
35 stars 7 forks source link

Plugin reports "[ADT Pulse] An unknown error occurred." #122

Closed Danimal4326 closed 7 months ago

Danimal4326 commented 7 months ago

Describe the bug:

Keep getting "[ADT Pulse] An unknown error occurred." in logs. No sensors are on-line.

I'm able to arm and disarm the system, but all sensors are showing offline.

I made sure my Pulse gateway is online. ADT Pulse app is showing all sensors.

I verified login is corrected and re-generated token.

Modified line 1211 in index.js from:

this.logMessage('An unknown error occurred.', priority = 10);

to:

this.logMessage(`An unknown error occurred. ${error}`, priority = 10)

Log is now showing:

[12/13/2023, 7:39:21 PM] [ADT Pulse] An unknown error occurred. TypeError: Cannot read properties of undefined (reading 'getCharacteristic')

Not sure what to check next.

Steps to reproduce the bug:

  1. Just running the plugin

Expected behavior:

No error reported

The Apple device you are using:

Homebridge information:

[12/13/2023, 12:21:17 AM] [ADT Pulse] running on linux (x64)
[12/13/2023, 12:21:17 AM] [ADT Pulse] homebridge-adt-pulse v2.2.0
[12/13/2023, 12:21:17 AM] [ADT Pulse] node v18.17.1
[12/13/2023, 12:21:17 AM] [ADT Pulse] homebridge v1.7.0

Logs related to this bug:

[12/13/2023, 7:27:35 PM] [ADT Pulse] An unknown error occurred.
[12/13/2023, 7:27:38 PM] [ADT Pulse] An unknown error occurred.
[12/13/2023, 7:27:41 PM] [ADT Pulse] An unknown error occurred.
[12/13/2023, 7:27:59 PM] [ADT Pulse] An unknown error occurred.
[12/13/2023, 7:28:02 PM] [ADT Pulse] An unknown error occurred.
[12/13/2023, 7:28:05 PM] [ADT Pulse] An unknown error occurred.
Danimal4326 commented 7 months ago

Verbose logs:

[12/13/2023, 7:48:35 PM] [ADT Pulse] Restarting Process...
[12/13/2023, 7:48:35 PM] [ADT Pulse] Launched child bridge with PID 520195
[12/13/2023, 7:48:35 PM] Registering platform 'homebridge-adt-pulse.ADTPulse'
[12/13/2023, 7:48:35 PM] [ADT Pulse] Loaded homebridge-adt-pulse v2.2.0 child bridge successfully
[12/13/2023, 7:48:35 PM] Loaded 12 cached accessories from cachedAccessories.0EC4FEEA7D7E.
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Security Panel (system-1)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Basement Motion (sensor-4)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Living Room Motion (sensor-3)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Back Door (sensor-1)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Basement Door (sensor-14)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Basement Window Detector (sensor-6)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Bedroom Door (sensor-11)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Front Door (sensor-10)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Gas Detector (sensor-13)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Roof Door (sensor-5)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Upstairs Smoke Detector (sensor-12)
[12/13/2023, 7:48:35 PM] [ADT Pulse] Configuring cached accessory... Basement Motion (sensor-0)
[12/13/2023, 7:48:35 PM] [ADT Pulse] running on linux (x64)
[12/13/2023, 7:48:35 PM] [ADT Pulse] homebridge-adt-pulse v2.2.0
[12/13/2023, 7:48:35 PM] [ADT Pulse] node v20.10.0
[12/13/2023, 7:48:35 PM] [ADT Pulse] homebridge v1.7.0
[12/13/2023, 7:48:35 PM] Homebridge v1.7.0 (HAP v0.11.1) (ADT Pulse) is running on port 58771.
ADT Pulse: Logging in...
ADT Pulse: Response path -> /myhome/27.0.0-140/access/signin.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Web portal version -> 27.0.0-140
ADT Pulse: Response path -> /myhome/27.0.0-140/summary/summary.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Site ID -> 200310za694622
ADT Pulse: Login success.
[12/13/2023, 7:48:37 PM] [ADT Pulse] Web Portal version 27.0.0-140 detected. Test plugin to ensure system compatibility...
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518517177
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
ADT Pulse: Getting device status...
ADT Pulse: Response path -> /myhome/27.0.0-140/ajax/orb.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Get device status success.
ADT Pulse: Getting zone status...
ADT Pulse: Response path -> /myhome/27.0.0-140/ajax/orb.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Get zone status success.
[12/13/2023, 7:48:37 PM] [ADT Pulse] An unknown error occurred. TypeError: Cannot read properties of undefined (reading 'getCharacteristic')
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-12) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-5) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-13) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-10) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-11) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-6) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-14) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-1) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-3) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:37 PM] [ADT Pulse] Preparing to remove zone (sensor-4) accessory, but "removeObsoleteZones" is disabled...
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518518378
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
ADT Pulse: Getting device status...
ADT Pulse: Response path -> /myhome/27.0.0-140/ajax/orb.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Get device status success.
ADT Pulse: Getting zone status...
ADT Pulse: Response path -> /myhome/27.0.0-140/ajax/orb.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Get zone status success.
[12/13/2023, 7:48:38 PM] [ADT Pulse] Basement Motion (sensor-0) changed from "motion" to "no motion".
[12/13/2023, 7:48:38 PM] [ADT Pulse] An unknown error occurred. TypeError: Cannot read properties of undefined (reading 'getCharacteristic')
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-12) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-5) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-13) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-10) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-11) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-6) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-14) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-1) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-3) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:38 PM] [ADT Pulse] Preparing to remove zone (sensor-4) accessory, but "removeObsoleteZones" is disabled...
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518521392
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
ADT Pulse: Getting device status...
ADT Pulse: Response path -> /myhome/27.0.0-140/ajax/orb.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Get device status success.
ADT Pulse: Getting zone status...
ADT Pulse: Response path -> /myhome/27.0.0-140/ajax/orb.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Get zone status success.
[12/13/2023, 7:48:41 PM] [ADT Pulse] Basement Motion (sensor-0) changed from "motion" to "no motion".
[12/13/2023, 7:48:41 PM] [ADT Pulse] An unknown error occurred. TypeError: Cannot read properties of undefined (reading 'getCharacteristic')
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-12) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-5) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-13) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-10) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-11) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-6) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-14) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-1) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-3) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:41 PM] [ADT Pulse] Preparing to remove zone (sensor-4) accessory, but "removeObsoleteZones" is disabled...
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518524401
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
ADT Pulse: Getting device status...
ADT Pulse: Response path -> /myhome/27.0.0-140/ajax/orb.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Get device status success.
ADT Pulse: Getting zone status...
ADT Pulse: Response path -> /myhome/27.0.0-140/ajax/orb.jsp
ADT Pulse: Response path matches -> true
ADT Pulse: Get zone status success.
[12/13/2023, 7:48:44 PM] [ADT Pulse] Basement Motion (sensor-0) changed from "motion" to "no motion".
[12/13/2023, 7:48:44 PM] [ADT Pulse] An unknown error occurred. TypeError: Cannot read properties of undefined (reading 'getCharacteristic')
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-12) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-5) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-13) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-10) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-11) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-6) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-14) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-1) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-3) accessory, but "removeObsoleteZones" is disabled...
[12/13/2023, 7:48:44 PM] [ADT Pulse] Preparing to remove zone (sensor-4) accessory, but "removeObsoleteZones" is disabled...
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518527403
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518530395
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518533407
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518536400
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518539402
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
ADT Pulse: Performing portal sync...
ADT Pulse: Response path -> /myhome/27.0.0-140/Ajax/SyncCheckServ?t=1702518542405
ADT Pulse: Response path matches -> true
ADT Pulse: Portal sync success.
Danimal4326 commented 7 months ago

Tracked down the error to the ADTPulsePlatform.prototype.devicePolling function.

It's trying to set this up for a doorWindow type for sensor-0. Not sure what this is according to the pulse website, I have sensors 1,3,4,5,6,10,11,12,13,14

Danimal4326 commented 7 months ago

Some more info.. Printed out zoneStatus variable, and all sensors are getting id of 0:

[12/13/2023, 9:22:47 PM] [ADT Pulse] [
  {
    id: 'sensor-0',
    name: 'Back Door',
    tags: 'sensor,doorWindow',
    state: 'devStatOK'
  },
  {
    id: 'sensor-0',
    name: 'Basement Door',
    tags: 'sensor,doorWindow',
    state: 'devStatOK'
  },
  {
    id: 'sensor-0',
    name: 'Basement Motion',
    tags: 'sensor,motion',
    state: 'devStatOK'
  },
  {
    id: 'sensor-0',
    name: 'Basement Window Detector',
    tags: 'sensor,doorWindow',
    state: 'devStatOK'
  },
  {
    id: 'sensor-0',
    name: 'Bedroom Door',
    tags: 'sensor,doorWindow',
    state: 'devStatOK'
  },
  {
    id: 'sensor-0',
    name: 'Front Door',
    tags: 'sensor,doorWindow',
    state: 'devStatOK'
  },
  {
    id: 'sensor-0',
    name: 'Gas Detector',
    tags: 'sensor,co',
    state: 'devStatOK'
  },
  {
    id: 'sensor-0',
    name: 'Living Room Motion',
    tags: 'sensor,motion',
    state: 'devStatOK'
  },
  {
    id: 'sensor-0',
    name: 'Roof Door',
    tags: 'sensor,doorWindow',
    state: 'devStatOK'
  },
  {
    id: 'sensor-0',
    name: 'Upstairs Smoke Detector',
    tags: 'sensor,fire',
    state: 'devStatOK'
  }
]
mrjackyliang commented 7 months ago

The zero comes from lodash default when they can't find an ID. this is fixed in the upcoming new version. Closing for #98

mrjackyliang commented 7 months ago

If you have some time, can you try pulling the newest ts-rewrite branch and running the test-api.ts file?

https://github.com/mrjackyliang/homebridge-adt-pulse/tree/ts-rewrite

will post the new configs in a minute

mrjackyliang commented 7 months ago
{
  "platform": "ADTPulse",
  "name": "ADT Pulse",
  "subdomain": "portal",
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "fingerprint": "YOUR_FINGERPRINT",
  "sensors": [
    {
      "name": "SOME_SENSOR",
      "adtName": "WHATEVER IT IS NAMED BY ADT",
      "adtType": "fire",
      "adtZone": 1
    }
  ],
  "pause": false,
  "reset": false
}
mrjackyliang commented 7 months ago

you can leave the sensors part alone, don't delete it though!

github-actions[bot] commented 5 months ago

This issue is now locked and considered resolved due to inactivity.