SwitchBotAPI icon indicating copy to clipboard operation
SwitchBotAPI copied to clipboard

[Lock] Reveal unlock method in WebHook

Open danlane opened this issue 1 year ago • 5 comments

Current Situation

Currently when a Lock is locked or unlocked the WebHook sends the following data:

{ "eventType":"changeReport", "eventVersion":"1", "context":{ "deviceType":"WoLock", "deviceMac":"XXXX", "lockState":"LOCKED", "battery":95, "timeOfSample":1678390391311 } }

Proposed Change

Include the method by which the lock was changed - the logs in the app provide more detail such as:

  • Frontdoor unlocked manually
  • Frontdoor auto-locked
  • Frontdoor unlocked - Dan thumb (fingerprint)

It would be incredibly useful to include this data in the web hook JSON - a few examples:

{ "eventType":"changeReport", "eventVersion":"1", "context":{ "deviceType":"WoLock", "deviceMac":"XXXX", "lockState":"UNLOCKED", "changeReason":"Dan thumb (fingerprint)", "battery":95, "timeOfSample":1678390391311 } }

{ "eventType":"changeReport", "eventVersion":"1", "context":{ "deviceType":"WoLock", "deviceMac":"XXXX", "lockState":"LOCKED", "changeReason":"AUTO-LOCKED", "battery":95, "timeOfSample":1678390391311 } }

Additional Context

No response

danlane avatar Mar 09 '23 20:03 danlane

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 Mar 19 '23 20:03 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 Mar 20 '23 21:03 github-actions[bot]

Please re-open this and consider it for inclusion in a future API update - it would be very useful to many home automation enthusiasts!

danlane avatar Apr 20 '23 18:04 danlane

I'd like this to be implemented for sure. I live in an apartment and are forced to have the lock that came with my door. As I always unlock my door via the keypad and/or app, so having the ability to receive a webhook that states the unlock method, would allow me to detect when a manual unlock occurs and send myself a silent alarm of sorts, or even sound the alarm.

ThatProgrammerr avatar Jun 13 '24 16:06 ThatProgrammerr

OOps, seems like I accidently opened a new issue for the same request. I'll keep it open as it's newer, but due to the nature of this issue's age - I have a feeling the chances it'll be implemented are zero to none: https://github.com/OpenWonderLabs/SwitchBotAPI/issues/338

ThatProgrammerr avatar Aug 25 '24 11:08 ThatProgrammerr