hjdhjd / homebridge-ratgdo

🚗 non-myQ Liftmaster, Chamberlain, and Ratgdo Plugin for Homebridge
Other
100 stars 2 forks source link

Crash - TypeError: Cannot read properties of undefined (reading 'length') #22

Closed seer14 closed 1 month ago

seer14 commented 1 month ago

Homebridge Ratgdo

v2.3.3

Homebridge Platform and OS

LXC Container on Proxmox host

Homebridge Version

v1.8.4

Node Version

v20.16.0

Ratgdo ESPHome Firmware Version

v2024.9.1

Describe the problem

Just got around to flashing and installing ESPHome on my Ratgdo and trying to connect it to HomeBridge via this plugin.

I get the following "Crash - TypeError: Cannot read properties of undefined (reading 'length')" error and crash

[9/30/2024, 8:50:25 AM] [Ratgdo] Restarting Process... [9/30/2024, 8:50:25 AM] [Ratgdo] Launched child bridge with PID 265954 [9/30/2024, 8:50:25 AM] Registering platform 'homebridge-ratgdo.Ratgdo' [9/30/2024, 8:50:25 AM] [Ratgdo] Loaded homebridge-ratgdo v2.3.3 child bridge successfully [9/30/2024, 8:50:25 AM] Loaded 1 cached accessories from cachedAccessories.0E44065233C7. [9/30/2024, 8:50:25 AM] Homebridge v1.8.4 (HAP v0.12.2) (Ratgdo) is running on port 45863. [9/30/2024, 8:50:25 AM]

NOTICE TO USERS AND PLUGIN DEVELOPERS

Homebridge 2.0 is on the way and brings some breaking changes to existing plugins. Please visit the following link to learn more about the changes and how to prepare: https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[9/30/2024, 8:50:25 AM] [Ratgdo] Discovered: ratgdov2.5i f9e528 (address: 192.168.1.195 mac: 083A8DF9E528 ESPHome firmware: v2024.9.1). [9/30/2024, 8:50:25 AM] [Ratgdo] Configuring: ratgdov2.5i f9e528 (address: 192.168.1.195 mac: 083A8DF9E528 ESPHome firmware: v2024.9.1). TypeError: Cannot read properties of undefined (reading 'length') at RatgdoAccessory.get name [as name] (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-device.ts:1296:13) at RatgdoAccessory.configureGarageDoor (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-device.ts:264:102) at RatgdoAccessory.configureDevice (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-device.ts:107:10) at new RatgdoAccessory (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-device.ts:95:10) at RatgdoPlatform.configureGdo (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-platform.ts:389:36) at RatgdoPlatform.discoverRatgdoDevice (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-platform.ts:137:34) at Browser.emit (node:events:519:28) at Browser.addService (/var/lib/homebridge/node_modules/homebridge-ratgdo/node_modules/bonjour-service/src/lib/browser.ts:140:14) at /var/lib/homebridge/node_modules/homebridge-ratgdo/node_modules/bonjour-service/src/lib/browser.ts:111:26 at Array.forEach () [9/30/2024, 8:50:25 AM] [Ratgdo] Child bridge process ended [9/30/2024, 8:50:25 AM] [Ratgdo] Process Ended. Code: 1, Signal: null [9/30/2024, 8:50:32 AM] [Ratgdo] Restarting Process...

Homebridge HBR JSON configuration

{
    "bridge": {
        "name": "Homebridge 5588",
        "username": "0E:09:C8:53:55:88",
        "port": 51744,
        "pin": "669-64-636",
        "advertiser": "avahi"
    },
    "accessories": [
        {
            "name": "Pihole",
            "auth": “xxx”,
            "ssl": false,
            "rejectUnauthorized": false,
            "host": "192.168.1.xxx”,
            "port": 80,
            "baseDirectory": "/admin/",
            "time": 0,
            "reversed": false,
            "logLevel": 2,
            "accessory": "Pihole"
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "refreshToken": “xxx”,
            "unbridgeCameras": true,
            "platform": "Ring"
        },
        {
            "name": "Nest",
            "googleAuth": {
                "issueToken": “yyy”,
                "cookies": “xxx”
            },
            "structureId": "9b4aa980-8b0f-11e5-92bb-22000b78903e",
            "platform": "Nest"
        },
        {
            "googleAuth": {
                "issueToken": “y”yy,
                "cookies": “xxx”
            },
            "options": {
                "ffmpegCodec": "libx264",
                "streamQuality": 3,
                "alertCheckRate": 10,
                "alertCooldownRate": 180,
                "alertTypes": [
                    "Motion",
                    "Sound",
                    "Person",
                    "Package Delivered",
                    "Package Retrieved",
                    "Face",
                    "Zone"
                ],
                "importantOnly": true,
                "motionDetection": false,
                "streamingSwitch": true,
                "chimeSwitch": false,
                "announcementsSwitch": false,
                "doorbellAlerts": false,
                "doorbellSwitch": false,
                "audioSwitch": true
            },
            "platform": "Nest-cam"
        },
        {
            "password": {
                "md5": “xxx”
            },
            "valves": [
                {
                    "name": "Front-sidewalk",
                    "defaultDuration": 1200
                },
                {
                    "name": "Front-middle",
                    "defaultDuration": 1200
                },
                {
                    "name": "Front-house",
                    "defaultDuration": 1200
                },
                {
                    "name": "Front-Flowerbed",
                    "defaultDuration": 1200
                },
                {
                    "name": "NW Side of Front",
                    "defaultDuration": 1200
                },
                {
                    "name": "Back-East",
                    "defaultDuration": 1200
                },
                {
                    "name": "Back-West",
                    "defaultDuration": 1200
                },
                {
                    "name": "Back-AlleyArbor",
                    "defaultDuration": 1200
                }
            ],
            "host": “xxx”,
            "pollInterval": 15,
            "rainDelay": 24,
            "_bridge": {
                "username": "0E:F9:24:BC:65:70",
                "port": 43465
            },
            "platform": "HomebridgeOpenSprinklerApi"
        },
        {
            "name": "ADT Pulse",
            "subdomain": "portal",
            "username": “yyy”,
            "password": “xxx”,
            "fingerprint": “xxx”,
            "mode": "normal",
            "speed": 1,
            "options": [],
            "sensors": [
                {
                    "name": "Front Door",
                    "adtName": "Front Door",
                    "adtType": "doorWindow",
                    "adtZone": 10
                },
                {
                    "name": "Garage Door",
                    "adtName": "Garage Door",
                    "adtType": "doorWindow",
                    "adtZone": 11
                },
                {
                    "name": "Laundry Room Door",
                    "adtName": "Laundry Room Door",
                    "adtType": "doorWindow",
                    "adtZone": 12
                },
                {
                    "name": "Back Door",
                    "adtName": "Back Door",
                    "adtType": "doorWindow",
                    "adtZone": 13
                },
                {
                    "name": "Dining Glass Detector",
                    "adtName": "Dining Glass Detector",
                    "adtType": "glass",
                    "adtZone": 14
                },
                {
                    "name": "Kitchen Glass Detector",
                    "adtName": "Kitchen Glass Detector",
                    "adtType": "glass",
                    "adtZone": 15
                },
                {
                    "name": "Hall Smoke Detector",
                    "adtName": "Hall Smoke Detector",
                    "adtType": "fire",
                    "adtZone": 16
                },
                {
                    "name": "Kids Room Glass Detector",
                    "adtName": "Front Bedroom Detector",
                    "adtType": "glass",
                    "adtZone": 17
                },
                {
                    "name": "Office Glass Detector",
                    "adtName": "Middle Bedroom Detector",
                    "adtType": "glass",
                    "adtZone": 18
                },
                {
                    "name": "Master Bedroom Glass Detector",
                    "adtName": "Master Bedroom Detector",
                    "adtType": "glass",
                    "adtZone": 19
                },
                {
                    "name": "Master Bathroom Window",
                    "adtName": "Master Bathroom Window",
                    "adtType": "doorWindow",
                    "adtZone": 20
                },
                {
                    "name": "Bathroom Window",
                    "adtName": "Bathroom Window",
                    "adtType": "doorWindow",
                    "adtZone": 21
                }
            ],
            "_bridge": {
                "username": "0E:23:57:0A:08:FF",
                "port": 52271
            },
            "platform": "ADTPulse"
        },
        {
            "name": "TuyaWebPlatform",
            "options": {
                "username": “yyy”,
                "password": “xxx”,
                "countryCode": "1",
                "platform": "tuya"
            },
            "defaults": [
                {
                    "id": "eb96219c0a51e86e79zttk",
                    "device_type": "outlet"
                },
                {
                    "id": "eb1f5858a346b472b1shxa",
                    "device_type": "light"
                },
                {
                    "id": "eb1d8efe9258d1e09brnz8",
                    "device_type": "light"
                },
                {
                    "id": "ebc3f406fcef8055805kxh",
                    "device_type": "light"
                }
            ],
            "scenes": false,
            "_bridge": {
                "username": "0E:66:AD:06:96:95",
                "port": 32593
            },
            "platform": "TuyaWebPlatform"
        },
        {
            "name": "Ratgdo",
            "options": [
                "Disable.Motion"
            ],
            "_bridge": {
                "username": "0E:44:06:52:33:C7"
            },
            "platform": "Ratgdo"
        }
    ],
    "disabledPlugins": [
        "homebridge-myq",
        "homebridge-opensprinkler-api"
    ]
}

Relevant log output

[9/30/2024, 8:50:25 AM] [Ratgdo] Discovered: ratgdov2.5i f9e528 (address: 192.168.1.195 mac: 083A8DF9E528 ESPHome firmware: v2024.9.1).
[9/30/2024, 8:50:25 AM] [Ratgdo] Configuring: ratgdov2.5i f9e528 (address: 192.168.1.195 mac: 083A8DF9E528 ESPHome firmware: v2024.9.1).
TypeError: Cannot read properties of undefined (reading 'length')
    at RatgdoAccessory.get name [as name] (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-device.ts:1296:13)
    at RatgdoAccessory.configureGarageDoor (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-device.ts:264:102)
    at RatgdoAccessory.configureDevice (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-device.ts:107:10)
    at new RatgdoAccessory (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-device.ts:95:10)
    at RatgdoPlatform.configureGdo (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-platform.ts:389:36)
    at RatgdoPlatform.discoverRatgdoDevice (file:///var/lib/homebridge/node_modules/homebridge-ratgdo/src/ratgdo-platform.ts:137:34)
    at Browser.emit (node:events:519:28)
    at Browser.addService (/var/lib/homebridge/node_modules/homebridge-ratgdo/node_modules/bonjour-service/src/lib/browser.ts:140:14)
    at /var/lib/homebridge/node_modules/homebridge-ratgdo/node_modules/bonjour-service/src/lib/browser.ts:111:26
    at Array.forEach (<anonymous>)

Acknowledgment that you are only running non-beta firmware releases from Apple, ESPHome, or Ratgdo

hjdhjd commented 1 month ago

Thanks for raising the issue. Sorry about that! Should be addressed in v2.4.0 that I just released. Can you give that a try?

seer14 commented 1 month ago

No worries. I didn't anticipate a fix so quickly so i sought alternatives :)  and instead used the ratgdo for HomeKit installer and was able to get this working and installed.

I have the "case"/ "holster" on order to give the Ratgdo a bit more protection where it is mounted. When the "holster" comes in and I have to manipulate the device, I'll see if I can re-flash at that time and give you some feedback. 

Thanks again for the quick response. 

Cheers,

Sean 

---- On Mon, 30 Sep 2024 15:10:58 -0500 hjdhjd @.***> wrote ---

Thanks for raising the issue. Sorry about that! Should be addressed in v2.4.0 that I just released. Can you give that a try?

— Reply to this email directly, https://github.com/hjdhjd/homebridge-ratgdo/issues/22#issuecomment-2384059411, or https://github.com/notifications/unsubscribe-auth/ATTPXMISZUABKGJ5STB4M63ZZGV5FAVCNFSM6AAAAABPDMLZHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBUGA2TSNBRGE. You are receiving this because you authored the thread.

hjdhjd commented 1 month ago

Enjoy. It’s also a terrific solution, depending on your needs.

github-actions[bot] commented 1 month ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.