homebridge-plugins / homebridge-august

The Homebridge August plugin allows you to access your August/Yale Locks from HomeKit with Homebridge.
ISC License
36 stars 9 forks source link

Bug: [August] Discover Devices: TypeError: Cannot convert undefined or null to object #65

Closed dacarson closed 1 year ago

dacarson commented 1 year ago

Describe The Bug

Locks not functioning

To Reproduce

Install 2 August Door locks without Door Sense, make them available of WiFi. Installed this home bridge extension. Setup according to instructions. See issues as reported by https://github.com/donavanbecker/homebridge-august/issues/21, so set configuration for each lock as shown in bug report. Restart Homebridge.

Expected behavior

Extension not report errors, and locks are functional.

Relevant log output

7/24/2023, 10:20:56 PM] [August] Initializing August platform...
[7/24/2023, 10:20:56 PM] [August] [DEBUG] Using Config Logging: debug
[7/24/2023, 10:20:56 PM] [August] [DEBUG] Finished initializing platform: August
[7/24/2023, 10:20:56 PM] [August] Platform Config: {"logging":"debug"}
[7/24/2023, 10:20:56 PM] [August] [DEBUG] Using Default Refresh Rate (5 minutes).
[7/24/2023, 10:20:56 PM] [August] [DEBUG] Config OK
[7/24/2023, 10:20:56 PM] [August] [DEBUG] Loading accessory from cache: Garage Door
[7/24/2023, 10:20:56 PM] [August] [DEBUG] Loading accessory from cache: Front Door
[7/24/2023, 10:20:56 PM] [August] [DEBUG] Executed didFinishLaunching callback
[7/24/2023, 10:20:56 PM] [August] [DEBUG] augustId: xx@gmail.com, installId: xxxx, password: xxx, isValidated: true
[7/24/2023, 10:20:56 PM] [August] [DEBUG] August Credentials: {"config":{"apiKey":"79xxxx","pnSubKey":"sub-c-xxxx","installId":"xxxx","idType":"email","augustId":"xx@gmail.com","password":"xxx"}}
...
FetchError: Status 429 (undefined): undefined
[7/24/2023, 10:20:57 PM] [August] Discover Devices: TypeError: Cannot convert undefined or null to object

Config for homebridge-august

{
            "name": "August",
            "credentials": {
                "augustId": "xx@gmail.com",
                "password": "xxxx",
                "installId": "xxxx",
                "isValidated": true,
                "notice": "Keep your tokens a secret!"
            },
            "options": {
                "devices": [
                    {
                        "lockId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                        "configLockName": "Front Door",
                        "hide_device": false,
                        "lock": {
                            "hide_contactsensor": true
                        },
                        "logging": "debug"
                    },
                    {
                        "lockId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                        "configLockName": "Garage Door",
                        "hide_device": false,
                        "lock": {
                            "hide_contactsensor": true
                        },
                        "logging": "debug"
                    }
                ],
                "logging": "debug"
            },
            "platform": "August"

Screenshots

No response

Device & Model

AUG-SL04-M01-G04

Node.js Version

v18.16.0

NPM Version

9.6.3

Homebridge Version

v1.6.1

Homebridge August Plugin Version

1.2.0-beta.2

Homebridge Config UI X Plugin Version

v4.50.4

Operating System

Debian GNU/Linux Bullseye (11)

dacarson commented 1 year ago

Changing the code to log the entire stack trace, I see this:


FetchError: Status 429 (undefined): undefined
[7/24/2023, 10:48:38 PM] [August] Discover Devices: TypeError: Cannot convert undefined or null to object
[7/24/2023, 10:48:38 PM] [August] TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at August.details (/var/lib/homebridge/node_modules/homebridge-august/node_modules/august-api/src/methods/details.js:9:24)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at AugustPlatform.discoverDevices (/var/lib/homebridge/node_modules/homebridge-august/src/platform.ts:220:23)
dacarson commented 1 year ago

The FetchError seems to be coming from the August-API library: https://github.com/hufftheweevil/august-api/blob/ffcf2c51f0a8aedb86aa69c4d3a8412525eb1c56/src/index.js#L33

And HTTP status code '429' means that the plugin has hit the rate limit.

dacarson commented 1 year ago

Duplicate of https://github.com/hufftheweevil/august-api/issues/3