OpenWonderLabs / SwitchBotAPI-BLE

SwitchBot BLE open API
98 stars 9 forks source link

Blind Tilt - tilt position in info query is incorrect #23

Closed ndbeals closed 1 year ago

ndbeals commented 1 year ago

Analysis

The self reported tilt position when querying the device with the 0x5702 command is incorrect

Expected Behavior

The tilt position is correctly reported

Steps To Reproduce

The easiest way would be to use https://github.com/Danielhiversen/pySwitchbot and run the script I've provided:

MAC = "<YOUR BLINDTILT MAC HERE>" -- in the form of XX:XX:XX:XX:XX:XX"

async def main():
    ble_device = await BleakScanner.find_device_by_address(MAC, timeout=20)
    device = SwitchbotBlindTilt(ble_device,scan_timeout=20)
    info = await device.get_basic_info()
    print("info: ",info,"\n")

if __name__ == "__main__":
    try:
        loop = asyncio.get_event_loop()
        loop.run_until_complete(main())
    except KeyboardInterrupt:
        print("Quit")

Generally the steps are:

  1. Use the aforementioned library to query the device data
  2. Note that the tilt is wrong when the tilt != 0 or tilt != 100

Logs

Not any useful logs, but here are some examples of what the reported tilt is, and the correct value

Actual value, Reported Value
10      12
50      59
75      79
86      89

Configuration

Blindtilt is on Firmware version 2.0
Blind tilt has been calibrated.

Environment

Additional Context

When the device advertises, the tilt value in the advertisement is correct.

It's only the tilt value from the info query (0x5702) that is wrong.

ndbeals commented 1 year ago

I'm realizing this repo may not be the correct place to put this issue, please advice where the right place is if so.

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.

ndbeals commented 1 year ago

not stale

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.

github-actions[bot] commented 1 year ago

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

ndbeals commented 1 year ago

not stale