jfarmer08 / homebridge-wyze-smart-home

Wyze Smart Home plugin for Homebridge.
MIT License
94 stars 14 forks source link

Cannot read properties of undefined (reading 'device_id') #142

Closed sanchogeorgek closed 10 months ago

sanchogeorgek commented 10 months ago

Describe Your Problem: Running into errors starting the child bridge. Appears to be an issue reading a device list returned from Wyze.

Logs:

[8/19/2023, 12:08:58 AM] [Wyze] Launched child bridge with PID 1279
[8/19/2023, 12:08:59 AM] Registering platform 'homebridge-wyze-smart-home.WyzeSmartHome'
[8/19/2023, 12:08:59 AM] [Wyze] Loaded homebridge-wyze-smart-home v0.5.36 child bridge successfully
[8/19/2023, 12:08:59 AM] Loaded 3 cached accessories from cachedAccessories.0E16E98AD398.
[8/19/2023, 12:08:59 AM] [Wyze] Camera (Model: GW_BE1 (Mac: undefined (Name: undefined) not supported submit a request to https://github.com/jfarmer08/homebridge-wyze-smart-home/issues to have it added. If no issues are found
[8/19/2023, 12:08:59 AM] Homebridge v1.6.1 (HAP v0.11.1) (Wyze) is running on port 40914.
[8/19/2023, 12:09:00 AM] [Wyze] Camera (Model: GW_BE1 (Mac: GW_BE1_7C78B2A184F3 (Name: Foyer Doorbell) not supported submit a request to https://github.com/jfarmer08/homebridge-wyze-smart-home/issues to have it added. If no issues are found

/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeAccessory.js:529
        this.homeKitAccessory.context.device_params.hmsId = response.data[0].deviceList[0].device_id
                                                                                           ^
TypeError: Cannot read properties of undefined (reading 'device_id')
    at WyzeHMS.getHmsID (/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeAccessory.js:529:92)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at WyzeHMS.updateCharacteristics (/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeHMS.js:30:9)
    at WyzeHMS.update (/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeAccessory.js:326:7)
[8/19/2023, 12:09:00 AM] [Wyze] Child bridge process ended
[8/19/2023, 12:09:00 AM] [Wyze] Process Ended. Code: 1, Signal: null
[8/19/2023, 12:09:07 AM] [Wyze] Restarting Process...

Plugin Config:

        {
            "name": "Wyze",
            "username": "****@****.com",
            "password": "******",
            "keyId": "*****",
            "apiKey": "*****",
            "refreshInterval": 60000,
            "entryExitDelay": 30,
            "showAdvancedOptions": true,
            "logging": "none",
            "excludeMacAddress": false,
            "excludedeviceType": true,
            "filterDeviceTypeList": [
                "Camera"
            ],
            "_bridge": {
                "username": "0E:16:E9:8A:D3:98",
                "port": 40914
            },
            "platform": "WyzeSmartHome"
        }

Screenshots:

Environment:

github-actions[bot] commented 10 months ago

Message that will be displayed on users' first issue

jfarmer08 commented 10 months ago

Exclude S1Gateway. Looks like you don't pay for HMS

sanchogeorgek commented 10 months ago

Ah. I do have HMS sub but recently reset my sense hub and didn’t quite get to adding any security devices before using the plugin in homebridge.

sanchogeorgek commented 10 months ago

Closing issue.

Resolution: Exclude S1Gateway in plugin config as illustrated below or add at least one security device to sense home monitoring hub

"filterDeviceTypeList": [
                "S1Gateway"
            ]