-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wyze crash loop after changing colors via homekit #251
Comments
Message that will be displayed on users' first issue |
I'm having the same issue, I haven't been able to get the plugin working since. Have you been able to find a workaround? |
I've stopped the crashloop by adding this code to the
Logging I added indicates the string |
There was a bug where we try to pass the string "undefi" into the colorsys hex2Hsv method. The library does not handle this gracefully and it results in the error ``` 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) ``` Here we add a check to the updateCharacteristics method (alongside two others that already existed) to ignore this invalid value rather than trying to act on it. In my local testing the ability to set colors was not impacted as logging seems to indicate a valid color is later provided for the same device. See: jfarmer08#251
There was a bug where we try to pass the string "undefi" into the colorsys hex2Hsv method. The library does not handle this gracefully and it results in the error ``` 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) ``` Here we add a check to the updateCharacteristics method (alongside two others that already existed) to ignore this invalid value rather than trying to act on it. In my local testing the ability to set colors was not impacted as logging seems to indicate a valid color is later provided for the same device. See: jfarmer08#251
This fixed the crashing for me. I can set the color in the Home app with no problem, but when I ask Siri to set the color it "acts" as if it did, but nothing happens. |
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:
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
The text was updated successfully, but these errors were encountered: