JK BMS battery monitor over Bluetooth (ESPHome)

Reads cell voltages, current, power, state of charge and temperatures from a JK BMS over BLE and shows them in Home Assistant.

Level: Advanced Board: ESP32 DevKit V1 (WROOM-32) Power & blackouts

⚠ Safety

High-current battery: a short circuit can start a fire. Fuse the battery plus close to the battery, and never power the ESP32 straight from the battery bank. Read-only monitoring means you do not touch the power wiring.

What you need

Buy the parts kit · Estimated total: $4.00

ESP32 DevKit V1 (30 pin, WROOM-32) × 1
$4.00
Buy at AliExpress Buy at Amazon.com
🇺🇦 Ukraine🌍 Other countries

Ukraine: we buy and sell these parts ourselves, order them on this site.

Some links are affiliate links: we may earn a commission at no extra cost to you.

Wiring

ModuleModule pinESP32 pinNote
JK BMSBluetooth LEbuilt into ESP32no wires for the BLE variant; keep the ESP32 within 5 m
MAX3485 module (optional UART/RS485 variant)RX / TXGPIO16 / GPIO17only if you use the BMS RS485 port instead of BLE
OLED SDA / SCL (optional)I2CGPIO21 / GPIO22
Power5VUSB charger 5V 2Anever from the battery directly

Code

jk-bms-monitor.yaml
# JK BMS over Bluetooth LE with the community component syssi/esphome-jk-bms.
# Check the component README for the newest option names and your BMS protocol version.
esphome:
  name: jk-bms-monitor

esp32:
  board: esp32dev
  framework:
    type: esp-idf

external_components:
  - source: github://syssi/esphome-jk-bms@main
    refresh: 0s

logger:
api:
  encryption:
    key: !secret api_key
ota:
  - platform: esphome
    password: !secret ota_password
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

esp32_ble_tracker:

ble_client:
  - mac_address: AA:BB:CC:DD:EE:FF      # MAC of your JK BMS (see the nRF Connect app)
    id: client0

jk_bms_ble:
  - ble_client_id: client0
    protocol_version: JK02_32S           # JK04, JK02_24S or JK02_32S depending on the BMS
    throttle: 5s
    id: bms0

sensor:
  - platform: jk_bms_ble
    jk_bms_ble_id: bms0
    total_voltage:
      name: "Battery voltage"
    current:
      name: "Battery current"
    power:
      name: "Battery power"
    state_of_charge:
      name: "State of charge"
    min_cell_voltage:
      name: "Min cell voltage"
    max_cell_voltage:
      name: "Max cell voltage"
    delta_cell_voltage:
      name: "Cell voltage delta"
    temperature_sensor_1:
      name: "Battery temperature 1"
    power_tube_temperature:
      name: "BMS power tube temperature"

Flash a ready firmware from the browser Paste your error into the AI Error Doctor

Build tips

  • Find the BMS MAC address with the nRF Connect app and pick the right protocol_version for your BMS.
  • Keep the ESP32 within a few meters; for Daly or RS485 variants see the component README of the same author.

← ← All projects

Related ideas

⛔ High risk

Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.

Mains voltage monitor

Measures 220 V mains through an isolated ZMPT101B module and warns about sags, surges and blackouts in Telegram or Home Assistant.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●○ Intermediate
  • Build time 2–3 h
Pick parts / kit
⛔ High risk

High-current battery: a short circuit can start a fire. Put a fuse next to the battery plus, use thick enough wires and respect the BMS limits.

LiFePO4 / battery monitor

Shows voltage, current and power of a battery bank (INA219) so you know the real charge and load during outages.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●○ Intermediate
  • Build time 1–2 h
Pick parts / kit
⛔ High risk

Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.

Smart energy meter

Reads voltage, current, power and kWh with PZEM-004T and publishes them to a web page, MQTT or Home Assistant.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●○ Intermediate
  • Build time 2–4 h
Pick parts / kit

Comments

No comments yet. Share your experience or ask a question.

Comments are moderated.