{"id":15653762,"url":"https://github.com/syssi/esphome-pace-bms","last_synced_at":"2025-04-10T00:17:25.312Z","repository":{"id":181241661,"uuid":"666454536","full_name":"syssi/esphome-pace-bms","owner":"syssi","description":"ESPHome component to monitor and control a PACE Battery Management System (PACE-BMS) via RS485 (Modbus)","archived":false,"fork":false,"pushed_at":"2025-03-03T09:41:57.000Z","size":2199,"stargazers_count":54,"open_issues_count":3,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T00:17:20.824Z","etag":null,"topics":["esphome","esphome-component","hacktoberfest","modbus","uart"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syssi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"buy_me_a_coffee":"syssi"}},"created_at":"2023-07-14T14:58:43.000Z","updated_at":"2025-03-19T21:14:54.000Z","dependencies_parsed_at":"2023-07-14T16:36:50.859Z","dependency_job_id":"f90f758a-f68e-4f9e-b56d-0d82e3adafec","html_url":"https://github.com/syssi/esphome-pace-bms","commit_stats":{"total_commits":43,"total_committers":6,"mean_commits":7.166666666666667,"dds":"0.16279069767441856","last_synced_commit":"e54550c064586cf442a49c373b565473850a50d3"},"previous_names":["syssi/esphome-pace-bms"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syssi%2Fesphome-pace-bms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syssi%2Fesphome-pace-bms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syssi%2Fesphome-pace-bms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syssi%2Fesphome-pace-bms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syssi","download_url":"https://codeload.github.com/syssi/esphome-pace-bms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131318,"owners_count":21052820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esphome","esphome-component","hacktoberfest","modbus","uart"],"created_at":"2024-10-03T12:46:58.644Z","updated_at":"2025-04-10T00:17:25.288Z","avatar_url":"https://github.com/syssi.png","language":"Shell","funding_links":["https://buymeacoffee.com/syssi","https://www.buymeacoffee.com/syssi"],"categories":[],"sub_categories":[],"readme":"# esphome-pace-bms\n\n![GitHub actions](https://github.com/syssi/esphome-pace-bms/actions/workflows/ci.yaml/badge.svg)\n![GitHub stars](https://img.shields.io/github/stars/syssi/esphome-pace-bms)\n![GitHub forks](https://img.shields.io/github/forks/syssi/esphome-pace-bms)\n![GitHub watchers](https://img.shields.io/github/watchers/syssi/esphome-pace-bms)\n[![\"Buy Me A Coffee\"](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg)](https://www.buymeacoffee.com/syssi)\n\nESPHome configuration to monitor and control a PACE Battery Management System (PACE-BMS) via RS485 (Modbus)\n\nThis project implements the `PACE_MODBUS` protocol. Please use the RS485 port next to the CAN bus port and enable the protocol using the `PbmsTools.exe` (System Config -\u003e Inverter protocol -\u003e RS485 Protocol).\n\n## Supported devices\n\n* Katbatt 6.4kWh LiFePO4 Stackable Battery, PACE BMS P16S200A (`P16S200A-21473-1.03A310771030800025A`), using RS485 protocol `PACE_MODBUS`\n* PACE BMS P16S200A with firmware version 3 (`P16S200A-21382-3.00T213822131800670H`), using RS485 protocol `PACE_MODBUS` ([#20](https://github.com/syssi/esphome-pace-bms/issues/20))\n* Gobel Power GP-SR1-LF280-RN150 51.2V 280Ah, PACE BMS S16A150 (`JLD-BMS-S16A150`), using RS485 protocol `ModbusC1636`\n* Joyvoit Suns Energy Battery JVBW5KW, PACE BMS P16S100A (`P16S100A-21468-1.00`), using RS485 protocol `PACE_MODBUS` ([#19](https://github.com/syssi/esphome-pace-bms/issues/19))\n* Orient Power Wall Mounted Battery 48V100AH, PACE BMS P16S100A-21236-2.01 ([#31](https://github.com/syssi/esphome-pace-bms/discussions/31))\n* SOK 100Ah 48V Server Rack Berry, PACE BMS P16S100A (`P16S100A-1B470-4.07`), using RS485 protocol `PACE_MODBUS` ([#35](https://github.com/syssi/esphome-pace-bms/issues/35))\n* SOK 100Ah 48V Server Rack Berry, PACE BMS P16S100A (`P16S100A-1B470-4.00`), using RS485 protocol `PACE_MODBUS` ([#38](https://github.com/syssi/esphome-pace-bms/discussions/38))\n* MeritSun / i-finity LFP 200 - 48V (Modbus must be enabled by pbmstool.exe) ([#29](https://github.com/syssi/esphome-pace-bms/issues/29))\n* Revov R100 51.2V 100Ah, PACE BMS P16S100A (`P16S100A-12720-4.05G`), using RS485 protocol `SRNE` ([#39](https://github.com/syssi/esphome-pace-bms/issues/39))\n* NPP 51.2v 280AH FLCD-30048 NSFG280F10/DS, PACE BMS P16S200A (`P16S200A-21452-2.02`) using RS485 protocol `PACE_MODBUS` ([#60](https://github.com/syssi/esphome-pace-bms/discussions/60))\n* PowMr 51.2V 100Ah, PACE BMS P16S150A (`P16S150A-41034-1.00`), using RS485 protocol `PACE_MODBUS` ([#65](https://github.com/syssi/esphome-pace-bms/issues/65))\n\n## Untested devices\n\n* Jakiper/BSLBATT 100Ah, PACE BMS P16S100A\n* LIONTRON LiFePO4 LX48-100, 48V 100Ah\n* Shenzen Delong 24V 100Ah, PACE BMS P16S200A-PC1547\n* Hubble Lithium (AM2, AM4)\n* Revov R9\n* Greenrich U-P5000\n\n## Schematics\n\n```\n                  RS485                      UART\n┌────────────┐              ┌──────────┐                ┌─────────┐\n│            │              │          │\u003c----- RX -----\u003e│         │\n│    PACE    │\u003c-----B- ----\u003e│  RS485   │\u003c----- TX -----\u003e│ ESP32/  │\n│    BMS     │\u003c---- A+ ----\u003e│  to TTL  │\u003c----- GND ----\u003e│ ESP8266 │\n│            │\u003c--- GND ----\u003e│  module  │\u003c----- 3.3V ---\u003e│         │\u003c-- VCC\n│            │              │          │                │         │\u003c-- GND\n└────────────┘              └──────────┘                └─────────┘\n\n```\n\nPlease make sure to power the RS485 module with 3.3V because it affects the TTL (transistor-transistor logic) voltage between RS485 module and ESP.\n\n### RJ45 jack\n\n|  Pin  | Purpose | RS485-to-TTL pin | Color T-568B |\n|:-----:|:--------|:-----------------|--------------|\n| **1** | **B-**  | **B-**           | Orange-White |\n| **2** | **A+**  | **A+**           | Orange       |\n| **3** | **GND** | **GND**          | Green-White  |\n|   4   | NC      |                  |              |\n|   5   | NC      |                  |              |\n|   6   | GND     |                  |              |\n|   7   | A+      |                  |              |\n|   8   | B-      |                  |              |\n\nPlease be aware of the different RJ45 pinout colors ([T-568A vs. T-568B](images/rj45-colors-t568a-vs-t568.png)).\n\n### BMS address\n\n| Module address | BMS Module ID | Dip1 | Dip2 | Dip3 | Dip4 |\n|:---------------|:--------------|-----:|-----:|-----:|-----:|\n| `0x00`         | 0             |  off |  off |  off |  off |\n| `0x01`         | 1             |   on |  off |  off |  off |\n| `0x02`         | 2             |  off |   on |  off |  off |\n| `0x03`         | 3             |   on |   on |  off |  off |\n| `0x04`         | 4             |  off |  off |   on |  off |\n| `0x05`         | 5             |   on |  off |   on |  off |\n| `0x06`         | 6             |  off |   on |   on |  off |\n| `0x07`         | 7             |   on |   on |   on |  off |\n| `0x08`         | 8             |  off |  off |  off |   on |\n| `0x09`         | 9             |   on |  off |  off |   on |\n| `0x0A`         | 10            |  off |   on |  off |   on |\n| `0x0B`         | 11            |   on |   on |  off |   on |\n| `0x0C`         | 12            |  off |  off |   on |   on |\n| `0x0D`         | 13            |   on |  off |   on |   on |\n| `0x0E`         | 14            |  off |   on |   on |   on |\n| `0x0F`         | 15            |   on |   on |   on |   on |\n\n\n## Requirements\n\n* [ESPHome 2024.6.0 or higher](https://github.com/esphome/esphome/releases).\n* Generic ESP32 or ESP8266 board\n\n## Installation\n\nUse the `esp32-example.yaml` as proof of concept:\n\n```bash\n# Install esphome\npip3 install esphome\n\n# Clone this project\ngit clone https://github.com/syssi/esphome-pace-bms.git\ncd esphome-pace-bms\n\n# Create a secrets.yaml containing some setup specific secrets\ncat \u003e secrets.yaml \u003c\u003cEOF\nwifi_ssid: MY_WIFI_SSID\nwifi_password: MY_WIFI_PASSWORD\n\nmqtt_host: MY_MQTT_HOST\nmqtt_username: MY_MQTT_USERNAME\nmqtt_password: MY_MQTT_PASSWORD\nEOF\n\n# Validate the configuration, create a binary, upload it, and start logs\n# If you use a esp8266 run the esp8266-examle.yaml\nesphome run esp32-example.yaml\n```\n\n## Example response all sensors enabled\n\n```\nTBD.\n```\n\n## Known issues and limitations\n\nNone.\n\n## Protocol\n\nSee [docs/PACE-BMS-Modbus-Protocol-for-RS485-V1.3-20170627.pdf](docs/PACE-BMS-Modbus-Protocol-for-RS485-V1.3-20170627.pdf).\n\nThe protocol is Modbus RTU via RS485.\n\n| Addr | Description                            | Len | R/W |   Type | Unit   |                                   |\n|-----:|:---------------------------------------|----:|:----|-------:|:-------|:----------------------------------|\n|    0 | Current                                |   2 | R   |  int16 | 10mA   |                                   |\n|    1 | Voltage of pack                        |   2 | R   | uint16 | 10mV   |                                   |\n|    2 | State of charge                        |   2 | R   |  uint8 | %      | 0~100%                            |\n|    3 | SOH                                    |   2 | R   |  uint8 | %      | 0~100%                            |\n|    4 | Remain capacity                        |   2 | R   | uint16 | 10mAH  |                                   |\n|    5 | Full capacity                          |   2 | R   | uint16 | 10mAH  |                                   |\n|    6 | Design capacity                        |   2 | R   | uint16 | 10mAH  |                                   |\n|    7 | Charging cycles count                  |   2 | R   | uint16 |        |                                   |\n|    9 | Warning flag                           |   2 | R   | uint16 | Hex    | See ^1                            |\n|   10 | Protection flag                        |   2 | R   | uint16 | Hex    | See ^2                            |\n|   11 | Status/Fault flag                      |   2 | R   | uint16 | Hex    | See ^3                            |\n|   12 | Balance status                         |   2 | R   | uint16 | Hex    |                                   |\n|   15 | Cell voltage 1                         |   2 | R   | uint16 | mV     |                                   |\n|   16 | Cell voltage 2                         |   2 | R   | uint16 | mV     |                                   |\n|   17 | Cell voltage 3                         |   2 | R   | uint16 | mV     |                                   |\n|   18 | Cell voltage 4                         |   2 | R   | uint16 | mV     |                                   |\n|   19 | Cell voltage 5                         |   2 | R   | uint16 | mV     |                                   |\n|   20 | Cell voltage 6                         |   2 | R   | uint16 | mV     |                                   |\n|   21 | Cell voltage 7                         |   2 | R   | uint16 | mV     |                                   |\n|   22 | Cell voltage 8                         |   2 | R   | uint16 | mV     |                                   |\n|   23 | Cell voltage 9                         |   2 | R   | uint16 | mV     |                                   |\n|   24 | Cell voltage 10                        |   2 | R   | uint16 | mV     |                                   |\n|   25 | Cell voltage 11                        |   2 | R   | uint16 | mV     |                                   |\n|   26 | Cell voltage 12                        |   2 | R   | uint16 | mV     |                                   |\n|   27 | Cell voltage 13                        |   2 | R   | uint16 | mV     |                                   |\n|   28 | Cell voltage 14                        |   2 | R   | uint16 | mV     |                                   |\n|   29 | Cell voltage 15                        |   2 | R   | uint16 | mV     |                                   |\n|   30 | Cell voltage 16                        |   2 | R   | uint16 | mV     |                                   |\n|   31 | Battery temperature 1                  |   2 | R   |  int16 | 0.1 ℃  |                                   |\n|   32 | Battery temperature 2                  |   2 | R   |  int16 | 0.1 ℃  |                                   |\n|   33 | Battery temperature 3                  |   2 | R   |  int16 | 0.1 ℃  |                                   |\n|   34 | Battery temperature 4                  |   2 | R   |  int16 | 0.1 ℃  |                                   |\n|   35 | MOSFET temperature                     |   2 | R   |  int16 | 0.1 ℃  | or invalid                        |\n|   36 | Environment temperature                |   2 | R   |  int16 | 0.1 ℃  | or invalid                        |\n|   60 | Pack OV alarm                          |   2 | RW  | uint16 | mV     |                                   |\n|   61 | Pack OV protection                     |   2 | RW  | uint16 | mV     |                                   |\n|   62 | Pack OV release protection             |   2 | RW  | uint16 | mV     |                                   |\n|   63 | Pack OV protection delay time          |   2 | RW  |  uint8 | 0.1S   | 1~255                             |\n|   64 | Cell OV alarm                          |   2 | RW  | uint16 | mV     |                                   |\n|   65 | Cell OV protection                     |   2 | RW  | uint16 | mV     |                                   |\n|   66 | Cell OV release protection             |   2 | RW  | uint16 | mV     |                                   |\n|   67 | Cell OV protection delay time          |   2 | RW  |  uint8 | 0.1S   | 1~255                             |\n|   68 | Pack UV alarm                          |   2 | RW  | uint16 | mV     |                                   |\n|   69 | Pack UV protection                     |   2 | RW  | uint16 | mV     |                                   |\n|   70 | Pack UV release protection             |   2 | RW  | uint16 | mV     |                                   |\n|   71 | Pack UV protection delay time          |   2 | RW  |  uint8 | 0.1S   | 1~255                             |\n|   72 | Cell UV alarm                          |   2 | RW  | uint16 | mV     |                                   |\n|   73 | Cell UV protection                     |   2 | RW  | uint16 | mV     |                                   |\n|   74 | Cell UV release protection             |   2 | RW  | uint16 | mV     |                                   |\n|   75 | Cell UV protection delay time          |   2 | RW  |  uint8 | 0.1S   | 1~255                             |\n|   76 | Charging OC alarm                      |   2 | RW  | uint16 | A      |                                   |\n|   77 | Charging OC protection                 |   2 | RW  | uint16 | A      |                                   |\n|   78 | Charging OC protection delay time      |   2 | RW  |  uint8 | 0.1S   | 1~255                             |\n|   79 | Discharging OC alarm                   |   2 | RW  | uint16 | A      |                                   |\n|   80 | Discharging OC protection              |   2 | RW  | uint16 | A      |                                   |\n|   81 | Discharging OC protection delay time   |   2 | RW  |  uint8 | 0.1S   | 1~255                             |\n|   82 | Discharging OC-2 protection            |   2 | RW  | uint16 | A      |                                   |\n|   83 | Discharging OC-2 protection delay time |   2 | RW  |  uint8 | 0.025S | 1~255                             |\n|   84 | Charging OT alarm                      |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   85 | Charging OT protection                 |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   86 | Charging OT release protection         |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   87 | Discharging OT alarm                   |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   88 | Discharging OT protection              |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   89 | Discharging OT release                 |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   90 | Charging UT alarm                      |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   91 | Charging UT protection                 |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   92 | Charging UT release protection         |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   93 | Discharging UT alarm                   |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   94 | Discharging UT protection              |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   95 | Discharging UT release protection      |   2 | RW  |  int16 | 0.1 ℃  |                                   |\n|   96 | MOSFET OT alarm                        |   2 | RW  |  int16 | 0.1 ℃  | or invalid parameters in BMS-4820 |\n|   97 | MOSFET OT protection                   |   2 | RW  |  int16 | 0.1 ℃  | or invalid parameters in BMS-4820 |\n|   98 | MOSFET OT release protection           |   2 | RW  |  int16 | 0.1 ℃  | or invalid parameters in BMS-4820 |\n|   99 | Environment OT alarm                   |   2 | RW  |  int16 | 0.1 ℃  | or invalid parameters in BMS-4820 |\n|  100 | Environment OT protection              |   2 | RW  |  int16 | 0.1 ℃  | or invalid parameters in BMS-4820 |\n|  101 | Environment OT release protection      |   2 | RW  |  int16 | 0.1 ℃  | or invalid parameters in BMS-4820 |\n|  102 | Environment UT alarm                   |   2 | RW  |  int16 | 0.1 ℃  | or invalid parameters in BMS-4820 |\n|  103 | Environment UT protection              |   2 | RW  |  int16 | 0.1 ℃  | or invalid parameters in BMS-4820 |\n|  104 | Environment UT release protection      |   2 | RW  |  int16 | 0.1 ℃  | or invalid parameters in BMS-4820 |\n|  105 | Balance start cell voltage             |   2 | RW  | uint16 | mV     |                                   |\n|  106 | Balance start delta voltage            |   2 | RW  | uint16 | mV     |                                   |\n|  107 | Pack full-charge voltage               |   2 | RW  | uint16 | mV     |                                   |\n|  108 | Pack full-charge current               |   2 | RW  | uint16 | mA     |                                   |\n|  109 | Cell sleep voltage                     |   2 | RW  | uint16 | mV     |                                   |\n|  110 | Cell sleep delay time                  |   2 | RW  | uint16 | min    |                                   |\n|  111 | Short circuit protect delay time       |   2 | RW  |  uint8 | 25uS   | Max 500uS                         |\n|  112 | SOC alarm threshold                    |   2 | RW  |  uint8 | %      | 0~100%                            |\n|  113 | Charging OC-2 protection               |   2 | RW  | uint16 | A      |                                   |\n|  114 | Charging OC-2 protection delay time    |   2 | RW  |  uint8 | 0.025S | 1~255                             |\n|  150 | Version information                    |  20 | R   | uint16 | ASCII  |                                   |\n|  160 | Model SN                               |  20 | RW  | uint16 | ASCII  | BMS Manufacturer                  |\n|  170 | PACK SN                                |  20 | RW  | uint16 | ASCII  | PACK Manufacturer                 |\n\n## Known issues\n\nNone.\n\n## Debugging\n\nIf this example doesn't work out of the box for your device please update your configuration to enable the debug output of the UART component and increase the log level to the see outgoing and incoming serial traffic:\n\n```\nlogger:\n  level: DEBUG\n  # Don't write log messages to UART0 (GPIO1/GPIO3) if the BMS is connected to GPIO1/GPIO3\n  baud_rate: 0\n\nuart:\n  - id: uart_0\n    baud_rate: 9600\n    tx_pin: ${tx_pin}\n    rx_pin: ${rx_pin}\n    debug:\n      direction: BOTH\n      dummy_receiver: false\n```\n\n## References\n\n* https://www.akkudoktor.net/forum/bms-batterie-management-monitoring-system/pace-bms-informationssammlung/\n* https://docs.google.com/document/d/1JqBizjyOrAge02pO-S6asDoAJgEdHV0Ujbs3BCCvXLo/edit\n* https://powerforum.co.za/topic/13982-bms-pace-addon-for-home-assistant-as-used-by-hubbles-am-2-and-am-4/ (different protocol!)\n* https://github.com/fancyui/Gobel-Power-RN-BMS-RS485-ModBus (different protocol!)\n* https://github.com/Tertiush/bmspace (different protocol!)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyssi%2Fesphome-pace-bms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyssi%2Fesphome-pace-bms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyssi%2Fesphome-pace-bms/lists"}