OpenWonderLabs / SwitchBotAPI

SwitchBot Open API Documents
847 stars 70 forks source link

Question: Is there an undocumented endpoint to get logs of a device? #341

Open ThatProgrammerr opened 3 weeks ago

ThatProgrammerr commented 3 weeks ago

Current Situation

I thought that since the app has logs of what unlocked a Lock or Lock Pro, like OpenAPI, 'Thumb name' (for keypad touch), Manual, etc - I could grab those logs while waiting for my other issue (https://github.com/OpenWonderLabs/SwitchBotAPI/issues/338) to be approved and implemented, but I can't seem to find a method documented for this either, despite the data clearly being there.

Environment

Additional Context

The log page. image

cikabo commented 1 week ago

Similar issue, I am using the API to perform various actions, all good. I can see the device logs, including card and keyboard usage in the app - is that information available via the API?

ThatProgrammerr commented 1 week ago

Similar issue, I am using the API to perform various actions, all good. I can see the device logs, including card and keyboard usage in the app - is that information available via the API?

As far as I can see, there is no way to grab that data outside the app, via the API. I tried to setup some automation on an emulated android device, as well as sniffing traffic, but no luck. Unless it eventually gets added to the API, I don't personally see a way that this will be data you can pull and use in code.

hsakoh commented 1 week ago

In my observation, the app has a means to perform operations equivalent to Bluetooth commands via MQTT, even when there is no Bluetooth connection. When the app is connected via WiFi, the flow for retrieving keypad logs is as follows: App -> MQTT (AWS IoT Core) -> Hub -> Bluetooth -> Keypad

If sniffing is possible, a hint would be /user/policyCer. (I can't write anything too specific here, so if you want more detailed information, please contact me elsewhere.)

However, it’s highly unlikely that SwitchBot will document or open these things, so it would be great if they were added as an OpenAPI.