This release is a pre-release and may not be stable for production use.
Aiobmsble
Requires Python 3.12+ and uses asyncio and Bleak
Asynchronous Library to Query Battery Management Systems via Bluetooth LE
This library is intended to query data from battery management systems that use Bluetooth LE. Stand-alone usage is possible in any Python environment (with necessary dependencies installed). It is developed to support BMS_BLE-HA integration that was written to make BMS data available to Home Assistant, but can be hopefully useful for other use-cases as well.
Features
- Support for autodetecting compatible BLE BMSs
- 50+ different protocol variants
- Automatic detection of compatible BLE write mode
- Asynchronous operation using asyncio
- Any number of batteries in parallel
- 100% test coverage plus fuzz tests for BLE data
Supported Devices
The list of supported devices is maintained in the repository of the related Home Assistant integration. For details about the supported data per BMS, please have a look at BMS data table:
- A
✓means that the field is directly available from the BMS. - A
.means that the field is not natively available, but all required fields for its calculation are available. - Empty means that the field is not available at all.
API documentation
The project uses pdoc to generate the API documentation. You can generate it locally using the installation for development and then running the command
pdoc -d google aiobmsble aiobmsble.basebms aiobmsble.exceptions aiobmsble.utils aiobmsble.plugin aiobmsble.test_data aiobmsble.bms -o docs
which will generate the documentation locally in the /docs folder.
Usage
In order to identify all devices that are reachable and supported by the library, simply run
aiobmsble
from the command line after installation.
aiobmsble --json '{"local_name": "dummy"}'
returns the BMS type using the JSON advertisement data, e.g. from Home Assistant Bluetooth Advertisement Monitor.
From your Python code
To include the library in your own code, see the quick start and the API documentation.
From a Script
See the minimal example in the /examples folder. It scans for a device by name and prints its sensor data.
Exceptions
Public operations raise exceptions derived from BMSError. retryable distinguishes
temporary failures from configuration or authentication errors that require user action.
All exception classes are described in the API documentation.
from aiobmsble import BMSAuthError, BMSConfigError, BMSError
try:
data = await bms.update()
except BMSAuthError:
# Ask for a new secret/PIN and stop polling until it is provided.
pass
except BMSConfigError:
# Fix the application configuration.
pass
except BMSError as exc:
if exc.retryable:
# Mark the device unavailable and retry at the next poll interval.
pass
Testing
For integration tests (using pytest) the library provides advertisement data that can be used to verify detection of BMSs. For your tests you can use
from aiobmsble.test_data import bms_advertisements
def test_advertisements() -> None:
"""Run some tests with the advertisements"""
for advertisement, mac_address, bms_type, _comments in bms_advertisements():
...
Installation
Install python and pip if you have not already, then run:
pip3 install pip --upgrade
For Production:
pip3 install aiobmsble
This will install the latest library release and all of its python dependencies.
To use all features of the aiobmsble command-line tool, e.g. the OUI vendor check of --json, install the cli extra:
pip3 install "aiobmsble[cli]"
For Development:
git clone https://github.com/patman15/aiobmsble.git
cd aiobmsble
pip3 install -e .[dev]
pre-commit install
This gives you the latest library code from the main branch. pre-commit install enables the automatic checks on each commit.
Troubleshooting
In case you have problems with the library, please enable debug logging. You can also run aiobmsble -v from the command line in order to query all known BMS that are reachable.
In case you have troubles you'd like to have help with
- please record a debug log using
aiobmsble -v -l debug.log, - open an issue with a good description of what your question/issue is and attach the log, or
- open a bug if you think the behaviour you see is misbehaviour of the library, including a good description of what happened, your expectations,
- and put the
debug.logas attachment to the issue.
Thanks to
@gkathan, @downset, @gerritb, @Goaheadz, @alros100, @majonessyltetoy, @snipah, @Gruni22, @azisto, @BikeAtor, @Karatzie, @PG248, @SkeLLLa,@romanshypovskyi, @riogrande75, @ebagnoli, @andreas-bulling, @goblinmaks, @andreitoma-github, @hacsler, @ViPeR5000, @edelstahlratte, @nezra, @Fandu21, @rubenclark74, @geierwally1978, @Tulexcorp, @oliviercommelarbre, @shaf, @gavrilov, @SOLAR-RAIDER, @prodisz, @thecodingmax, @daubman, @krahabb, @ardeus-ua, @GlennDC, @hhgerhard-google, @crotwell, @dschenzer, @randyoo, @wilcox97, @darrenjackson72, @nostroff, @ppvadmin @admlaz, @ryanalden, @hflocki, @danilos2k, @hlathome, @MartinusTech, @vtacquet, @pwbpease, @sdeguzman, hardtomakeanadress
for helping with making the library better.
References
- ANT BMS: esphome-ant-bms, ant-bms-ble
- Daly BMS: esp32-smart-bms-simulation
- EG4 BMS: dbus-serialbattery
- Jikong BMS: esphome-jk-bms
- JBD BMS: esphome-jbd-bms
- D-powercore BMS: Strom BMS monitor
- Pro BMS: @daubman
- Redodo BMS: LiTime BMS Bluetooth
- TianPower BMS: esphome-tianpower-bms
- Greenway BMS: surron-light-bee
Metadata
Release files for aiobmsble 1.0.0b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiobmsble-1.0.0b2.tar.gz | 314.5 kB | With provenance | Details for aiobmsble-1.0.0b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiobmsble-1.0.0b2-py3-none-any.whl | Python 3 | none | any | Details for aiobmsble-1.0.0b2-py3-none-any.whl |
Total release size: 522.0 kB
Release files / aiobmsble-1.0.0b2.tar.gz
| Download URL | aiobmsble-1.0.0b2.tar.gz |
|---|---|
| Size | 314.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b554102cc35fcc20c30f3bf147fb7a88a3f82b1084e75911ea60bda83ad1c146
|
|
BLAKE2b-256 checksum How to use checksums |
f3198a5da36b61f186bfbd600997dd64ebe3e8642eb2d2732b138bea25a0ce73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 26, 2026.
Transparency logRelease files / aiobmsble-1.0.0b2-py3-none-any.whl
| Download URL | aiobmsble-1.0.0b2-py3-none-any.whl |
|---|---|
| Size | 207.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f15ee5b9ee74536590437c846bc2afd6b3f7e84ac3b78e423c4b7df8d86643f9
|
|
BLAKE2b-256 checksum How to use checksums |
074ab01f6ab91a1e61587ef4f8d43b30fac818882193e3b620b6818bf009d1e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 26, 2026.
Transparency logSecurity for aiobmsble 1.0.0b2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aiobmsble-1.0.0b2.tar.gz
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 Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.