Skip to content

Bluetooth-Devices/oralb-ble

Repository files navigation

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.

About

Bluetooth library for Oral B devices

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors