Skip to main content

No project description provided

Project description

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
  • Modification of device settings
  • Firmware update

Changelog

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.

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

bluebattery_py-1.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

bluebattery_py-1.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file bluebattery_py-1.1.0.tar.gz.

File metadata

  • Download URL: bluebattery_py-1.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.2 Linux/6.2.0-32-generic

File hashes

Hashes for bluebattery_py-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e6b5b07a9c00fbafcdd07149436e29449e0cb8a2d37f4ed9d1eb16d1c1c6a25d
MD5 1552e66ff9268d361b5f354d48277d49
BLAKE2b-256 cf968f7dc001c1c7fa00d62dc0691974b5ff95db408c531911128f9328962ec6

See more details on using hashes here.

File details

Details for the file bluebattery_py-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: bluebattery_py-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.2 Linux/6.2.0-32-generic

File hashes

Hashes for bluebattery_py-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e67d4fc81121882e897f8939d9bea1209ef6c1ab432934289696f47accaf7ae
MD5 e64e802b33230e5b1899599b900258c9
BLAKE2b-256 2613bfa29082b94608fe1f32ec3a30fd861fa643aded09884235521a026e9338

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page