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.3.tar.gz (10.0 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.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oralb_ble-1.1.3.tar.gz
  • Upload date:
  • Size: 10.0 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.3.tar.gz
Algorithm Hash digest
SHA256 a9e4d979618ec9d623025d87e8df7aec61a532ba98ade81a260bb30e440a95c9
MD5 904b47cd30c25c8738b45c89ce1ae4a8
BLAKE2b-256 8e0052f11143115b7b883370f76e477ecc0135020ab12ace40b9aa83bc6985fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for oralb_ble-1.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: oralb_ble-1.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bd8f418d7b176c0da006e324ddafe7e276b2533a43c83000657f1bcf6b85d285
MD5 03ee59bcc9605164aebc0e4d1b49fd22
BLAKE2b-256 83151f148d581a36989a8517dfbdca01f0fd0e542881455ca17759192d9fe55a

See more details on using hashes here.

Provenance

The following attestation bundles were made for oralb_ble-1.1.3-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