{
  "added_at": "2026-11-09",
  "additional_evidence_urls": [
    "https://github.com/KrystianD/bm2-battery-monitor/blob/494a39c5edfbf5c76906469f0da545e42882b28c/.docs/reverse_engineering.md",
    "https://github.com/KrystianD/bm2-battery-monitor/blob/494a39c5edfbf5c76906469f0da545e42882b28c/bm2_python/src/bm2/client.py",
    "https://github.com/KrystianD/bm2-battery-monitor/blob/494a39c5edfbf5c76906469f0da545e42882b28c/bm2_python/src/bm2/encryption.py",
    "https://github.com/KrystianD/bm2-battery-monitor/blob/494a39c5edfbf5c76906469f0da545e42882b28c/bm2_esphome/bm2.yaml",
    "https://github.com/KrystianD/bm2-battery-monitor/blob/494a39c5edfbf5c76906469f0da545e42882b28c/bm2_esphome/main.yaml",
    "https://github.com/KrystianD/bm2-battery-monitor/blob/494a39c5edfbf5c76906469f0da545e42882b28c/bm2_python/requirements.txt",
    "https://github.com/KrystianD/bm2-battery-monitor/blob/494a39c5edfbf5c76906469f0da545e42882b28c/pyproject.toml",
    "https://github.com/KrystianD/bm2-battery-monitor/blob/494a39c5edfbf5c76906469f0da545e42882b28c/LICENSE.txt",
    "https://github.com/KrystianD/bm2-battery-monitor/pull/28"
  ],
  "category": "reconstruction-cases",
  "class": "hardware",
  "description_en": "Reimplements the Bluetooth Low Energy protocol of the BM2 (Battery Monitor 2) car battery monitor for independent voltage readings. A Python client built on Bleak decrypts the monitor's AES-encrypted notifications to read the current voltage and request the stored voltage history, an ESPHome template exposes the voltage from an ESP32, and example apps view and dump readings or forward them over MQTT. The author's write-up reports that the key and packet layout were recovered from the vendor app; results are author- and contributor-reported.",
  "description_zh": "重新实现 BM2（Battery Monitor 2）汽车电池监测器的低功耗蓝牙协议，使其读数无需厂商的 Android 应用即可使用。基于 Bleak 的 Python 客户端会解密监测器以 AES 加密的通知，读取当前电压并请求设备存储的电压历史；ESPHome 模板可在 ESP32 上提供电压读数，示例应用则用于查看、导出读数或通过 MQTT 转发。作者的说明称密钥和数据包格式是从厂商应用中恢复的；结果均为作者及贡献者报告。",
  "entry_url": "https://awesomerea.org/resources/bm2-battery-monitor-ble-case/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/bm2-battery-monitor-ble-case/",
  "evidence_url": "https://github.com/KrystianD/bm2-battery-monitor/blob/494a39c5edfbf5c76906469f0da545e42882b28c/README.md",
  "group": "cases",
  "id": "bm2-battery-monitor-ble-case",
  "json_url": "https://awesomerea.org/resources/bm2-battery-monitor-ble-case/record.json",
  "kind": "case-study",
  "markdown_url": "https://awesomerea.org/resources/bm2-battery-monitor-ble-case/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/bm2-battery-monitor-ble-case/index.md",
  "name": "BM2 Battery Monitor: reconstructing an encrypted BLE voltage protocol",
  "name_zh": "BM2 Battery Monitor：重建加密的 BLE 电压协议",
  "record_type": "resource",
  "relationship": "independent-reconstruction",
  "requirements": [
    "The bm2 0.1.0 package requires Python 3.8+. The client reads current voltage and history; history timestamps are inferred at two-minute intervals, while the ESPHome template reads current voltage only.",
    "Supply a BM2 monitor and its Bluetooth address. The client and ESPHome template include the AES-128-CBC key recovered from the vendor app.",
    "The Python client uses Bleak ~0.14.2 and PyCryptodome; its reconnect path calls Linux bluetoothctl. MQTT adds paho-mqtt ~1.6.1. The ESPHome template targets a nodemcu-32s ESP32 with Arduino, mbedtls and Wi-Fi, MQTT and MAC secrets.",
    "The repository has a mypy check but no tests or CI. The history fix reports testing on Linux Mint 22.3 with a PowerHouse BM2 N2099A; coverage of other BM2 models is unspecified.",
    "Code is MIT under LICENSE.txt; the device and vendor app retain their rights."
  ],
  "requirements_zh": [
    "bm2 0.1.0 包要求 Python 3.8+。客户端读取当前电压和历史记录；历史时间戳按两分钟间隔推算，ESPHome 模板只读取当前电压。",
    "需自备 BM2 监测器及其蓝牙地址。客户端和 ESPHome 模板包含从厂商应用恢复的 AES-128-CBC 密钥。",
    "Python 客户端使用 Bleak ~0.14.2 和 PyCryptodome；重连路径调用 Linux bluetoothctl。MQTT 示例另需 paho-mqtt ~1.6.1。ESPHome 模板面向采用 Arduino、mbedtls 的 nodemcu-32s ESP32，并需填写 Wi-Fi、MQTT 和 MAC 密钥配置。",
    "仓库有 mypy 检查，但没有测试或 CI。历史数据修复报告在 Linux Mint 22.3 和 PowerHouse BM2 N2099A 上测试；其他 BM2 型号的覆盖情况未说明。",
    "代码按 LICENSE.txt 采用 MIT；设备和厂商应用保留各自权利。"
  ],
  "targets": [
    "protocol"
  ],
  "url": "https://github.com/KrystianD/bm2-battery-monitor",
  "verification": "source-reviewed",
  "verified_at": "2026-10-20"
}
