jfarmer08 / homebridge-wyze-smart-home

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

Cannot convert undefined or null to object #197

Closed verwirrrung closed 7 months ago

verwirrrung commented 7 months ago

Hello,

I Installed v0.5.37-alpha.7 and I am getting the below error in the logs, regardless if it's configured as a child-bridge or not. Tried downgrading to an older version - one version at a time - up to v0.5.34 and still the same issue.

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at WyzeLock.updateCharacteristics (/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeLock.js:62:31)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[11/17/2023, 4:14:16 PM] [Wyze] Child bridge process ended
[11/17/2023, 4:14:16 PM] [Wyze] Process Ended. Code: 1, Signal: null
[11/17/2023, 4:14:23 PM] [Wyze] Restarting Process...
[11/17/2023, 4:14:23 PM] [Wyze] Launched child bridge with PID 20169
[11/17/2023, 4:14:23 PM] Registering platform 'homebridge-wyze-smart-home.WyzeSmartHome'
[11/17/2023, 4:14:23 PM] [Wyze] Loaded homebridge-wyze-smart-home v0.5.37-alpha.7 child bridge successfully
[11/17/2023, 4:14:23 PM] Loaded 9 cached accessories from cachedAccessories.0E0D32432593.
[11/17/2023, 4:14:23 PM] Homebridge v1.7.0 (HAP v0.11.1) (Wyze) is running on port 42274.

/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeLock.js:62
      const prop_key = Object.keys(lockProperties)

Plugin Config:

{
    "bridge": {
        "name": "Homebridge",
        "username": "intentionally_changed",
        "port": 51924,
        "pin": "intentionally_changed",
        "advertiser": "bonjour-hap",
        "bind": [
            "eth0"
        ]
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "auth": "form",
            "theme": "dark-mode",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "name": "Wyze",
            "username": "intentionally_changed",
            "password": "intentionally_changed",
            "keyId": "intentionally_changed",
            "apiKey": "intentionally_changed",
            "refreshInterval": 60000,
            "hms": false,
            "showAdvancedOptions": true,
            "apiLogEnabled": false,
            "logLevel": "none",
            "lowBatteryPercentage": 30,
            "excludeMacAddress": false,
            "excludedeviceType": false,
            "platform": "WyzeSmartHome",
            "_bridge": {
                "username": "intentionally_changed",
                "port": 42274
            }
        }
    ]
}

Screenshots:

Environment:

github-actions[bot] commented 7 months ago

Message that will be displayed on users' first issue

jfarmer08 commented 7 months ago

Exclude your lock and then start it. After that you can to enable it again.

boothmusic commented 7 months ago

I'm having a very similar issue.

typeerror: Cannot read properties of null (reading 'r') at Object.colorsys.hex2Hsv (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/node_modules/colorsys/colorsys.js:197:31) at WyzeMeshLight.updateColor (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:71:31) at WyzeMeshLight.updateCharacteristics (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:52:18) at processTicksAndRejections (node:internal/process/task_queues:95:5)

"refreshInterval": 60000,
"hms": false,
"showAdvancedOptions": false,
"apiLogEnabled": false,
"logLevel": "none",
"lowBatteryPercentage": 30,
"excludeMacAddress": false,
"filterByMacAddressList": [

],
"excludedeviceType": false,
"filterDeviceTypeList": [
    "OutdoorPlug",
    "Plug",
    "ContactSensor",
    "MotionSensor",
    "Lock",
    "TemperatureHumidity",
    "LeakSensor",
    "Camera",
    "Common"
],
"platform": "WyzeSmartHome"

}

verwirrrung commented 7 months ago

Exclude your lock and then start it. After that you can to enable it again.

This seems to fix it. no more errors and the plugin stays running and not cycling back. I'll monitor and see if it comes back. Thanks.