SwitchBotAPI
SwitchBotAPI copied to clipboard
Include doorState into the lock webhook
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
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.
This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.
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?
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.