jfarmer08 / homebridge-wyze-smart-home

Wyze Smart Home plugin for Homebridge.
MIT License
103 stars 17 forks source link

Lock status doesn't update if manually unlocked/locked or unlocked/locked in Wyze app. #135

Closed xenonaxel closed 10 months ago

xenonaxel commented 1 year ago

Describe The Bug: When I unlock/lock the Wyze Lock from the Wyze app or manually Homekit does not reflect the change unless I refresh and I do not get a notification

To Reproduce: I tried it as a child bridge and not and still see the same results.

Expected behavior: I should receive a notification when I manually unlock/lock or within the app. I lurked around and found this plugin. This exhibits the expected behavior but it no longer works due to the API creds. https://github.com/RMCob/homebridge-wyze-connected-home-op

Logs:

There are no logs from the Wyze plugin from when I unlock/lock via app or manually.

Plugin Config:

    {
        "name": "Wyze",
        "username": "john.smith@gmail.com",
        "password": "password",
        "keyId": " api",
        "apiKey": "api",
        "refreshInterval": 60000,
        "entryExitDelay": 30,
        "showAdvancedOptions": true,
        "logging": "debug",
        "excludeMacAddress": false,
        "excludedeviceType": true,
        "filterDeviceTypeList": [
            "Camera"
        ],
        "platform": "WyzeSmartHome",
        "_bridge": {
            "username": "mac",
            "port": 23423
        }
    },

Screenshots:

Environment:

xenonaxel commented 1 year ago

Update. It will notify me. About 10-15 min after I lock/unlock it manually or through the wyze app. Is there a way to update the polling requests on the status for the lock and contact sensor?

VonSquid commented 1 year ago

Same for me. And when controlling Wyze Lock via the Home app, the lock will change state just fine, but displays the Unlocking... or Locking... transitory status until the app is refreshed.

IMG_6054

carTloyal123 commented 1 year ago

@xenonaxel would you try to change your plugin configuration refresh interval from 60000 to 3000 and then see how it responds? This may be a refresh interval problem or possibly an api update of some kind that hasn't been addressed yet. Might also be an updated homebridge api under the hood or something. This one should be easy to debug.

carTloyal123 commented 1 year ago

@VonSquid please try the above as well if you can by changing the refresh interval to something quite small about 3000 or so.

xenonaxel commented 1 year ago

@carTloyal123 Hey, I changed it to 3000. In the logs it looks like it queries the API more frequently but the status still doesn't update for quite some time. When I get home today I can grab the logs and upload them. The contact sensor that also gets created doesn't appear to ever change either.

carTloyal123 commented 1 year ago

Yeah the full log would be great here and we can assess once the logs are in. I have a wyze lock and haven't had issues thus far so I am curious whats going on here

VonSquid commented 1 year ago

I've tried various refresh intervals, including 3000. Currently have it set to 10000. The stuck status problem seems less prevalent now, but overall operation is still inconsistent.

Looking at the log file (also attached), there are some errors present and one WARNING that point to a missing json file... maybe this will help troubleshoot.

Lastly, I was using the homebridge-wyze-connected-home-op bridge for about a year previously with no problems until the API thing killed it. Hoobs_Log.txt Wyze Bridge

xenonaxel commented 1 year ago

@carTloyal123 Attached are the logs. I did get notified that it was locked about 2 minutes after I locked it which was an improvement. But for as often as it's refreshing devices. I feel like it should be almost instant. homebridge.log(1).txt

carTloyal123 commented 1 year ago

Thanks to both of you for sending in logs and providing much needed extra info here. I will look at this over the next few days. Looks like some changes have been made since I last looked at the lock so I will catch up and hopefully find something. A not elegant solution for now just to try would be to uninstall the plugin and reinstall it. Might be some weird thing with the cached devices but I doubt it. If either of you are free/available to do a reinstall that would be great.

jfarmer08 commented 1 year ago

Polling to fast will cause your account to be lock. I suggest turning it back.

xenonaxel commented 1 year ago

@carTloyal123 I actually just completely migrated my homebridge setup recently from one computer to another and the problem still occurred.

xenonaxel commented 1 year ago

@carTloyal123 It looks like it also affects the wyze switch as well. It doesn't update when I manually turn the switch on. Not sure if that helps you track down the issue but it's something I've noticed.

xenonaxel commented 1 year ago

@carTloyal123 Some strange behavior I noticed. So it does get the right status every 60 seconds but it isn't updating in HomeKit. If I reload the accessory page in homebridge ui it updates and notifies me. But otherwise it just never updates. Very strange. I hope that makes sense.

jfarmer08 commented 11 months ago

New version is ready for testing

VonSquid commented 11 months ago

New version is working much better for me. Homekit control and alerts work fine. Status can get hung in "Locking..." or "Unlocking..." sometimes if the lock is manually controlled.

The biggest remaining issue for me, is that when I import the Wyze Locks into Homekit, they still onboard as contact sensors with associated locks (see screenshot)... should be the reversed. If you expand the device, it will show the lock, but it's hiding behind the contact sensor.

I appreciate the work here.

IMG_6352

jfarmer08 commented 11 months ago

This is how my locks look in the system.

image

VonSquid commented 11 months ago

Yours looks correct. Mine looks like this:

Lock

jfarmer08 commented 11 months ago

Have you tried to clear the cache and re-add it? Worse case. I don't know if any other settings.