jfarmer08 / homebridge-wyze-smart-home

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

Wyze Bridge started crrashing 0.5.26 #99

Closed rcbeamer closed 1 year ago

rcbeamer commented 1 year ago

Describe The Bug: 0.5.24 Bridge started crashing. I had just installed Homebridge for the first time, Just installed this plugin the day before, it was running fine, could GET and SET status of devices. Next day bridge stopped working (error message below).

I have since downgraded to version 0.5.24 and the bridge is running. I can GET status of Wyze devices, but I cannot SET status anymore.

To Reproduce: not really that kind of error.

Expected behavior: Bridge not crash, SET status device (where allowed by Wyze parent permissions e.g. allowed to lock doors but not unlock doors with Siri)

Logs:

[5/8/2023, 12:09:25 PM] [Wyze] Launched child bridge with PID 18498 [5/8/2023, 12:09:25 PM] Registering platform 'homebridge-wyze-smart-home.WyzeSmartHome' [5/8/2023, 12:09:25 PM] [Wyze] Loaded homebridge-wyze-smart-home v0.5.26 child bridge successfully [5/8/2023, 12:09:25 PM] Loaded 4 cached accessories from cachedAccessories.0ECAE4E9E45A. [5/8/2023, 12:09:25 PM] Homebridge v1.6.1 (HAP v0.11.1) (Wyze) is running on port 53516.

/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeAccessory.js:384 const prop_key = Object.keys(lockProperties) ^ TypeError: Cannot convert undefined or null to object at Function.keys () at WyzeLock.lockGetProperty (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeAccessory.js:384:29) at processTicksAndRejections (node:internal/process/task_queues:95:5) [5/8/2023, 12:09:26 PM] [Wyze] Child bridge process ended [5/8/2023, 12:09:26 PM] [Wyze] Process Ended. Code: 1, Signal: null [5/8/2023, 12:09:33 PM] [Wyze] Restarting Process... Plugin Config:

        {
            "name": "Wyze",
            "username": "[email redacted]",
            "password": "[pw redacted]",
            "refreshInterval": 60000,
            "entryExitDelay": 30,
            "showAdvancedOptions": false,
            "excludeMacAddress": false,
            "excludedeviceType": false,
            "platform": "WyzeSmartHome",
            "_bridge": {
                "username": "[coded username redacted]",
                "port": 53516
            }

Screenshots:

Environment:

github-actions[bot] commented 1 year ago

Message that will be displayed on users' first issue

chris001 commented 1 year ago

New user of homebridge and this homebridge-wyze-smart-home plugin. Version 0.5.26. Same crash bug as @rcbeamer
From the Status page, the Homebridge Logs:

/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeAccessory.js:422
    const prop_keypad = Object.keys(lockKeypadProperties)
                               ^
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at WyzeLock.lockGetProperty (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeAccessory.js:422:32)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[6/13/2023, 5:19:51 AM] [Wyze] Child bridge process ended
[6/13/2023, 5:19:51 AM] [Wyze] Process Ended. Code: 1, Signal: null
[6/13/2023, 5:19:58 AM] [Wyze] Restarting Process...
[6/13/2023, 5:20:00 AM] [Wyze] Launched child bridge with PID 4532
[6/13/2023, 5:20:01 AM] Registering platform 'homebridge-wyze-smart-home.WyzeSmartHome'
[6/13/2023, 5:20:01 AM] [Wyze] Loaded homebridge-wyze-smart-home v0.5.26 child bridge successfully
[6/13/2023, 5:20:01 AM] Loaded 15 cached accessories from cachedAccessories.0E69AE9E1C7C.
[6/13/2023, 5:20:01 AM] Homebridge v1.6.1 (HAP v0.11.1) (Wyze) is running on port 46785.

Does the plugin code assume, because there's a Wyze Lock, there's also the Lock Keypad? The Lock Keypad's optional!

rcbeamer commented 1 year ago

I have a keypad for each lock, had one all along.On another note. I found homebridge to be extremely unreliable in general and have since stopped using it. I wont be able to assist in troubleshooting this issue. Sent from my iPadOn Jun 13, 2023, at 1:26 AM, Chris Coleman @.***> wrote: New user of homebridge and this homebridge-wyze-smart-home plugin. Version 0.5.26. Same crash bug as @rcbeamer From the Status page, the Homebridge Logs: /var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeAccessory.js:422 const prop_keypad = Object.keys(lockKeypadProperties) ^ TypeError: Cannot convert undefined or null to object at Function.keys () at WyzeLock.lockGetProperty (/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/accessories/WyzeAccessory.js:422:32) at processTicksAndRejections (node:internal/process/task_queues:95:5) [6/13/2023, 5:19:51 AM] [Wyze] Child bridge process ended [6/13/2023, 5:19:51 AM] [Wyze] Process Ended. Code: 1, Signal: null [6/13/2023, 5:19:58 AM] [Wyze] Restarting Process... [6/13/2023, 5:20:00 AM] [Wyze] Launched child bridge with PID 4532 [6/13/2023, 5:20:01 AM] Registering platform 'homebridge-wyze-smart-home.WyzeSmartHome' [6/13/2023, 5:20:01 AM] [Wyze] Loaded homebridge-wyze-smart-home v0.5.26 child bridge successfully [6/13/2023, 5:20:01 AM] Loaded 15 cached accessories from cachedAccessories.0E69AE9E1C7C. [6/13/2023, 5:20:01 AM] Homebridge v1.6.1 (HAP v0.11.1) (Wyze) is running on port 46785.

Does the plugin code assume, because there's a Wyze Lock, there's also the Lock Keypad? The Lock Keypad's optional!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

chris001 commented 1 year ago

I found the solution! The wyze plugin in this exact repo where we are now, has the bug currently. However, a user has forked this repo, fixed this bug in their fork, and published it in homebridge plugins! How to get the working version? Install "Homebridge Wyze Smart Home" by zswuwing How?

  1. Login to your Homebridge, then click Plugins.
  2. Click on the search bar.
  3. Type homebridge wyze smart home
  4. Hit Enter.
  5. Next to this non-working plugin: homebridge wyze plugin by @jfarmer08 dated 2023-03-24, Click on 🔧 (wrench = Settings). Click Disable to disable this non-working plugin.
  6. Next to the working plugin: homebridge wyze plugin by [@zswuwing](https://www.npmjs.com/~zswuwing), click Install.
  7. The working plugin should automatically use your Wyze username/password, 2FA code, from the non-working plugin.
  8. To add your Wyze devices to your Home app:
  9. Next to the plugin, click on the 🔧 (wrench).
  10. Click Bridge Settings
  11. Open Home app on your Apple device (iPhone for example).
  12. In your Home app, tap + (add device)
  13. Use your iPhone camera to scan the QR code (block pattern) on the Bridge Settings page.
  14. Follow the prompts in Apple Home app, as it discovers and adds each Wyze device.
  15. All of your Wyze devices will add to your Apple Home app! Enjoy!