Skip to content
Projects

About

This integration allows to monitor Bluetooth Low Energy (BLE) battery management systems (BMS) from within Home Assistant.

Systems & Infrastructure

How these counts are measured

What you can do

  • Zero configuration
  • Auto detects compatible batteries
  • Supports ESPHome Bluetooth proxy
  • Any number of batteries in parallel

Measured star growth

in 24h
+2
in 7 days
+2
in 15 days
+2
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

BLE Battery Management Systems for Home Assistant

GitHub Release License Effort Marketplace

This integration allows to monitor Bluetooth Low Energy (BLE) battery management systems (BMS) from within Home Assistant. After installation, no configuration is required. You can use the ESPHome Bluetooth proxy to extend the Bluetooth coverage range. By using standard dashboard cards, it is easy to visualize the current state of remote batteries.

bms_ble

Features

  • Zero configuration
  • Auto detects compatible batteries
  • Supports ESPHome Bluetooth proxy
  • Any number of batteries in parallel
  • Native Home Assistant integration (works with all HA installation methods)
  • Readout of individual cell voltages to be able to judge battery health
  • 100% test coverage

Supported Devices

  • 123\SmartBMS gen3 (show up as 123\\SmartBMS)
  • ABC/SOK BMS (show up as ABC-…, SOK-…)
  • Allpowers power station
  • Buknuwo batteries (show up as CDZG…), MEYULMOL batteries (show up as MEY-…)
  • ANT BMS (show up as ANT-BLE…)
  • CBT Power BMS, Creabest batteries
  • D-powercore BMS (show up as DXB-…), Fliteboard batteries (show up as TBA-…)
  • Daly BMS (show up as DL-…)
    • 100Balance BMS
    • Bulltron batteries
  • Daren BMS (show up as DWF…), JBD with modified FW
  • Dometic Büttner Tempra batteries
  • E&J Technology BMS (show up as libatt…)
    • AG Automotive batteries (show up as AG...L…)
    • Chins batteries (show up as G-..V...Ah…)
    • Elektronicx batteries (show up as LT-…)
    • Lithtech batteries (show up as LT-12V-… or L-12V…)
    • Meritsun, PowerBoozt, Supervolt v1 (show up as SV12V…), and Volthium (show up as V-12V…) batteries
  • ECO-WORTHY + BW02 adapter (show up as ECO-WORTHY…)
    • DCHOUSE batteries (show up as DCHOUSE…)
  • Ective, Startcraft, Topband batteries (show up as $PFLAC…, NWJ20…, ZM20…)
  • EG4 LL BMS
    • Sungold batteries
  • E&J Pro BMS (show up as EJ…)
  • Eleksol batteries
  • Epoch Pro BMS
  • Felicity ESS (show up as F10…) and FLB batteries (show up as F07…)
  • Gobel Power BMS (show up as BMS-…)
    • Dyness AR1.2, Dyness AR2.5
  • HumsiENK Smart BMS (show up as HS…)
    • ECO-WORTHY (show up as ECO....)
  • JBD BMS, Jiabaida, Xiaoxiang (show up as JBD-…)
    • accurat batteries, Aolithium batteries, BasenGreen, Bulltron, CHINS, Cloud Energy, DCHOUSE, ECO-WORTHY, Epoch batteries
    • Eleksol, Elfhub, Fritz Berger, JavaEnegy, LANPWR, Liontron, Lossigy, Norström, OGRPHY, Perfektium, RVPOWER, Ultimatron batteries
    • SBL batteries (show up as SBL-…), Supervolt v3 batteries (show up as SX1…), Supervolt Jumbo (show up as SJ-…), Titan batteries (show up as TITAN-…)
    • Vanvolt batteries (show up as Vanvolt+…), Vatrer batteries
  • JK BMS, Jikong, (HW version ≥ 6 required)
  • KS48x00 series BMS (show up as BL-…, HSKS-… or KS-…)
    • BEMORY, Braun Power batteries
    • Docan Energy/power, Vanvolt Arctic Pro, VoltPolska batteries
  • Lithionics NeverDie smart BMS (show up as Li.-…)
  • LiPower BMS
    • Ective batteries, Ective BM X monitor
  • NEEY balancer (4th gen) (show up as GW-24S…), NEEY BMS v2
  • Offgridtec LiFePo4 Smart Pro: type A & B (show up as SmartBat-A… or SmartBat-B…)
  • PaceEX BMS (show up as PC-…)
  • Pro BMS Smart Shunt
    • Foxwell BT630
    • Leagend CM100
  • Redodo BMS
    • ECO-WORTHY (show up as T-12… or T-24…), LiTime, Power Queen, Starry Sea batteries S-*… or SS-*…
  • Renogy BMS, Renogy Pro BMS
  • Rolls VB series BMS
  • RoyPow (Fish) batteries
    • Lion Energy Safari
  • Pylontech RT series batteries (show up as RT12…, RT24…, RT48…)
  • Saftkiste BMS
  • Saihang BMS (show up as SH…)
    • Anenji, Aninerel, SANDISOLAR (show up as HL…) batteries
  • Seplos v2 (show up as BP[0-2]?)
  • Seplos v3 (show up as SP[00-199]B… or CSY…)
    • CEG Carmine Energia Gratis (show up as XZHX…)
  • SOK BMS (show up as SK12V… or SK24V…)
  • Super-B Epsilon BMS (show up as Epsilon-…)
  • Super-B Epsilon v2 BMS (show up as Epsilon…)
  • TDT BMS
    • Wattcycle batteries, Wattcycle Super Mini batteries, Enerdrive B-TEC
  • Topband BMS
    • Ective, Enerdrive B-TEC, KiloVault, LiFeBlue, Noovi, Startcraft, Wattstunde batteries
    • PowerXtreme batteries
  • TianPower BMS (show up as TP_…)
  • Vatrer BMS (show up as YYMMDDVVVAAAAxx (date, V, Ah))
    • C4S100 batteries (show up as C4S100IE…)
  • Volta Power Systems myVolta CAN BLE adapter (show up as VPS-…)
  • Wattstunde Nova Core

If you would like to get your battery/BMS supported please consider raising a pull request for aiobmsble following the contribution guidelines or raise a new issue giving your BMS/battery type in the title. Please provide the information requested by the template (see additional context).

Provided Information

[!CAUTION] This integration (including Home Assistant) shall not be used for safety relevant operations! The correctness or availability of data cannot be guaranteed (see warranty section of the license), since the implementation is mostly based on openly available information or non-validated vendor specifications. Further, issues with the Bluetooth connection, e.g. disturbances, can lead to unavailable or incorrect values.

Do not rely on the values to control actions that prevent battery damage, overheating (fire), or similar.

Platform Entity Unit Description Attributes
binary_sensor battery charging bool Indicates whether the battery is charging battery mode
sensor battery level % State of charge: 100% is full and 0% is empty
sensor battery health % Battery health, when provided by the BMS
sensor current A Positive while charging and negative while discharging Balance current and heater current, when provided
sensor cycles # Lifetime number of charge cycles
sensor power W Positive while charging and negative while discharging
sensor problem severity enum Worst reported problem level: ok, info, warn, protect or fault Problem code
sensor problem description text Worst reported problem with severity, followed by a count of further problems (e.g. Cell overvoltage (protect) +2), or OK count, problems (sorted worst first), kinds
sensor runtime h (native: s) Remaining discharge time to 0% SoC; unavailable while idle or charging
sensor stored energy Wh Currently stored energy
sensor temperature °C Average cell temperature, or average of all temperatures if no cell temperatures are reported
sensor voltage V Overall battery voltage
Diagnostic Entities
Platform Entity Unit Description Attributes
binary_sensor* balancer bool Indicates whether the battery balancer is active Cell states
binary_sensor* charge MOSFET bool Indicates whether the BMS charge MOSFET is activated
binary_sensor* discharge MOSFET bool Indicates whether the BMS discharge MOSFET is activated
binary_sensor* heater bool Indicates whether the battery is being heated
binary_sensor problem bool Indicates whether the BMS reports an issue or a plausibility check fails Problem code
sensor delta cell voltage V Maximum difference between any two cell voltages Cell voltages
sensor design capacity Ah Manufacturer design capacity, when provided by the BMS
sensor* highest cell voltage V Highest cell voltage
sensor* highest cell voltage index # 1-based index of a cell at the highest voltage
sensor* lowest cell voltage V Lowest cell voltage
sensor* lowest cell voltage index # 1-based index of a cell at the lowest voltage
sensor* link quality % Successful BMS queries over the last 100 update periods
sensor* RSSI dBm Bluetooth received signal strength indicator
sensor* individual temperatures °C One diagnostic sensor per temperature probe; created when at least two probes are reported

When the BMS reports multiple battery packs, pack-level sensors are added to a child device for each pack. These include battery level, health (when provided), current, cycles, power, stored energy, temperature, voltage, design capacity (when provided), and cell voltage diagnostics where available.

*) Entities marked with an asterisk are disabled by default. If required, enable the entities.

Installation

BMS_BLE is a default repository in HACS. Please follow the guidelines on how to use HACS if you haven't installed it yet. To add the integration to your Home Assistant instance, use this My button:

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Manual installation steps
  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called bms_ble.
  4. Download all the files from the custom_components/bms_ble/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to Configuration > Integrations click + Add Integration and search for "BLE Battery Management"

Removing the Integration

This integration follows standard integration removal. No extra steps are required.

To remove an integration instance from Home Assistant
  1. Go to Settings > Devices & services and select the integration card.
  2. From the list of devices, select the integration instance you want to remove.
  3. Next to the entry, select the three-dot menu. Then, select Delete.

Troubleshooting

[!NOTE] A lot of transient issues are due to problems with Bluetooth adapters. Most prominent example is the performance limitation of the internal Raspberry Pi BT adapter, resulting in, e.g., sometimes wrong data, when you have multiple devices. Please check the Home Assistant Bluetooth integration page for known issues and consider using a recommended high-performance adapter.

Known Issues

Elektronicx, Lithtech batteries Bluetooth is turned off, when there is no current. Thus, device will get unavailable / cannot be added.
Batteries with JBD BMS JBD BMS detection unfortunately needs to rely mainly on name patterns. If you renamed your battery it most likely will not be detected. I do appreciate issues being raised for new vendor naming schemes to ease the life of other users. To help, please follow the instructions in the last list item for non-detected devices.

Some JBD boards are matched by MAC OUI. If config flow reports no devices while the pack is idle at 0 A, BLE may not be advertising (similar to Elektronicx/Lithtech). Close the phone app, wake the pack briefly, and retry while it appears connectable in the advertisement monitor.

Dometic Büttner The device requires a password / token that you can retrieve with these instructions.
Dyness Junior Box Although the box advertises via Bluetooth an investigation found no way to extract BMS data from that connection. Thus the box cannot be supported.
JK BMS firmware 19.30+ Newer firmware of JK BMS seems to have a bug that causes [incompatibility with the Linux Bluetooth stack BlueZ](https://github.com/patman15/BMS_BLE-HA/issues/766#issuecomment-5337915104).
Liontron, MOBILEKTRO batteries These batteries need a shorter interval between queries. Be a bit patient to get them added and set a custom interval of about 9s to keep a stable connection, for MOBILEKTRO about 7s are required.
Litime batteries Versions of these batteries support a "Bluetooth encryption" feature. When enabled you cannot connect using this integration. Remove the 6-digit Bluetooth password to get them working.
Seplos v2 The internal Bluetooth adapter issues AT commands in regular intervals which can interfere with BMS messages causing them to be corrupted. This impacts data availability (link quality).

If your device is not recognized / initialized

  1. Check that your BMS type is listed as supported device
  2. If a name detection pattern is listed ("show up as"), make sure your device matches it, by renaming the device in the vendor app.
  3. Check the known issues for an entry for your BMS.
  4. Make sure that no other device is connected to the BMS, e.g. app on your phone
  5. Check that your are running the latest release of the integration
  6. Go to the advertisement monitor and verify that your device shows up there. Also, please ensure that your RSSI value is >= -75 dBm. If your device is missing or the RSSI value is -80 dBmor worse, please check your BT setup (is the device in range?).
  7. If you use a BT proxy, make sure you have set active: true; check the logs of the proxy if the device is recognized. Note: The Bluetooth proxy of Shelly devices does not support active connections and thus cannot be used.
  8. Check that you do not exceed the number of connections of your adapter, see Settings > Bluetooth
  9. Try setting your adapter to active scanning mode as some BMSs do not correctly advertise information otherwise. Please note the impact on power consumption when switching away from Auto.
  10. If above points did not help, please go to the Bluetooth integration. On your BT adapter select configure.
    1. Verify that you have connection slots available.
    2. Go to the advertisement monitor and click the device in question. Please provide the information in JSON format via the button copy to clipboard in a new issue giving your BMS/battery type in the title.

Some/all sensors go unavailable temporarily or permanently

In case sensors are reported unavailable please enable the diagnostic sensors, i.e. RSSI and link quality and check your connection quality. The value of link quality results from (temporarily) bad RSSI values, which are impacted by disturbances of the Bluetooth communication. Your quality should be at least fair according to the following table:

Quality link quality [%] RSSI [dBm]
excellent 98 to 100 -60 to high
good 90 to 98 -60 to -75
fair 80 to 90 -75 to -80
weak 60 to 80 -80 to -90
bad 0 to 60 -90 to low

Verify that you have a proper Bluetooth setup according to the recommendations for the Home Assistant Bluetooth Integrations, see this note. In case your RSSI level is fair or better, but still the sensors show unknown, please follow the instructions for opening an issue. Please attach

  • a debug log as a file,
  • diagnosis data as a file, and
  • a 24hrs diagram of RSSI and link quality sensor.

In case you have troubles you'd like to have help with

  • please enable the debug protocol for the BLE Battery Management integration,
  • restart Home Assistant, wait till it is fully started up,
  • reproduce the issue,
  • disable the log (Home Assistant will prompt you to download the log), and finally
  • 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 caused by the integration, including a good description of what happened, your expectations, and attach the log.

Energy Dashboard Integration

If you want your battery to be integrated with the Home Assistant energy dashboard you need to integrate the reported power value separately for charge and discharge power to two energy values. Here are the detailed steps for energy dashboard configuration in your configuration.yaml (you achieve the same result by configuring equivalent helpers):

Add two template sensors

template:
  - sensor:
    - unique_id: charge_power
      state: "{{ [states('sensor.smartbat_..._power') | float, 0] | max}}"
      unit_of_measurement: 'W'
      state_class: measurement
      device_class: power
      availability: "{{ has_value('sensor.smartbat_..._power') }}"
    - unique_id: discharge_power
      state: "{{ [states('sensor.smartbat_..._power') | float, 0] | min | abs}}"
      unit_of_measurement: 'W'
      state_class: measurement
      device_class: power
      availability: "{{ has_value('sensor.smartbat_..._power') }}"

Add two integration sensors

sensor:
  - platform: integration
    name: energy_in
    source: sensor.template_charge_power
  - platform: integration
    name: energy_out
    source: sensor.template_discharge_power

Then go to the energy dashboard configuration, add a battery system and set the two sensors energy_in and energy_out.

FAQ

My sensors show unknown/unavailable at startup!

The polling interval is 30 seconds. So at startup it takes a few minutes to detect the battery and query the sensors. Then data will be available.

Why is the RSSI sensor not updated or is unavailable?

The RSSI value is only measured by Home Assistant when a device is not connected. Thus, you will see updates only in case a connection is lost or after a restart. The integration by default tries to maintain a permanent connection to improve data availability and avoid constant reconnect not appreciated by some BMSs.

Can I set a custom polling interval?

Yes, but I strongly discourage that for stability reasons. If you still want to do so, please see the default way to define a custom interval by Home Assistant. Note that Bluetooth discoveries can take up to a minute in worst case. Thus, please expect side effects, when changing the default of 30 seconds!

Can I have the runtime in human readable format (using days)?

Yes, you can use a template sensor or a card to show templates, e.g. Mushroom template card with the following template:
{{ timedelta(seconds=int(states("sensor.smartbat_..._runtime"), 0)) }} results in e,g, 4 days, 4:20:00

How do I get the cell voltages as individual sensor for tracking?

The individual voltages are available as attribute to the delta voltage sensor. Click the sensor and at the bottom of the graph expand the attribute section. Alternatively, you can also find them in the developer tools. To create individual sensors, go to Settings > Devices & Services > Helper and add a template sensor for each cell you want to monitor. Fill the configuration for, e.g. the first cell (0), as follows:

Field Content
State template {{ iif(has_value("sensor.smartbat_..._delta_cell_voltage"), state_attr("sensor.smartbat_..._delta_cell_voltage", "cell_voltages")[0], None) }}
The index [0] can be in the range from 0 to the number of cells-1, i.e. 0-3 for a 4 cell battery.
Unit of measurement V
Device class Voltage
State class Measurement
Device smartbat_...

or add the following snippet to your configuration.yaml:

template:
  - sensor:
    - name: cell_voltage_0
      state: >-
        {{ state_attr('sensor.smartbat_..._delta_cell_voltage', 'cell_voltages')[0] }}
      unit_of_measurement: 'V'
      state_class: measurement
      device_class: voltage
      availability: >- 
        {{ has_value('sensor.smartbat_..._delta_cell_voltage') }}

There are plenty more functions you can use, please see templating.

I need a discharge sensor not the charging indicator, can I have that?

Sure, use, e.g. a threshold sensor based on the current to/from the battery. Negative means discharging, positive is charging.

How can I determine a faulty cell?

Setup a graph that shows the highest/lowest cell voltage together with the highest/lowest cell voltage index. That way you can determine over time, which cell deviates the most and when. See the example below. cell history graph

My BMS needs a pin, how can I enter it?

Then you need to pair your device first. This is procedure is only required once for each device.

  • Open a terminal to Home Assistant.
  • Use the command bluetoothctl devices to check that your devices is detected and
  • run bluetoothctl pair <MAC_of_BMS> to start pairing the device.

Once pairing is done, the integration should automatically detect the BMS.

Can I have control functionality of my BMS integrated?

BMSs are safety critical devices. Incorrect parameter settings can harm the battery, shorten its lifespan, or even cause severe damage to the device or its surroundings.

For that reason, I currently avoid implementing any control functions, as there is no official documentation available for them. This helps prevent unintended commands or side effects that could arise from firmware changes, Bluetooth issues, or similar factors. In addition, several manufacturers have expressed concerns about third‑party applications interfering with the intended use of their products. Consequently, I focus exclusively on monitoring functionality.

I would reconsider this position if vendors were to publish official documentation on their websites.

Outlook

Thanks to

all contributors of aiobmsble (the BMS library) for helping with making the integration better.

References

Explore related projects

Loading…