Skip to main content

Handle BLE communications for a SUTA bed frame such as the i500 or i800.

Project description

SUTA BLE Bed

https://img.shields.io/pypi/v/suta_ble_bed.svg https://img.shields.io/travis/sredman/suta_ble_bed.svg Documentation Status Updates

BLE handling code for bed frames which use the SUTA app, such as the such as the i500 or i800 (and others)

Supports control of the bed but not access to the current state. Expected to be used as a module to build your own integration with some control system, but ships with a rough CLI to play with directly.

Does device discovery by name because (as far as I could tell) the bed does not support discovery by the typical manufacturer UUID.

Notionally, this should be fine unless your neighbor is actively trying to intercept your bed control.

Features

  • TODO

Usage

async with SutaBleBedController() as controller:
  async for bed in controller.devices():
    await bed.raise_feet()
    break

Note that the async for will return a result each time the advertising data changes, which includes any time the signal strength changes.

or

python -m suta_ble_bed --MAC=AA:BB:CC:DD:EE:FF head-down

Credits

This module would not have been possible without the research done by stevendodd on Github: https://github.com/stevendodd/sleepmotion-ble/blob/main/pi-zero/sleepmotion-ble.py

Inspired by: https://github.com/sopelj/python-ember-mug/blob/main/ember_mug/mug.py

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.3.3 (2023-07-24)

  • Added release pipeline

0.3.2 (2023-04-10)

  • Fix disconnect callback

  • Correct comment on BLE characteristics

0.3.1 (2023-03-23)

  • Fix connection handling with Controller interface

  • Fix CLI in case MAC is not provided

  • Pass correct parameter when constructing SutaBleBed under callback

0.3.0 (2023-03-23)

  • Change to Controller interface

  • Fix copy-paste errors

  • Add “is_connected” helper

0.2.0 (2023-03-21)

  • Switch to Cookiecutter

0.1.4 (2023-03-20)

  • Finally correctly packaged with description

0.1.3 (2023-03-08)

  • Trying to get packaging correct

0.1.2 (2023-03-08)

  • Trying to get packaging correct

0.1.1 (2023-03-05)

  • Trying to get packaging correct

0.1 (2023-03-05)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

suta_ble_bed-0.3.3.tar.gz (14.4 kB view hashes)

Uploaded Source

Built Distribution

suta_ble_bed-0.3.3-py2.py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page