sibartlett / homebridge-wink3

Homebridge plugin for wink.com
https://sibartlett.github.io/homebridge-wink3
ISC License
54 stars 20 forks source link

Delayed status update to home.app #117

Open mbriney opened 5 years ago

mbriney commented 5 years ago

I'm having some issues with the plugin polling the Schlage Connect locks. In the home.app when I press the door lock it starts the process. Immediately homebridge responds, the doors lock and I get these two items in the log:

[2018-11-3 23:14:27] [Wink] Sending update: Rear Door (lock/262658) { locked: true } [2018-11-3 23:14:27] [Wink] Update sent successfully: Rear Door (lock/262658)

However the home.app keeps on spinning the pinwheel and saying that the door is still "Locking..."

Eventually it re-polls the status on the hub of all devices and shows the item as locked.

Earlier in the log it also shows the following wink related entries.

[2018-11-3 23:13:52] [Wink] Checking if hub is reachable (Wink Hub 2, 192.168.7.149)... [2018-11-3 23:13:52] [Wink] Hub is reachable locally (Wink Hub 2, 192.168.7.149) [2018-11-3 23:13:53] [Wink] Authenticated with local hub (Wink Hub 2, 192.168.7.149)

I've also tried adjusting the config to set "direct_access": false. But that doesn't seem to improve the response time either.

How can I get it to show the door lock status faster to the home.app?

Thank you, -Matt

sibartlett commented 5 years ago

Does restarting homebridge resolve the issue?

I have the exact same lock, so I can also check what is happening with mine.

mbriney commented 5 years ago

Restarting Homebridge will then poll everything and show the correct status but it eventually does get back into this state again.

mbriney commented 5 years ago

I'm wondering. In src/devices/lock.js

In the set: value => function. After setting the lock state could you have it pause for 3 seconds and have it run Characteristic.LockCurrentState.

I'm wondering if calling that would then have the Wink hub run a check to see if the door did lock/unlock?

themick4u commented 5 years ago

I frequently experience the same thing with my Schlage lock as well. A pause then poll seems logical if it can be done. Thoughts>?

jason-klein commented 5 years ago

Thanks to @sibartlett for their work on the Homebridge Wink plugin!

I occasionally experience the same issue with same lockset @mbriney described. Here is more detail. I will update this issue with any other symptoms or patterns I notice, or any solutions I find!

If someone can give me some direction, I would be glad to attempt to code/test a solution locally and submit a PR.

Related Symptoms

When I LOCK or UNLOCK the Schlage Connect device via Home App on iOS (or via Siri on HomePod), the device status in Home App may show "Locking..." or "Unlocking..." for 3-5 seconds OR indefinitely. The physical device ALWAYS immediately locks or unlocks as expected. However the device status in Home App does NOT always change to "Locked" or "Unlocked" as expected.

Note - If I restart Homebridge when the device status is stuck as "Locking..." or "Unlocking...", the device status is repolled immediately after Homebridge restart and Home App correctly shows "Locked" or "Unlocked". However, this does NOT resolve the problem. The next time I try to LOCK or UNLOCK the device, the Home App may show "Locking..." or "Unlocking..." 3-5 seconds OR indefinitely.

When Home App is receiving the device status change correctly, the Homebridge logs look like this:

ELECTRONIC UNLOCK

[4/1/2019, 2:21:10 AM] [Wink] Sending update: Front Door (lock/123456) { locked: false }
[4/1/2019, 2:21:10 AM] [Wink] Update sent successfully: Front Door (lock/123456)
[4/1/2019, 2:21:14 AM] [Wink] Received update notification: Front Door (lock/123456)
[4/1/2019, 2:21:17 AM] [Wink] Received update notification: Front Door (lock/123456)

ELECTRONIC LOCK

[4/1/2019, 2:21:22 AM] [Wink] Sending update: Front Door (lock/123456) { locked: true }
[4/1/2019, 2:21:22 AM] [Wink] Update sent successfully: Front Door (lock/123456)
[4/1/2019, 2:21:25 AM] [Wink] Received update notification: Front Door (lock/123456)
[4/1/2019, 2:21:29 AM] [Wink] Received update notification: Front Door (lock/123456)
[4/1/2019, 2:21:32 AM] [Wink] Received update notification: Front Door (lock/123456)

When Home App is NOT receiving the device status change, the Homebridge logs are as follows. Note the physical lock DOES unlock or lock immediately after the "Update sent successfully" message, but there are no "Received update notification" messages.

ELECTRONIC UNLOCK

[4/1/2019, 1:37:55 AM] [Wink] Sending update: Front Door (lock/123456) { locked: false }
[4/1/2019, 1:37:55 AM] [Wink] Update sent successfully: Front Door (lock/123456)

ELECTRONIC LOCK

[4/1/2019, 1:38:02 AM] [Wink] Sending update: Front Door (lock/123456) { locked: true }
[4/1/2019, 1:38:02 AM] [Wink] Update sent successfully: Front Door (lock/123456)

Status Change when Physically Unlocking/Locking Schlage Connect

If I go to the door and physically lock or unlock the Schlage Connect lock, the Home App device status may change in 3-5 seconds or may not change at all (e.g. still shows "Locked" even after I unlock door). When the Home App device status changes as expected, the Homebridge logs show the "Received update notification" messages. When the Home App device status does not change, the Homebridge logs do NOT show the "Received update notification" messages.

PHYSICAL UNLOCK

[4/1/2019, 2:19:38 AM] [Wink] Received update notification: Front Door (lock/123456)

PHYSICAL LOCK

[4/1/2019, 2:19:43 AM] [Wink] Received update notification: Front Door (lock/123456)

As far as I can tell, the WINK App always shows the correct "Locked" or "Unlocked" status about 1-2 seconds after I physically change the door from unlocked to locked, or from locked to unlocked respectively. Unsure if it is coincidence, but each time I open the WINK App to investigate the hanging "Unlocking.." or "Locking..." device status issue, the issue seems to clear up.

themick4u commented 5 years ago

As an FYI I also experience the exact same thing with same lock / wink setup as you.... a reboot of homebridge pi server resolves it for a short while. This has gone on for as long as I’ve had these homebridge servers running. (I’ve had both docker and stand-alone versions running at different times in past).

Thanks, and have a great day!

Mick Jacobson ***Sent from my iPhone XS Max

On Mar 31, 2019, at 10:42 PM, Jason Klein notifications@github.com wrote:

Thanks to @sibartlett for their work on the Homebridge Wink plugin!

I occasionally experience the same issue with same lockset @mbriney described. Here is more detail. I will update this issue with any other symptoms or patterns I notice, or any solutions I find!

If someone can give me some direction, I would be glad to attempt to code/test a solution locally and submit a PR.

Related Symptoms

When I LOCK or UNLOCK the Schlage Connect device via Home App on iOS (or via Siri on HomePod), the device status in Home App may show "Locking..." or "Unlocking..." for 3-5 seconds OR indefinitely. The physical device ALWAYS immediately locks or unlocks as expected. However the device status in Home App does NOT always change to "Locked" or "Unlocked" as expected.

Note - If I restart Homebridge when the device status is stuck as "Locking..." or "Unlocking...", the device status is repolled immediately after Homebridge restart and Home App correctly shows "Locked" or "Unlocked". However, this does NOT resolve the problem. The next time I try to LOCK or UNLOCK the device, the Home App may show "Locking..." or "Unlocking..." 3-5 seconds OR indefinitely.

When Home App is receiving the device status change correctly, the Homebridge logs look like this:

ELECTRONIC UNLOCK

[4/1/2019, 2:21:10 AM] [Wink] Sending update: Front Door (lock/123456) { locked: false } [4/1/2019, 2:21:10 AM] [Wink] Update sent successfully: Front Door (lock/123456) [4/1/2019, 2:21:14 AM] [Wink] Received update notification: Front Door (lock/123456) [4/1/2019, 2:21:17 AM] [Wink] Received update notification: Front Door (lock/123456) ELECTRONIC LOCK

[4/1/2019, 2:21:22 AM] [Wink] Sending update: Front Door (lock/123456) { locked: true } [4/1/2019, 2:21:22 AM] [Wink] Update sent successfully: Front Door (lock/123456) [4/1/2019, 2:21:25 AM] [Wink] Received update notification: Front Door (lock/123456) [4/1/2019, 2:21:29 AM] [Wink] Received update notification: Front Door (lock/123456) [4/1/2019, 2:21:32 AM] [Wink] Received update notification: Front Door (lock/123456) When Home App is NOT receiving the device status change, the Homebridge logs are as follows. Note the physical lock DOES unlock or lock immediately after the "Update sent successfully" message, but there are no "Received update notification" messages.

ELECTRONIC UNLOCK

[4/1/2019, 1:37:55 AM] [Wink] Sending update: Front Door (lock/123456) { locked: false } [4/1/2019, 1:37:55 AM] [Wink] Update sent successfully: Front Door (lock/123456) ELECTRONIC LOCK

[4/1/2019, 1:38:02 AM] [Wink] Sending update: Front Door (lock/123456) { locked: true } [4/1/2019, 1:38:02 AM] [Wink] Update sent successfully: Front Door (lock/123456) Status Change when Physically Unlocking/Locking Schlage Connect

If I go to the door and physically lock or unlock the Schlage Connect lock, the Home App device status may change in 3-5 seconds or may not change at all (e.g. still shows "Locked" even after I unlock door). When the Home App device status changes as expected, the Homebridge logs show the "Received update notification" messages. When the Home App device status does not change, the Homebridge logs do NOT show the "Received update notification" messages.

PHYSICAL UNLOCK

[4/1/2019, 2:19:38 AM] [Wink] Received update notification: Front Door (lock/123456) PHYSICAL LOCK

[4/1/2019, 2:19:43 AM] [Wink] Received update notification: Front Door (lock/123456) As far as I can tell, the WINK App always shows the correct "Locked" or "Unlocked" status about 1-2 seconds after I physically change the door from unlocked to locked, or from locked to unlocked respectively. Unsure if it is coincidence, but each time I open the WINK App to investigate the hanging "Unlocking.." or "Locking..." device status issue, the issue seems to clear up.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jason-klein commented 5 years ago

My Environment Details Homebridge 0.4.47 in a Docker 18.06 container on a Raspberry Pi 3 connected to same ethernet switch as Wink hub and wireless router/AP. I have a new/clean install of Raspbian Stretch Lite (version 2018-11-13) and a fresh/clean install of the latest Homebridge Docker image published 3 days ago (https://hub.docker.com/r/oznu/homebridge) via the Quick Install Script provided by @oznu (https://github.com/oznu/docker-homebridge/wiki/Homebridge-on-Raspberry-Pi).

jasontproject commented 5 years ago

@jason-klein I also have the exact same issue after just doing a fresh installation of homebridge 0.4.49 and homebridge-wink3 2.0.0

sibartlett commented 5 years ago

Wink changed their push notification infrastructure, I've pushed a new version of this plugin.

Please update homebridge-wink3 to 2.1.0

jasontproject commented 5 years ago

very nice, I should have checked this issue before spending the last couple of hours figuring this out and preparing a PR:) Updated to 2.1.0 and works

Kepete commented 5 years ago

I'm experiencing the same issue as described here before by others. The lock stays in unlocking... or locking... state for few hours or until i restart homebridge.

The difference is that I'm using August Smart Lock 3rd(non pro).

I'm running homebridge-wink3 v2.1.0

Kepete commented 4 years ago

Still struggling with this issue :(

Kepete commented 4 years ago

Updated everything to the newest: node: v10.16.3 homebridge: 0.4.50 wink-3 plugin: homebridge-wink3 v2.1.0

sibartlett commented 4 years ago

Sorry, I am no longer actively maintaining this project. I am no longer using Wink, and do not have the time or resources to dedicate more to ongoing maintenance.