SwitchBotAPI icon indicating copy to clipboard operation
SwitchBotAPI copied to clipboard

Include doorState into the lock webhook

Open jpconfessor opened this issue 2 years ago • 4 comments

Current Situation

Today when we receive a webhook message from a switchbot lock the doorState is not included as part of the message:

{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoLock",
        "deviceMac": DEVICE_MAC_ADDR,
        "lockState": "LOCKED",
        "timeOfSample": 123456789
    }
}

The only way to get the lock's door state is via API, which has a limited amount of queries per day...

Proposed Change

We should get visibility to events from the doorState as well, since they are linked to the lock itself. See below the expected event:

{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoLock",
        "deviceMac": DEVICE_MAC_ADDR,
        "lockState": "LOCKED",
        "doorState": "CLOSED",
        "timeOfSample": 123456789
    }
}

Additional Context

No response

jpconfessor avatar Sep 24 '22 00:09 jpconfessor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 04 '22 01:10 github-actions[bot]

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.

github-actions[bot] avatar Oct 05 '22 03:10 github-actions[bot]

Any chance this could be added as it is a really useful bit of information for home automation.

@donavanbecker could you reopen and pin this one please?

AdyRock avatar May 13 '23 20:05 AdyRock

I agree, despite my magnet being broken, I do agree that it would be really useful to have the status of weather the door is also closed, vs just when it is locked, as the door can lock while the door is open via the webhook, as as you stated - the API requests have a limited cap and having it via webhook would avoid that.

ThatProgrammerr avatar Aug 25 '24 11:08 ThatProgrammerr