donavanbecker / homebridge-august

The Homebridge August plugin allows you to access your August/Yale Locks from HomeKit with Homebridge.
ISC License
35 stars 8 forks source link

Bug: Lock status continually shows as "Unlocking" #22

Closed jlg89 closed 11 months ago

jlg89 commented 1 year ago

Describe The Bug

When a lock is manually unlocked, it shows in HomeKit as "Unlocking" until I hit the unlock button, at which point it immediately changes to "Unlocked." The same thing happens when the lock is manually locked, but it shows "Locking" until I hit the button, and it changes to "Locked."

To Reproduce

Setup the plugin, get the lock into HomeKit, manually unlock or lock the lock.

Expected behavior

The status in HomeKit should reflect actual current status of the lock.

Relevant log output

I don't see any standard log output for this condition, but I can enable debug & see what happens, if that is needed.

Config for homebridge-august

{
    "platform": "August",
    "name": "August",
    "credentials": {
        "augustId": "xxxx",
        "password": "xxxx",
        "validateCode": "xxxx"
    },
    "options": {
        "devices": [
            {
                "lockId": "xxxxxxxxxxxxxxxxxxx",
                "hide_device": true
            }
        ]
    }
}

Screenshots

No response

Device & Model

We have six AUG-SL04-M01-S04 locks, and one Gen 4 WiFi lock (hidden since it's HomeKit native)

Node.js Version

v16.18.0

NPM Version

v8.19.2

Homebridge Version

1.5.0

Homebridge August Plugin Version

v1.0.5

Homebridge Config UI X Plugin Version

HOOBS 4.2.8

Operating System

Linux hoobs 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux

Phixius5968 commented 1 year ago

I have the same issue. I can create the bug by unlocking/locking via the HomeKit-native button of the lock. Then the Homebridge button shows Unlocking or Locking until I press the button. I looked in homebridge accessories and the lock shows "Lock Current State" as 0 and "Lock Target State" as 1 or reversed depending on the case.

dwyeraidan commented 1 year ago

I too see this issue with my Yale Keyless lock - though from searching the web /reddit, other users with native HomeKit locks see the same problem, and going back years. So perhaps this is an issue with HomeKit itself?

rubenstolk commented 1 year ago

Same issue here, only after an interaction from the Home app, the "locking..." or "unlocking..." goes away.

Hulkkih commented 1 year ago

Same here. State changes correctly in homebridge accessories but in home app gets stuck in that "opening" state. Also sometimes get errors like this:

[18/12/2022, 11:08:40] [August] pushChanges: TypeError: Cannot destructure property 'status' of 'obj' as it is undefined. [18/12/2022, 11:08:40] [August] Lock: Pääovi failed pushChanges, Error Message: "Cannot destructure property 'status' of 'obj' as it is undefined." FetchError: Status 423 (97): Bridge in use FetchError: Status 423 (97): Bridge in use

JK1503 commented 1 year ago

I'm experiencing the same issue with the lock status in HomeKit stuck on opening and the log looks like this when I try to interact via HomeKit:

FetchError: Status 423 (97): Bridge in use FetchError: Status 423 (97): Bridge in use FetchError: Status 462 (107): OperationCacheInvalid [12/22/2022, 8:18:38 AM] [August] pushChanges: TypeError: Cannot destructure property 'status' of 'obj' as it is undefined. [12/22/2022, 8:18:38 AM] [August] Lock: Office Door failed pushChanges, Error Message: "Cannot destructure property 'status' of 'obj' as it is undefined."

rubenstolk commented 1 year ago

Very unfortunate, makes the plugin not usable. Hopefully someone will be able to address this soon, for now we'll have to resort back to the legacy plugins.

craigpress commented 1 year ago

I am also having this problem. Any solutions? Love the plug-in otherwise

donavanbecker commented 1 year ago

Sorry everyone, life is busy right now.

jlg89 commented 1 year ago

Whaaaaaaat?! You think you're allowed to have a life?! :D

ghost commented 1 year ago

Also seeing this issue with the same error message of: pushChanges: TypeError: Cannot destructure property 'status' of 'obj' as it is undefined.

rubenstolk commented 1 year ago

So I debugged this and what seems to be happening is this:

I'll try to investigate further if I get time but perhaps @donavanbecker you have a clue based on my findings?

craigpress commented 1 year ago

@donavanbecker anything new on this issue? Anything we can pull from logs to help. Appreciate how much this plugin helps and your time.

donavanbecker commented 1 year ago

I can probably look into this in the near future.

jspiro commented 1 year ago

Likewise, deep appreciation for the maintainers. Not in a position to fix this myself, despite how frustrating and confusing it is.

craigpress commented 1 year ago

Any updates or luck on this issue @donavanbecker ?

dacarson commented 1 year ago

I believe the problem is in this function: async subscribeAugust() What seems to be happening is the lock is updating it's status from the manual operation, the plugin is correctly observing and updating the lock's current state. However, it isn't updating the target state along side it.

On my copy of the code, I added the LockTargetState lines into the subscribeAugust (see below) and now it is working fine:


      //LockCurrentState
      if (!this.hide_lock) {
        if (AugustEvent.state.unlocked) {
          this.LockCurrentState = this.platform.Characteristic.LockCurrentState.UNSECURED;
          // Update target state too.
          this.LockTargetState = this.platform.Characteristic.LockCurrentState.UNSECURED;
          if (this.LockCurrentState !== this.accessory.context.LockCurrentState) {
            this.infoLog(`Lock: ${this.accessory.displayName} was Unlocked`);
          }
        } else if (AugustEvent.state.locked) {
          this.LockCurrentState = this.platform.Characteristic.LockCurrentState.SECURED;
          // Update target state too.
          this.LockTargetState = this.platform.Characteristic.LockCurrentState.SECURED;
          if (this.LockCurrentState !== this.accessory.context.LockCurrentState) {
            this.infoLog(`Lock: ${this.accessory.displayName} was Locked`);
          }
        } else {
          this.refreshStatus();
        }
      }
donavanbecker commented 1 year ago

@dacarson, can you open a PR and I will merge it into beta branch and we can have others test it.

jspiro commented 1 year ago

Ready to help test as soon as this is available in the 1.2 beta release.

donavanbecker commented 1 year ago

Beta should be out soon.

jspiro commented 1 year ago

Did some quick testing, I have door sense, and it seems to work great so far! I tried various combinations of manual locking and unlocking, and HomeKit locking and unlocking. I will report back if I see any anomalous behavior, but it seems good to go.

donavanbecker commented 1 year ago

Awesome!

jspiro commented 11 months ago

Still going strong! No issues. I use it dozens of times a day.

Hulkkih commented 11 months ago

Stupid question but how can i use beta version?

donavanbecker commented 11 months ago

v1.2.0 has been released