Skip to main content

bluebattery.py

Software for interacting with the BlueBattery line of battery computers for RVs.

Features:

  • Reading of periodically sent measurements
  • Publishes value to an MQTT broker
  • Auto-discovery of BB devices
  • Access to stored logs
  • Homeassistant support
  • Modification of device settings
  • Firmware update

Changelog

2026-01-05: Support for Homeassistant 2023-01-14: Moved to bleak library. This should make the software much more reliable. Multiple devices are now supported and the MQTT topic has changed to include the device address.

Installation

To install the latest published version:

sudo apt-get install python3-pip
# log out and in again to apply new environment variables 
pip3 install bluebattery-py

To install the latest version from this git repository:

sudo apt-get install python3-pip
# log out and in again to apply new environment variables 
pip3 install git+https://github.com/danielfett/bluebattery.py.git

Setting up a Systemd Service

See the systemd service file for details.

Reading values from the command line

$ bb_cli log

If you want to see more details of what is going on, use the debug flag:

$ bb_cli --log-level DEBUG log

Publishing values to an MQTT server

If you want to use the MQTT features, start the MQTT publisher using

$ bb_cli mqtt

Append --help to see the configuration options.

This is an example of the values published to the MQTT broker:

service/bluebattery/FC:45:C3:CA:FF:EE/live/solar_charger_ext/max_solar_current_day_A 0.0
service/bluebattery/FC:45:C3:CA:FF:EE/live/solar_charger_ext/max_solar_watt_day_W 0.0
service/bluebattery/FC:45:C3:CA:FF:EE/live/solar_charger_ext/solar_charge_day_Ah 0.0
service/bluebattery/FC:45:C3:CA:FF:EE/live/solar_charger_ext/solar_energy_day_Wh 0
service/bluebattery/FC:45:C3:CA:FF:EE/live/solar_charger_ext/solar_charger_status 1
service/bluebattery/FC:45:C3:CA:FF:EE/live/solar_charger_ext/solar_module_voltage_V 0.0
service/bluebattery/FC:45:C3:CA:FF:EE/live/solar_charger_ext/relay_status RelayStatus()
service/bluebattery/FC:45:C3:CA:FF:EE/live/battery_comp_1/battery_charge_Ah 158.48
service/bluebattery/FC:45:C3:CA:FF:EE/live/battery_comp_1/state_of_charge_percent 83.4
service/bluebattery/FC:45:C3:CA:FF:EE/live/battery_comp_1/max_battery_current_day_A 0.0
service/bluebattery/FC:45:C3:CA:FF:EE/live/battery_comp_1/min_battery_current_day_A -1.1
service/bluebattery/FC:45:C3:CA:FF:EE/live/battery_comp_1/max_battery_charge_day_Ah 16.16
service/bluebattery/FC:45:C3:CA:FF:EE/live/battery_comp_1/min_battery_charge_day_Ah 15.84
service/bluebattery/FC:45:C3:CA:FF:EE/live/battery_comp_1/max_battery_voltage_day_V 12.54
service/bluebattery/FC:45:C3:CA:FF:EE/live/battery_comp_1/min_battery_voltage_day_V 12.5
service/bluebattery/FC:45:C3:CA:FF:EE/live/info/battery_voltage_V 12.61
service/bluebattery/FC:45:C3:CA:FF:EE/live/info/starter_battery_voltage_V 12.43

Use --prefix BBX to pass a specific device name. In this example, BBX.

For using the bb_mqtt as daemon see here.

Troubleshooting

Depending on your environment, you may need to enable BLE first or to set up your linux user to allow using BLE:

Enabling Bluetooth LE

If the above command does not work out-of-the-box, you might have to enable Bluetooth Low-Energy.

On Ubuntu, add the following two lines at the bottom of /etc/bluetooth/main.conf:

EnableLE=true
AttributeServer=true

Then restart bluetooth: sudo service bluetooth restart

On the Raspberry Pi

This software works on a Raspberry Pi and was tested with the built-in bluetooth device. To use the software as the user pi (recommended!), you need to make the dbus policy changes described here.

Metadata

Release files for bluebattery-py 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bluebattery-py 1.2.0
File Size Uploaded
bluebattery_py-1.2.0.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bluebattery-py 1.2.0
File Interpreter ABI Platform
bluebattery_py-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.3 kB

Release files / bluebattery_py-1.2.0.tar.gz

Download URL bluebattery_py-1.2.0.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dc089fee3108fdc8bf4e4e5fc82cd8d8e1f4a207d85bfde91614a44312995ef9
BLAKE2b-256 checksum
How to use checksums
87c2d6d1e6f47fcfb28d5d76035f94ae8cd2527acd264dc1fa52ad9ed4a14a84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Jan 5, 2026.

Transparency log

Release files / bluebattery_py-1.2.0-py3-none-any.whl

Download URL bluebattery_py-1.2.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b88300fa08d6ad7d00002e35320a0fd8fe56b2ff0899194b6cdee71955e03e6
BLAKE2b-256 checksum
How to use checksums
7d919256384f2c4e7fe2bb09ceb2123e89e695f3215ccbf4e9f019dfb33d0366
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Jan 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page