OpenWonderLabs / SwitchBotAPI-BLE

SwitchBot BLE open API
98 stars 9 forks source link

SwitchBot Blind Tilt #16

Open donavanbecker opened 1 year ago

donavanbecker commented 1 year ago

Current Situation

Add support for SwitchBot Blind Tilt

Proposed Change

Add support for SwitchBot Blind Tilt

Additional Context

No response

bdraco commented 1 year ago

There is a PR in progress https://github.com/Danielhiversen/pySwitchbot/pull/181 that might be helpful to provide some insight

github-actions[bot] commented 1 year ago

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.

AdyRock commented 1 year ago

Is there a reason why the position information is now only available by BLE request instead of being sent in the Service Data section of the Advertisement, like it is for the curtains? Having it advertised in the service data is a perfect system as it means no lengthy BLE requests need to be made and an near instant response is just there. I can't really see it is a power saving feature as the advertainments are being sent anyway with the battery data.

Would it be possible to make it the same a the Curtain device as that works so well?

ndbeals commented 1 year ago

Could we get some documentation on packet of the basic information response? pySwitchbot is currently reporting incorrect tilt data from a get_basic_info() (0x5702) request. Interesting to note, listening to advertisements and parsing the advertisement data from the blind tilt does give the correct tilt value.

AdyRock commented 1 year ago

So, are you saying that you are seeing the blind tilt position in the advertisement data? If so where are you finding that?

AdyRock commented 1 year ago

OK, so update my Blind Tilt to version 2 firmware and I now see the position data in the Manufacturer data. So, no longer need a time consuming BLE command to get the position. Thanks to the SwitchBot team for doing that.

Could the format of the Manufacturer data be published to make it easier to decode all the information?

ndbeals commented 1 year ago

@AdyRock here's code documentation from pySwitchbot of the advertisement data: https://github.com/Danielhiversen/pySwitchbot/blob/34125596d12a94a052cbcb6701778c48a20f8a83/switchbot/adv_parsers/blind_tilt.py#L5

donavanbecker commented 1 year ago

If someone builds the doc, I will accept it as a PR on here.

ndbeals commented 1 year ago

Is that a joke?

How is anyone going to build the doc without the needed documentation about the Bluetooth commands and data structures that only SwitchBot, your employer, has?

donavanbecker commented 1 year ago

@ndbeals I don't work for SwitchBot. I just maintain these repos for them.

ndbeals commented 1 year ago

I see, that's nice of you, thanks for the community contributions. Am I understanding correctly that this organization, OpenWonderLabs, is not affiliated with switchbot?

The 2.0 firmware possibly has a bug (#23) and there not being any official info, I'm not sure how feasible it is for anyone to make documentation.

FWIW I don't even know how the guy over at pySwitchBot even came up with the code he does have. Was he just attempting trial and error to figure out the binary format of the Bluetooth messages? Or maybe he has access to switchbot documentation.

AdyRock commented 1 year ago

Possibly trial and error as that is how I decoded the position information. Basically just moved the blinds to different known positions and watched the data to spot the patterns.

donavanbecker commented 1 year ago

@ndbeals This is the official SwitchBot organization, but they only monitor when the have updates from what I have experienced.