jfarmer08 / homebridge-wyze-smart-home

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

Plugin reboots itself - MeshLight #232

Open orenschor opened 3 months ago

orenschor commented 3 months ago

Describe The Bug: Plugin reboots itself in a loop. This happens after changing light color to some of the lights from the Homekit app.

To Reproduce: From Homekit - change the color of the light. Some lights will cause the error and crash the plugin. When changing light colors from the Wyze app the problem stops. Not all colors crash the plugin.

Expected behavior: Changing colors from the homekit app will not cause Plugin to crash. Preferably all colors from Homekit will be supported. Logs:

[3/10/2024, 11:09:11 AM] [Wyze] Restarting Process...
[3/10/2024, 11:09:12 AM] [Wyze] Launched child bridge with PID 1XX5X
[3/10/2024, 11:09:12 AM] Registering platform 'homebridge-wyze-smart-home.WyzeSmartHome'
[3/10/2024, 11:09:12 AM] [Wyze] Loaded homebridge-wyze-smart-home v0.5.46 child bridge successfully
[3/10/2024, 11:09:12 AM] Loaded 3 cached accessories from cachedAccessories.XXXXXXXXX.
[3/10/2024, 11:09:12 AM] Homebridge v1.7.0 (HAP v0.11.1) (Wyze) is running on port 49212.
/homebridge/node_modules/homebridge-wyze-smart-home/node_modules/colorsys/colorsys.js:197
  return colorsys.rgb2Hsv(rgb.r, rgb.g, rgb.b)
                              ^
TypeError: Cannot read properties of null (reading 'r')
    at Object.colorsys.hex2Hsv (/homebridge/node_modules/homebridge-wyze-smart-home/node_modules/colorsys/colorsys.js:197:31)
    at WyzeMeshLight.updateColor (/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:104:31)
    at WyzeMeshLight.updateCharacteristics (/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:69:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/10/2024, 11:09:13 AM] [Wyze] Child bridge process ended
[3/10/2024, 11:09:13 AM] [Wyze] Process Ended. Code: 1, Signal: null

Plugin Config:

{
    "name": "Wyze",
    "username": "XXXX@gmail.com",
    "password": "XXXX",
    "keyId": "XXX",
    "apiKey": "XXX",
    "refreshInterval": 60000,
    "hms": false,
    "showAdvancedOptions": true,
    "apiLogEnabled": false,
    "pluginLoggingEnabled": false,
    "lowBatteryPercentage": 30,
    "excludeMacAddress": false,
    "filterByMacAddressList": [
        "XXX",
        "XXX"
    ],
    "excludedeviceType": true,
    "platform": "WyzeSmartHome",
    "_bridge": {
        "username": "XXXX",
        "port": 49212
    }
}

Screenshots:

Environment:

github-actions[bot] commented 3 months ago

Message that will be displayed on users' first issue