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.1.tar.gz (9.4 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.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for oralb_ble-1.1.1.tar.gz
Algorithm Hash digest
SHA256 87657571f3abdcbe6e9f254a8dd1b459560b16045ec80d8c7803109bcc962830
MD5 5d00fe4edd419da659ba1470f7d3fc42
BLAKE2b-256 2d9fabb279f4996b8ecebcfe9fb6b6327eaef02643d3c4300bf0bf891e2c651a

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for oralb_ble-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a080b3f2efb09294e13d9abf4d70bc166b70187102dbae7d529d925badefb3b
MD5 e63ea26f2067b5c7a3333450df4f1848
BLAKE2b-256 e4c46f3fdb4d4b274c800a9f9c4f4b8eba76cbe0512426365c9dc2ebef60fd6d

See more details on using hashes here.

Provenance

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