Skip to main content

Bluetooth library for Oral B devices

Project description

OralB BLE

CI Status Documentation Status Test coverage percentage

Poetry black pre-commit

PyPI Version Supported Python versions License

Bluetooth library for Oral B devices

Installation

Install this via pip (or your favourite package manager):

pip install oralb-ble

Usage

oralb-ble is a passive parser for Oral-B toothbrush BLE advertisements. It does not connect to the device — it decodes the manufacturer data that the brush broadcasts while in use.

Feed each advertisement you receive into OralBBluetoothDeviceData.update() and read the resulting SensorUpdate:

from home_assistant_bluetooth import BluetoothServiceInfo
from oralb_ble import OralBBluetoothDeviceData

# A BLE advertisement captured from an Oral-B IO Series 6.
service_info = BluetoothServiceInfo(
    name="Oral-B Toothbrush",
    address="78:DB:2F:C2:48:BE",
    rssi=-63,
    manufacturer_data={220: b"\x062k\x02r\x00\x00\x01\x01\x00\x04"},
    service_uuids=[],
    service_data={},
    source="local",
)

parser = OralBBluetoothDeviceData()
update = parser.update(service_info)

print(update.title)
# 'IO Series 48BE'

for key, value in update.entity_values.items():
    print(f"{key.key}: {value.native_value}")
# time: 0
# sector: no sector
# number_of_sectors: 4
# sector_timer: 0
# toothbrush_state: idle
# pressure: normal
# mode: sensitive
# signal_strength: -63

for key, value in update.binary_entity_values.items():
    print(f"{key.key}: {value.native_value}")
# brushing: False

The parser is stateful per device: keep the same OralBBluetoothDeviceData instance across advertisements from the same toothbrush so that derived fields (sector_timer, toothbrush_state) stay accurate.

For real-world advertisement collection see Home Assistant's bluetooth integration — that is the primary consumer of this library.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

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

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

oralb_ble-1.1.2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oralb_ble-1.1.2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file oralb_ble-1.1.2.tar.gz.

File metadata

  • Download URL: oralb_ble-1.1.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for oralb_ble-1.1.2.tar.gz
Algorithm Hash digest
SHA256 5d436d8984d8ea508b416c812527af8c74f91ff453eb09b49ed68eebe6f866e8
MD5 6ada522f68764df8463487d2658c31af
BLAKE2b-256 7e7c2f0140a0a10a7970b59c7e94fa4b41504cfdcac2195978c8a431a6e901c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for oralb_ble-1.1.2.tar.gz:

Publisher: ci.yml on Bluetooth-Devices/oralb-ble

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oralb_ble-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: oralb_ble-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for oralb_ble-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 08ef90e91d4b76862e3a7f27290ce010073def347d15d67361a745b16ef67143
MD5 69c9a0cc21aff2934fc278e4eb124d2f
BLAKE2b-256 e42c8bdd93e4399e2913f3e343c6afd3af92b5256de12517465d5133aaafaae0

See more details on using hashes here.

Provenance

The following attestation bundles were made for oralb_ble-1.1.2-py3-none-any.whl:

Publisher: ci.yml on Bluetooth-Devices/oralb-ble

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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