bmx-ble
Python library for BMx battery monitor BLE advertisements and GATT notifications. The initial release supports BM2; the package name allows additional BM models to be supported later.
It decodes legacy percentage advertisements and encrypted enhanced voltage and percentage advertisements, validates the BM2 notification characteristic, and tries an active GATT reading before falling back to cached advertisement data.
Installation
python -m pip install bmx-ble
Use
from bmx_ble import BM2Protocol
monitor = BM2Protocol()
monitor.process_advertisement(service_info.manufacturer_data)
reading = await monitor.async_poll(ble_device) # None allows passive fallback.
print(reading.voltage, reading.percentage, reading.generation)
Supply a bleak.backends.device.BLEDevice for active reading. Connection
failures propagate when no usable advertisement has been cached.
Development
python -m pip install -e '.[test]'
python -m pytest
python -m build
The Home Assistant integration is kept separately from this library.
Publishing
Create a public repository with this source and an enabled issue tracker.
Set up PyPI Trusted Publishing for the repository's release workflow, tag a
release matching the version in pyproject.toml, then run the publish workflow.
Confirm the project name is available on PyPI before the first release.
License
MIT; see LICENSE.
Release files for bmx-ble 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bmx_ble-0.1.0.tar.gz | 8.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bmx_ble-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.3 kB
Release files / bmx_ble-0.1.0.tar.gz
| Download URL | bmx_ble-0.1.0.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a7911b2839bbcbd7ae234e7c4e9c43ec782faa8427ebddfcf0daff0611b64c9
|
|
BLAKE2b-256 checksum How to use checksums |
680c540efb637787a17122ec3bfb63e3b445aa4d3042b3aca1c48d0d6188a3ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / bmx_ble-0.1.0-py3-none-any.whl
| Download URL | bmx_ble-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76573543cbe62ae9b81e31de4510c05fa08fd5d6bb44c428084a381358c206b2
|
|
BLAKE2b-256 checksum How to use checksums |
7a3491963dabea5d1225490886709aa13365a94482a83ea016cb82f82e44b20c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency log