dkerr64/homebridge-yolink

TypeError kills process

NicholasB60 opened this issue · 4 comments

Describe The Bug:
Consistently seeing errors in Homebridge after updating to 1.4.1

To Reproduce:
Update to 1.4.1, restart Homebridge with configured yolink plugin

Expected behavior:
Error doesn't cause child bridge to restart

Logs:

[11/23/2023, 4:36:34 PM] [YoLink] MQTT subscribed: yl-home/f<token_removed>/+/report
TypeError: Cannot read properties of undefined (reading 'updateCharacteristic')
at /usr/lib/node_modules/homebridge-yolink/src/contactDevice.ts:61:26
at runNextTicks (node:internal/process/task_queues:60:5)
at listOnTimeout (node:internal/timers:540:9)
at processTimers (node:internal/timers:514:7)
[11/23/2023, 4:36:35 PM] [YoLink] Child bridge process ended
[11/23/2023, 4:36:35 PM] [YoLink] Process Ended. Code: 1, Signal: null
[11/23/2023, 4:36:42 PM] [YoLink] Restarting Process...
[11/23/2023, 4:36:43 PM] [YoLink] Launched child bridge with PID 27872
[11/23/2023, 4:36:43 PM] Registering platform 'homebridge-yolink.YoLink'
[11/23/2023, 4:36:43 PM] [YoLink] Loaded homebridge-yolink v1.4.1 child bridge successfully
[11/23/2023, 4:36:43 PM] Loaded 2 cached accessories from cachedAccessories.0E83AA37DE28.
[11/23/2023, 4:36:43 PM] [YoLink] YoLink plugin for HomeBridge version 1.4.1 (c) 2022 David A. Kerr
Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues

Plugin Config:

 "name": "YoLink",
            "platform": "YoLink",
            "tokenURL": "https://api.yosmart.com/open/yolink/token",
            "apiURL": "https://api.yosmart.com/open/yolink/v2/api",
            "mqttPort": 8003,
            "userAccessId": “removed”,
            "secretKey": “removed”,
            "refreshAfter": 3600,
            "verboseLog": false,
            "liteLog": true,
            "allDevices": true,
            "excludeTypes": [
                "Hub"
            ],
            "enableExperimental": false,
            "devices": [
                {
                    "deviceId": “-“,
                    "config": {
                        "hide": "true",
                        "name": "Pool Temperature",
                        "refreshAfter": 1800
                    }
                },
                {
                    "deviceId": “-“,
                    "config": {
                        "name": "Benton Weather",
                        "refreshAfter": 1800
                    }
                },
                {
                    "deviceId": “-“,
                    "config": {
                        "name": "Gate"
                    }
                }
            ],
            "_bridge": {
                "username": “-“,
                "port": 31641
            }
        }
    ],

Screenshots:

Environment:

  • Plugin Version: 1.4.1
  • Homebridge Version: 1.7.0
  • Node.js Version: 20.9.0
  • NPM Version: 10.1.0
  • Operating System: Raspbian GNU/Linux Bullseye (11)

Thanks for reporting. I see the problem, will fix asap.

Please try v1.4.2 that I just published. I believe that fixes this problem. Sorry for the bug, I had to make many changes because of new rate limits YoLink have on their servers. This was a copy/paste that went bad !!

Thanks for reporting it.

Ran all night and haven't seen the error again. Thanks for the quick fix!

Thanks for reporting the error and confirming the fix.