OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://openwonderlabs.github.io/homebridge-switchbot/
ISC License
239 stars 51 forks source link

Bug: Doesn't recognize locked door #1031

Open ryan-dirajlal opened 3 weeks ago

ryan-dirajlal commented 3 weeks ago

Describe the Bug

I have a Smart Lock. The plugin is able to lock the door from the unlocked position, and it actually locks the door. However, it does not recognize that it was actually locked and continues to show "unlock". Since it thinks the door is currently unlocked (even though it is actually locked), clicking the button does not do anything.

Logs:

[23/08/2024, 20:55:08] [SwitchBot] Smart Lock: Door failed BLEpushChanges with BLE/OpenAPI Connection, Error Message: "No characteristics available." [23/08/2024, 20:55:08] [SwitchBot] Smart Lock: Door Using OpenAPI Connection to Push Changes

To Reproduce

Download plugin Set up token id and secret Open Home app Click lock while door is unlocked. This locks the door, but symbol stays as "unlocked" Click the button again, and nothing happens

Expected Behavior

I expect the symbol to show as "locked" after the door locks. Then I expect to be able to unlock the door.

Relevant Log Output

[23/08/2024, 20:55:08] [SwitchBot] Smart Lock: Door failed BLEpushChanges with BLE/OpenAPI Connection, Error Message: "No characteristics available."
[23/08/2024, 20:55:08] [SwitchBot] Smart Lock: Door Using OpenAPI Connection to Push Changes

Config for homebridge-switchbot

{
    "bridge": {
        "name": "Homebridge C2C8",
        "username": "test",
        "port": test
        "pin": "3test",
        "advertiser": "avahi"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "SwitchBot",
            "credentials": {
                "token": "thisissecret",
                "secret": "not4u",
                "notice": "Keep your Token & Secret a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceId": "CD:F5:E5:01:D8:8D",
                        "configDeviceType": "Smart Lock",
                        "connectionType": "BLE/OpenAPI",
                        "lock": {
                            "hide_contactsensor": false
                        }
                    }
                ]
            },
            "platform": "SwitchBot"
        }
    ]
}

Screenshots

No response

Device and Model

Switch Bot Smart Lock

Node.js Version

v20.12.2

NPM Version

HAP v0.12.2

Homebridge Version

v1.8.4

Homebridge Switchbot Plugin Version

v3.7.0

Homebridge Config UI X Plugin Version

v4.56.4

Operating System

Raspibian

donavanbecker commented 2 weeks ago

To eliminate if this is BLE or OpenAPI issue. Can you change your connection type to BLE test get logs and post them. Then test with OpenAPI and then post?