jfarmer08 / homebridge-wyze-smart-home

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

Wyze crash loop after changing colors via homekit #251

Open funesgg opened 3 weeks ago

funesgg commented 3 weeks ago

Describe The Bug: Whenever i use the homekit to change the colors of the wyze bulbs the lights will instead turn green and the plugin will crash causing homebridge to loop. Changing the color manually in the wyze app causes the loop to end and the lights turn on and off as expected but the color changes crash the plugin.

To Reproduce: Ask siri or use home app to change the color of the wyze bulbs.

Expected behavior: The colors should change to correct color without causing the homebridge service to go into a loop

Logs:

[06/06/2024, 19:00:05] 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:104:31)
    at WyzeMeshLight.updateCharacteristics (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:69:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 19:00:06] 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:104:31)
    at WyzeMeshLight.updateCharacteristics (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:69:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 19:00:06] 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:104:31)
    at WyzeMeshLight.updateCharacteristics (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:69:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 19:00:05] Got SIGTERM, shutting down Homebridge...
[06/06/2024, 19:00:10] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[06/06/2024, 19:00:15] [HB Supervisor] Restarting Homebridge...
[06/06/2024, 19:00:15] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
[06/06/2024, 19:00:15] [HB Supervisor] Started Homebridge v1.8.2 with PID: 4205
[06/06/2024, 19:00:26] Loaded config.json with 0 accessories and 4 platforms.
[06/06/2024, 19:00:27] Loaded 7 cached accessories from cachedAccessories.
[06/06/2024, 19:00:27] ---
[06/06/2024, 19:00:28] Loaded plugin: homebridge-lifx-plugin@0.3.0
[06/06/2024, 19:00:28] Registering platform 'homebridge-lifx-plugin.LifxPlugin'
[06/06/2024, 19:00:28] ---
[06/06/2024, 19:00:29] Loaded plugin: homebridge-wiz-lan@3.2.8
[06/06/2024, 19:00:29] Registering platform 'homebridge-wiz-lan.WizSmarthome'
[06/06/2024, 19:00:29] ---
[06/06/2024, 19:00:29] Loaded plugin: homebridge-wyze-smart-home@0.5.46
[06/06/2024, 19:00:31] Registering platform 'homebridge-wyze-smart-home.WyzeSmartHome'
[06/06/2024, 19:00:31] ---
[06/06/2024, 19:00:31] Loading 4 platforms...
[06/06/2024, 19:00:31] [Wyze] Initializing WyzeSmartHome platform...
[06/06/2024, 19:00:31] [Lifx Plugin] Initializing LifxPlugin platform...
[06/06/2024, 19:00:31] [WizSmarthome] Initializing WizSmarthome platform...
[06/06/2024, 19:00:31] [WizSmarthome] [Refresh] Pings are off
[06/06/2024, 19:00:31] [WizSmarthome] Loading accessory from cache: Wiz RGB Bulb 444f8e808948
[06/06/2024, 19:00:31] [WizSmarthome] Loading accessory from cache: Wiz RGB Bulb 444f8e8142a2
[06/06/2024, 19:00:31] [WizSmarthome] [Socket] Setting up socket on        
[06/06/2024, 19:00:32] [WizSmarthome] [Discovery] Sending discovery UDP broadcast to 
[06/06/2024, 19:00:32] [WizSmarthome] Updating accessory: Wiz RGB Bulb 444f8e808948
[06/06/2024, 19:00:33] Homebridge v1.8.2 (HAP v0.12.1) (Homebridge 441D) is running on port 51377.
[06/06/2024, 19:00:35] [WizSmarthome] Updating accessory: Wiz RGB Bulb 444f8e8142a2
[06/06/2024, 19:01:20] [Homebridge UI] [funesg] Accessory layout changes saved.
[06/06/2024, 19:03:03] [Homebridge UI] [funesg] Accessory layout changes saved.
[06/06/2024, 19:03:42] 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:104:31)
    at WyzeMeshLight.updateCharacteristics (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:69:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 19:03:42] Got SIGTERM, shutting down Homebridge...
[06/06/2024, 19:03:42] 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:104:31)
    at WyzeMeshLight.updateCharacteristics (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:69:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 19:03:42] 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:104:31)
    at WyzeMeshLight.updateCharacteristics (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeMeshLight.js:69:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 19:03:47] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[06/06/2024, 19:03:52] [HB Supervisor] Restarting Homebridge...
[06/06/2024, 19:03:52] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution

Plugin Config:

"bridge": { "name": "Homebridge 441D", "username": "", "port": , "pin": ", "advertiser": "avahi" }, "accessories": [], "platforms": [ { "name": "Config", "port": 8581, "platform": "config" }, { "name": "Wyze", "username": "password": "keyId": "apiKey": "refreshInterval": 60000, "hms": false, "showAdvancedOptions": false, "apiLogEnabled": false, "pluginLoggingEnabled": false, "lowBatteryPercentage": 30, "excludeMacAddress": false, "excludedeviceType": false, "platform": "WyzeSmartHome" }, { "name": "Lifx Plugin", "duration": 0, "brightnessDuration": 300, "colorDuration": 300, "default": "0.0.0.0", "broadcast": "lightOfflineTolerance": 3, "messageHandlerTimeout": 45000, "resendPacketDelay": 150, "resendMaxTimes": 3, "updates": true, "debug": false, "autoDiscover": true, "platform": "LifxPlugin" }, { "name": "WizSmarthome", "enableScenes": false, "lastStatus": false, "broadcast": "", "refreshInterval": 0, "platform": "WizSmarthome" } ] }

Environment:

Plugin Version v0.5.46

github-actions[bot] commented 3 weeks ago

Message that will be displayed on users' first issue