40 Commits
Author SHA1 Message Date
Sleeper85 84c90c11d3 YamBMS Remote Packages example 2025-04-01 23:24:40 +02:00
Sleeper85 3dde676dd8 YamBMS Remote Packages JK-BMS RS485 Modbus 2025-04-01 23:22:56 +02:00
Sleeper85 42151934bf JK-PB RS485 bms sensors version 2025-04-01 22:32:54 +02:00
Sleeper85 a8233ea8c6 Update yambms_remote_packages_example.yaml 2025-03-26 20:09:31 +01:00
Sleeper85 01c443e321 Create board_ESP32_Generic_3xUART.yaml 2025-03-26 20:05:37 +01:00
Sleeper85 9977cc5963 Update yambms_remote_packages_example.yaml 2025-03-24 17:17:39 +01:00
Sleeper85 f357d23751 YamBMS remote packages example 2025-03-21 21:28:15 +01:00
Sleeper85 ae276bb0eb Set min_version to 2025.3.0 2025-03-21 19:44:25 +01:00
Sleeper85 f8b677a2b8 Merge pull request #31 from shvmm/main
Update device_base.yaml remove external component PR#7547 after merge
2025-03-21 19:38:45 +01:00
Shivam Maurya 17d5edb2f0 Update device_base.yaml 2025-03-21 17:24:41 +05:30
Shivam Maurya 3de5f0e080 Merge branch 'Sleeper85:main' into main 2025-03-21 17:20:34 +05:30
Sleeper85 c4313cc577 Fixed configuration error regarding RGB LED with ESP-IDF V5 2025-03-12 22:36:33 +01:00
Sleeper85 ea1859068d Create yambms_custom.yaml 2025-03-12 12:47:56 +01:00
Sleeper85 4115a33d87 Merge pull request #33 from 20after4/olimex-evb
Board package for olimex ESP32-EVB
2025-03-09 22:30:22 +01:00
Sleeper85 4d52c3bbf8 Merge pull request #30 from ogremustcrush/main
Update Supported_devices.md to add SRNE HESP48120U200-H
2025-03-09 22:25:54 +01:00
Mukunda Modell 3f9956f4d5 Board package for olimex ESP32-EVB 2025-03-08 05:35:15 -06:00
Shivam Maurya 3127c7b3d7 Update device_base.yaml
removed external component PR#7547 after merge
2025-02-25 13:30:08 +05:30
Sleeper85 da658defd8 Update README 2025-02-20 16:43:04 +01:00
ogremustcrush 4a0f3c6090 Update Supported_devices.md to add SRNE HESP48120U200-H 2025-02-07 12:05:34 -07:00
Sleeper85 d889d091f7 T-CAN485 chips SN65HVD231DR / MAX13487E 2025-02-07 14:56:09 +01:00
Sleeper85 bb764ceb01 Merge pull request #29 from andrewfraley/patch-1
Add LilyGo T-CAN485 w/ EG4 12000XP and JBD
2025-02-07 14:52:59 +01:00
Andy Fraley 7ec5fc02ac Add afraley 12000XP 2025-02-06 21:57:28 -05:00
Sleeper85 df3d9353b6 Fixed JK-PB dashboard min/max cells coloring bug 2025-02-06 18:11:29 +01:00
Sleeper85 8777dc8688 device_class warnings fixed 2025-01-30 23:33:00 +01:00
Sleeper85 c47b768573 Merge pull request #27 from MrPabloUK/Updated-Auto-Functions
Updated Auto Functions
2025-01-29 18:12:56 +01:00
MrPabloUK e336ac315c Corrected deadband check 2025-01-29 12:20:49 +00:00
Sleeper85 56fd51e5d4 Create RS485-protocol-pylon-low-voltage-V3.3-20180821.pdf 2025-01-29 02:25:17 +01:00
Sleeper85 edd3beb0de Note regarding charging settings 2025-01-28 18:22:10 +01:00
Sleeper85 5e1d7ac48e Update JK-ALL BLE BMS YAMLs 2025-01-28 18:21:14 +01:00
Sleeper85 c552360fe0 Added JBD BMS over Bluetooth 2025-01-28 18:18:42 +01:00
MrPabloUK 088caecd47 Formatting 2025-01-28 12:33:43 +00:00
MrPabloUK af59e4307c Updated version & update date 2025-01-28 12:10:51 +00:00
MrPabloUK b303244b77 Update yambms.yaml 2025-01-28 11:57:33 +00:00
MrPabloUK 91f961fcd6 Updated Auto CCL, DCL, CVL
Updated Auto CCL, DCL and CVL functions to return a delta value instead of absolute value
2025-01-28 11:55:17 +00:00
Sleeper85 f22ab83e19 Update bms_options_charging_logic.yaml 2025-01-27 22:58:39 +01:00
Sleeper85 97f9e38031 Update bms_options_charging_logic.yaml 2025-01-27 22:11:11 +01:00
Sleeper85 b4cd402337 BMS charging logic 1.1.2 2025-01-27 22:07:25 +01:00
Sleeper85 25a2a88366 Dashboard JK-PB battery_capacity_total_setting fixed 2025-01-27 19:25:17 +01:00
Sleeper85 bdda35a837 YamBMS DEMO firmware 1.5.4 2025-01-26 20:36:10 +01:00
Sleeper85 7af47f5b2e YamBMS 1.5.4 2025-01-26 19:22:56 +01:00
63 changed files with 4872 additions and 3455 deletions

No files matched your search

File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+6 -1
View File
@@ -44,7 +44,7 @@
You install `YamBMS` on a single ESP32 connected to your BMS and your inverter.
* Max 3x BMS BLE
* Max 3X BMS UART
* Max 3x BMS UART
* several RS485 BMS on the same bus
### Multi-node
@@ -115,6 +115,11 @@ rx_pin: 22 # to CAN board CRX (with 4.7K resistor except for SN65HVD230)
## Changelog
* YamBMS 1.5.4 :
* New low SoC corrected at each BMS level (the corrected SoC is the one transmitted to YamBMS)
* New BMS dashboard
* New end of charge logic at each BMS level, the charge switch turns off when the cells are equalized (disabled by default)
* Fixed `errors_bitamsk` for JK-PB RS485, test OK with YamBMS (forked component)
* YamBMS 1.5.3 :
* Broadcasting JK-PB settings to all BMS set to OFF by default
* Reorganizing the `board` folder and YAMLs (device_base.yaml moved to board.yaml)
+227
View File
@@ -0,0 +1,227 @@
# Updated : 2025.04.01
# Version : 1.5.4
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
logger:
level: INFO # VERBOSE / DEBUG / INFO / WARN
ota:
platform: esphome
api:
reboot_timeout: 0s
# Don't forget to configure your WiFi credentials in the secrets.yaml file
#
# If needed, configure a static IP here
# wifi:
# manual_ip:
# static_ip: 192.168.0.85
# gateway: 192.168.0.1
# subnet: 255.255.255.0
# dns1: 8.8.8.8
# dns2: 8.8.4.4
# +--------------------------------------+
# | Global Settings |
# +--------------------------------------+
substitutions:
name: yambms # ESP32 name / hostname
# +--------------------------------------+
# | YamBMS Settings |
# +--------------------------------------+
# Please read the cut-off charging logic README to understand how the YamBMS works
yambms_id: 'yambms1'
yambms_name: 'YamBMS 1'
yambms_update_interval: '1s'
# Input numbers can be displayed as a slider or an input box, options are 'slider' or 'box'.
yambms_input_number_mode: 'slider'
# Please check and fill in the options below correctly according to your battery chemistry and number of cells in series.
# These parameters are important and used for charging logic.
# Battery Chemistry
yambms_battery_chemistry: '1' # 1-LFP | 2-Li-ion | 3-LTO
# Number of cells in series
yambms_cell_count: '16'
# Bulk / Absorption Voltage : corresponds to the Bulk voltage that will be used to charge the battery. (LFP : 55.2V = 3.45V/Cell for 16S battery)
yambms_bulk_v: '55.2'
# Float Voltage : corresponds to the voltage at which the battery would be maintained at the end of charge. (LFP : 53.6V = 3.35V/Cell for 16S battery)
yambms_float_v: '53.6'
# Rebulk voltage, voltage from which a new Bulk charge can start. (LFP : 52.8V = 3.3V/Cell for 16S battery)
yambms_rebulk_v: '52.8'
# Maximum time in minutes that the cut-off step can last before charging is complete
# If your cells are properly balanced this step ends at the fastest after the `cut-off timer`
# This timer can be deactivated with a switch
yambms_eoc_timer: '30'
# Time in seconds during which the end of charge conditions must be respected (cut-off + cells not equalizing)
yambms_cutoff_timer: '60'
# Maximum charging cycles is used to calculate the battey SOH, LF280K v3 =8000.0, LF280K v2 =6000.0, LF280=3000.0 (decimal is required)
yambms_max_cycles: '6000.0'
# +--------------------------------------+
# | Shunt Settings |
# +--------------------------------------+
shunt_update_interval: '3s' # frequency at which Shunt data is refreshed
shunt_combine_interval: '1s' # frequency at which Shunt data is combined in YamBMS
# +--------------------------------------+
# | BMS Settings |
# +--------------------------------------+
bms_update_interval: '3s' # frequency at which BMS data is refreshed, going below '3s' can cause problems
bms_combine_interval: '1s' # frequency at which BMS data is combined in YamBMS
bms_cutoff_timer: '50s' # time during which the end of charge conditions must be respected (cut-off + cells not equalizing)
# +--------------------------------------+
# | Packages |
# +--------------------------------------+
packages:
############### >>> UNCOMMENT YOUR BOARD <<< ###############
############### >>> ONLY ONE BOARD ! <<< ###############
board:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
# - path: 'packages/board/board_ESP32_DevKit-V1.yaml'
# - path: 'packages/board/board_ESP32_LilyGo-T-CAN485.yaml'
# - path: 'packages/board/board_ESP32-C3_ETH01-EVO.yaml'
# - path: 'packages/board/board_ESP32-S3_DevKitC-1.yaml'
# - path: 'packages/board/board_ESP32-S3_LilyGo-T-Connect.yaml'
# - path: 'packages/board/board_ESP32-S3_AtomS3-Lite.yaml'
- path: 'packages/board/board_ESP32-S3_AtomS3.yaml'
vars:
display_auto_next_page_interval: '5s'
# - path: 'packages/board/board_ESP32-S3_AtomS3R.yaml'
# vars:
# display_auto_next_page_interval: '5s'
############################################################
bms:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
# RS485 Sniffer
- path: 'packages/bms/bms_combine_JK-PB_RS485_sniffer.yaml'
vars:
sniffer_id: 'sniffer1'
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1'
# BMS 1
- path: 'packages/bms/bms_combine_JK-PB_RS485_bms_standard.yaml'
vars:
# Sniffer ID
sniffer_id: 'sniffer1'
# BMS vars
bms_id: '1' # must be a number
bms_name: 'JK-BMS 1'
bms_address: '0x01' # BMS 1 DIP switch
# BMS 2
- path: 'packages/bms/bms_combine_JK-PB_RS485_bms_standard.yaml'
vars:
# Sniffer ID
sniffer_id: 'sniffer1'
# BMS vars
bms_id: '2' # must be a number
bms_name: 'JK-BMS 2'
bms_address: '0x02' # BMS 2 DIP switch
# BMS 3
- path: 'packages/bms/bms_combine_JK-PB_RS485_bms_standard.yaml'
vars:
# Sniffer ID
sniffer_id: 'sniffer1'
# BMS vars
bms_id: '3' # must be a number
bms_name: 'JK-BMS 3'
bms_address: '0x03' # BMS 3 DIP switch
# BMS 4
- path: 'packages/bms/bms_combine_JK-PB_RS485_bms_standard.yaml'
vars:
# Sniffer ID
sniffer_id: 'sniffer1'
# BMS vars
bms_id: '4' # must be a number
bms_name: 'JK-BMS 4'
bms_address: '0x04' # BMS 4 DIP switch
# BMS 5
- path: 'packages/bms/bms_combine_JK-PB_RS485_bms_standard.yaml'
vars:
# Sniffer ID
sniffer_id: 'sniffer1'
# BMS vars
bms_id: '5' # must be a number
bms_name: 'JK-BMS 5'
bms_address: '0x05' # BMS 5 DIP switch
# BMS 6
- path: 'packages/bms/bms_combine_JK-PB_RS485_bms_standard.yaml'
vars:
# Sniffer ID
sniffer_id: 'sniffer1'
# BMS vars
bms_id: '6' # must be a number
bms_name: 'JK-BMS 6'
bms_address: '0x06' # BMS 6 DIP switch
# BMS 7
- path: 'packages/bms/bms_combine_JK-PB_RS485_bms_standard.yaml'
vars:
# Sniffer ID
sniffer_id: 'sniffer1'
# BMS vars
bms_id: '7' # must be a number
bms_name: 'JK-BMS 7'
bms_address: '0x07' # BMS 7 DIP switch
yambms:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
- path: 'packages/yambms/yambms.yaml'
# - path: 'packages/yambms/yambms_custom.yaml'
# Custom Local YAML
# yambms_custom: !include yambms_custom.yaml
canbus1:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
- path: 'packages/yambms/yambms_canbus.yaml'
vars:
canbus_id: 'canbus1'
canbus_name: 'CANBUS 1'
canbus_node_id: 'canbus_node1'
canbus_light_id: 'esp_light'
# The CANBUS link will be considered down if no response from the inverter (ID 0x305) for 5s
# The Deye inverter sends the ACK (can_id 0x305) only when it receives the can_id 0x356
canbus_link_timer: '5s'
# +--------------------------------------+
# | DEBUG ( logger level must be DEBUG ) |
# +--------------------------------------+
debug:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
- path: packages/base/device_debug_ESP32.yaml
vars:
debug_name: 'Debug'
debug_update_interval: '5s'
+174
View File
@@ -0,0 +1,174 @@
# Updated : 2025.04.01
# Version : 1.5.4
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
# esp32:
# framework:
# type: esp-idf
# version: 4.4.8
# platform_version: 5.4.0
logger:
level: INFO # VERBOSE / DEBUG / INFO / WARN
ota:
platform: esphome
api:
reboot_timeout: 0s
# Don't forget to configure your WiFi credentials in the secrets.yaml file
#
# If needed, configure a static IP here
# wifi:
# manual_ip:
# static_ip: 192.168.0.85
# gateway: 192.168.0.1
# subnet: 255.255.255.0
# dns1: 8.8.8.8
# dns2: 8.8.4.4
# +--------------------------------------+
# | Global Settings |
# +--------------------------------------+
substitutions:
name: yambms # ESP32 name / hostname
# +--------------------------------------+
# | YamBMS Settings |
# +--------------------------------------+
# Please read the cut-off charging logic README to understand how the YamBMS works
yambms_id: 'yambms1'
yambms_name: 'YamBMS 1'
yambms_update_interval: '1s'
# Input numbers can be displayed as a slider or an input box, options are 'slider' or 'box'.
yambms_input_number_mode: 'slider'
# Please check and fill in the options below correctly according to your battery chemistry and number of cells in series.
# These parameters are important and used for charging logic.
# Battery Chemistry
yambms_battery_chemistry: '1' # 1-LFP | 2-Li-ion | 3-LTO
# Number of cells in series
yambms_cell_count: '16'
# Bulk / Absorption Voltage : corresponds to the Bulk voltage that will be used to charge the battery. (LFP : 55.2V = 3.45V/Cell for 16S battery)
yambms_bulk_v: '55.2'
# Float Voltage : corresponds to the voltage at which the battery would be maintained at the end of charge. (LFP : 53.6V = 3.35V/Cell for 16S battery)
yambms_float_v: '53.6'
# Rebulk voltage, voltage from which a new Bulk charge can start. (LFP : 52.8V = 3.3V/Cell for 16S battery)
yambms_rebulk_v: '52.8'
# Maximum time in minutes that the cut-off step can last before charging is complete
# If your cells are properly balanced this step ends at the fastest after the `cut-off timer`
# This timer can be deactivated with a switch
yambms_eoc_timer: '30'
# Time in seconds during which the end of charge conditions must be respected (cut-off + cells not equalizing)
yambms_cutoff_timer: '60'
# Maximum charging cycles is used to calculate the battey SOH, LF280K v3 =8000.0, LF280K v2 =6000.0, LF280=3000.0 (decimal is required)
yambms_max_cycles: '6000.0'
# +--------------------------------------+
# | Shunt Settings |
# +--------------------------------------+
shunt_update_interval: '3s' # frequency at which Shunt data is refreshed
shunt_combine_interval: '1s' # frequency at which Shunt data is combined in YamBMS
# +--------------------------------------+
# | BMS Settings |
# +--------------------------------------+
bms_update_interval: '3s' # frequency at which BMS data is refreshed, going below '3s' can cause problems
bms_combine_interval: '1s' # frequency at which BMS data is combined in YamBMS
bms_cutoff_timer: '50s' # time during which the end of charge conditions must be respected (cut-off + cells not equalizing)
# +--------------------------------------+
# | Packages |
# +--------------------------------------+
packages:
############### >>> UNCOMMENT YOUR BOARD <<< ###############
############### >>> ONLY ONE BOARD ! <<< ###############
board:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
- path: 'packages/board/board_ESP32_DevKit-V1.yaml'
# - path: 'packages/board/board_ESP32_LilyGo-T-CAN485.yaml'
# - path: 'packages/board/board_ESP32-C3_ETH01-EVO.yaml'
# - path: 'packages/board/board_ESP32-S3_DevKitC-1.yaml'
# - path: 'packages/board/board_ESP32-S3_LilyGo-T-Connect.yaml'
# - path: 'packages/board/board_ESP32-S3_AtomS3-Lite.yaml'
# - path: 'packages/board/board_ESP32-S3_AtomS3.yaml'
# vars:
# display_auto_next_page_interval: '5s'
# - path: 'packages/board/board_ESP32-S3_AtomS3R.yaml'
# vars:
# display_auto_next_page_interval: '5s'
############################################################
bms:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
- path: 'packages/bms/bms_combine_JK-B_UART_full.yaml'
vars:
bms_id: '1' # must be a number
bms_name: 'JK-BMS 1'
bms_uart_id: 'uart_esp_1'
- path: 'packages/bms/bms_combine_JK-B_UART_full.yaml'
vars:
bms_id: '2' # must be a number
bms_name: 'JK-BMS 2'
bms_uart_id: 'uart_esp_2'
yambms:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
- path: 'packages/yambms/yambms.yaml'
# - path: 'packages/yambms/yambms_custom.yaml'
# Custom Local YAML
# yambms_custom: !include yambms_custom.yaml
canbus1:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
- path: 'packages/yambms/yambms_canbus.yaml'
vars:
canbus_id: 'canbus1'
canbus_name: 'CANBUS 1'
canbus_node_id: 'canbus_node1'
canbus_light_id: 'esp_light'
# The CANBUS link will be considered down if no response from the inverter (0x305 frame) for 5s
# The Deye inverter sends the ACK 0x305 only when it receives the 0x356 frame.
canbus_link_timer: '5s'
# +--------------------------------------+
# | DEBUG ( logger level must be DEBUG ) |
# +--------------------------------------+
debug:
url: https://github.com/Sleeper85/esphome-yambms
ref: main
refresh: 0s
files:
- path: packages/base/device_debug_ESP32.yaml
vars:
debug_name: 'Debug'
debug_update_interval: '5s'
+3
View File
@@ -6,6 +6,9 @@
![GitHub forks](https://img.shields.io/github/forks/Sleeper85/esphome-yambms)
![GitHub watchers](https://img.shields.io/github/watchers/Sleeper85/esphome-yambms)
> [!NOTE]
> Please read the documentation regarding the [charging settings](YamBMS_functions.md#charging-settings).
## Charging Logic Diagram
The charging voltage and current correspond to the default values in the YAML script and can be modified.
+6
View File
@@ -43,6 +43,9 @@
| --- | --- | --- |
| <img src="../../images/MCU_ESP32-DevKitC_espBerry_2-CH-CAN.png" width="300"> | <img src="../../images/MCU_ESP32_LilyGo-T-CAN485.jpg" width="300"> | <img src="../../images/MCU_ESP32-S3_LilyGo-T-Connect.jpg" width="300"> |
| [Olimex ESP32-EVB](https://github.com/OLIMEX/ESP32-EVB) |
| --- |
| <img src="../../images/MCU_ESP32-EVB.jpg" width="300">|
## Supported CAN bus transceiver
**Note: some inverters only accept a CAN bus at 3.3V in this case please choose the SN65HVD230 chip.**
@@ -100,9 +103,12 @@ The following are confirmed and known to work:
| LuxPower | LXP-LB-US 10K | Working | [@Henny101](https://diysolarforum.com/members/henny101.67026/) | Lithium 6 | JK-PB (2) | RS485 | ESP32-S3 DevKitC-1 | Automatic | LuxPower | SN65HVD230 | [Isolated RS485 (high speed dual)](https://a.aliexpress.com/_EueIZT5) | yes | --- |
| EG4 | 6000XP | Working | [@ChrisG](https://diysolarforum.com/members/chrisg.483/) | Lithium 2 | JK-B (2) | BLE | ESP32 DevKit V1 / ESP32-S3 DevKitC-1 | PYLON | PYLON 1.2 | MCP2515 | --- | yes | --- |
| EG4 | 6000XP (2) | Working | [@SGB](https://diysolarforum.com/members/scrotpusgobblebottom.100804/) | Lithium 6 | JK-B (1) JK-PB (1) | BLE | Atom S3 (display) | Automatic | LuxPower | [Atomic CAN base (SKU:A103)](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) | --- | yes | --- |
| EG4 | 12000XP | Working | [@andrewfraley](https://github.com/andrewfraley) | Lithium 6 | JBD | RS485 | LilyGo T-CAN485 | Automatic | LuxPower | T-CAN485 (SN65HVD231DR) | T-CAN485 (MAX13487E) | no | set UART baud to 9600 |
| EG4 | 18kPV | Working | [@Maintman](https://diysolarforum.com/members/maintman.19007/) | Lithium 6 | JK-B | BLE | ESP32 DevKit V1 | Automatic | LuxPower | MCP2515 | --- | yes | Connected via Bluetooth to Victron SmartShunt. |
| Victron | MultiPlus-II 48/10000/140 | Working | [@cali-clim](https://diysolarforum.com/members/cali-clim.54284/) | CAN-bus BMS LV (500 kbit/s) | JK-PB (2) | RS485 | Atom S3 (display) | Automatic | Victron | [Atomic CAN base (SKU:A103)](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) | [Isolated RS485 Unit (SKU:U094)](https://docs.m5stack.com/en/unit/iso485) | yes | --- |
| Victron | MultiPlus-II 48/10000/140 | Working | [@20after4](https://github.com/20after4) | CAN-bus BMS LV (500 kbit/s) | JBD-BMS (2) | BLE | Olimex ESP32-EVB | Automatic | Victron | SIT1050T (Integrated) | --- | yes | Works well with the integrated Ethernet and CANBus hardware |
| Victron | Multiplus 24/1200/25-16 | Working | [@dmsims](https://diysolarforum.com/members/dmsims.23417/) | CAN-bus BMS LV (500 kbit/s) | JK-B (1) | BLE | Atom S3 Lite | Automatic | Victron | [Atomic CAN base (SKU:A103)](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) | --- | no | Plugged into Cerbo Can port (must use supplied Victron terminator in the other port) |
| MidNite Solar | MN15-12KW-AIO | Working | [@goldserve](https://diysolarforum.com/members/goldserve.52541/) | PYLON | JK-B | BLE | ESP32-S3 | Automatic | PYLON 1.2 | MCP2515 | --- | no | Stable with Victron Smartshunt, MQTT, BLE, Neopixel LED, Display also working. |
| MidNite Solar | MN15-12KW-AIO | Working | [@jahyde](https://diysolarforum.com/members/jahyde.7475/) | PYLON | JK-PB | BLE | ESP32-S3 | Automatic | PYLON 1.2 | MCP2515 | --- | yes | --- |
| SMA | Sunny Island | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| SRNE | HESP48120U200-H | Working | [@ogremustcrush](https://diysolarforum.com/members/ogremustcrush.116979/) | UZE | JK-PB | RS485 | Atom S3 Lite | Automtic | PYLON V2 | [Atomic CAN Base (SKU:A103)](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) | [Isolated RS485 Unit (SKU:U094)](https://docs.m5stack.com/en/unit/iso485) | Yes | Most of the YamBMS PYLON based protocols show same results on inverter. Inverter itself does not work when it is set to PYLON protocol, but UZE works. Incorrect temp reported on inverter |
+2 -2
View File
@@ -111,7 +111,7 @@ This should prevent the runner cell from exceeding the max voltage cutoff, but d
You can compare `Auto CCL` to a max speed limiter in a car.
`Auto DCL` works the same way when a cell approaching `UVP + 0.02`.
`Auto DCL` works the same way when a cell approaching `UVP + 0.2`.
Current control should work with any inverter that uses `CAN` control.
@@ -123,7 +123,7 @@ These 4 sensors allow you to see what is being requested of your inverter.
In the example below, we are in the `Float` phase at a voltage of `53.6V` and an `Inverter Offset V.` of `0.1V`. The `Requested Charge Voltage` is therefore `53.7V`.
The `Requested Discharge Voltage` is the `UVP + 0.02` value of your BMS multiplied by the number of cells, in this example (3V * 16).
The `Requested Discharge Voltage` is the `UVP + 0.2` value of your BMS multiplied by the number of cells, in this example (3V * 16).
The `Requested Charge/Discharge Current` is the `OCP` value of your BMS multiplied by the `Max current` percentage, in this example (150A * 80%).
@@ -428,6 +428,25 @@ If your `RS485` board requires a `talk_pin` you must specify which `GPIO` will b
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
```
### [JBD (BLE)](https://github.com/syssi/esphome-jbd-bms)
```YAML
bms1: !include
file: packages/bms/bms_combine_JBD_BLE_full.yaml # bms_modbus_JBD_UART_full.yaml
vars:
bms_id: '1' # must be a number
bms_name: 'BMS 1'
bms_ble_mac_address: 'C8:47:8C:10:7E:AA' # Your MAC address
# Required settings cannot be retrieved from BMS
# These values ​​must match your BMS settings
# LFP values example
bms_max_charge_current: '100' # A. Used to calculate maximum charge current
bms_max_discharge_current: '100' # A. Used to calculate maximum discharge current
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
```
### [Seplos V1/V2 (RS485)](https://github.com/syssi/esphome-seplos-bms)
A single `RS485 bus` allows you to monitor up to `16` BMS.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.5.3
# Updated : 2025.01.28
# Version : 1.5.4
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -112,12 +112,11 @@ packages:
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
bms2: !include
file: packages/bms/bms_combine_JBD_UART_full.yaml
file: packages/bms/bms_combine_JBD_BLE_full.yaml
vars:
bms_id: '2' # must be a number
bms_name: 'BMS 2'
bms_uart_id: 'uart_esp_2'
bms_rx_timeout: '150ms'
bms_ble_mac_address: 'C8:47:8C:10:7E:AA' # Your MAC address
# Required settings cannot be retrieved from BMS
# These values ​​must match your BMS settings
# LFP values example
+4 -10
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.18
# Version : 1.5.3
# Updated : 2025.03.21
# Version : 1.5.4
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -18,13 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
substitutions:
yambms_version: "1.5.3"
external_components:
# https://github.com/esphome/esphome/pull/7547
# api: ensure fair network sharing + prevent lost state changes via deferred publish at high event load
- source: github://pr#7547
components: [ api, event ]
yambms_version: "1.5.4"
esphome:
name: ${name}
@@ -34,7 +28,7 @@ esphome:
project:
name: Sleeper85.YamBMS
version: ${yambms_version}
min_version: 2024.6.0
min_version: 2025.3.0
time:
# https://esphome.io/components/time/homeassistant
+9 -5
View File
@@ -22,17 +22,21 @@ sensor:
- platform: wifi_signal
name: ${name} ESP32 WiFi power
id: esp32_wifi_power
update_interval: 10s
update_interval: 30s
entity_category: diagnostic
- platform: copy # Reports the WiFi signal strength in %
source_id: esp32_wifi_power
# Reports the WiFi signal strength in %
- platform: template
name: ${name} ESP32 WiFi power (%)
id: esp32_wifi_power_percent
update_interval: 30s
unit_of_measurement: '%'
icon: mdi:wifi
entity_category: diagnostic
filters:
- lambda: 'return min(max(2 * (x + 100.0), 0.0), 100.0);'
accuracy_decimals: 0
lambda: |-
float wifi_power_dbm = id(esp32_wifi_power).state;
return min(max(2 * (wifi_power_dbm + 100.0), 0.0), 100.0);
text_sensor:
# https://esphome.io/components/text_sensor/wifi_info
+1 -4
View File
@@ -1,4 +1,4 @@
# Updated : 2024.12.23
# Updated : 2025.03.21
# Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
@@ -17,9 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
esphome:
min_version: 2024.11.3
uart:
- id: !extend ${modbus_uart_id}
baud_rate: ${modbus_baud_rate}
+1 -4
View File
@@ -1,4 +1,4 @@
# Updated : 2024.12.23
# Updated : 2025.03.21
# Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
@@ -17,9 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
esphome:
min_version: 2024.11.3
modbus:
- uart_id: ${modbus_uart_id}
id: modbus_${modbus_role}
+25 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2024.08.08
# Version : 1.2.1
# Updated : 2025.01.25
# Version : 1.2.2
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
# packages:
# bms_charging_logic: !include bms_options_charging_logic.yaml
sensor:
# +--------------------------------------+
# | Total Daily Energy |
@@ -41,3 +44,23 @@ sensor:
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
- platform: template
name: ${name} ${bms_name} Battery SoC
id: bms${bms_id}_battery_soc
unit_of_measurement: "%"
device_class: battery
update_interval: ${bms_update_interval}
accuracy_decimals: 0
filters:
- or:
- throttle: 10s
- delta: 1
lambda: |-
float soc = id(bms${bms_id}_state_of_charge).state;
float min_cell_v = id(bms${bms_id}_min_cell_voltage).state;
float cell_low_v = id(bms${bms_id}_cell_uvp).state + 0.2;
if (min_cell_v <= cell_low_v) return 0; // Real 0% => return 0%
else if (soc < 1) return 2; // False 0% => return 2%
else return soc; // Else => return BMS SoC
+4 -4
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.19
# Version : 1.5.3
# Updated : 2025.01.24
# Version : 1.5.4
# GitHub : https://github.com/Sleeper85/esphome-yambms
# This YAML is free software: you can redistribute it and/or
@@ -120,8 +120,8 @@ interval:
// TOTAL capacity_remaining_ah
id(${yambms_id}_var_total_capacity_remaining_ah) += id(bms${bms_id}_capacity_remaining_ah).state;
// TOTAL soc
id(${yambms_id}_var_bms_total_soc) += id(bms${bms_id}_state_of_charge).state;
// TOTAL SoC
id(${yambms_id}_var_bms_total_soc) += id(bms${bms_id}_battery_soc).state;
// TOTAL charging_cycles
id(${yambms_id}_var_total_charging_cycles) += id(bms${bms_id}_charging_cycles).state;
@@ -0,0 +1,26 @@
# Updated : 2025.01.28
# Version : 1.1.1
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
substitutions:
bms_model: "JBD"
bms_protocol: "BLE"
packages:
bms_sensors: !include bms_sensors_JBD_BLE_full.yaml
bms_combine: !include bms_combine.yaml
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.5
# Updated : 2025.01.28
# Version : 1.2.6
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -58,8 +58,8 @@ esp32_ble_tracker:
}
ble_client:
- mac_address: ${bms_ble_mac_address}
id: ble_client${bms_id}
- id: ble_client${bms_id}
mac_address: ${bms_ble_mac_address}
jk_bms_ble:
- ble_client_id: ble_client${bms_id}
@@ -90,11 +90,14 @@ binary_sensor:
heating:
name: "${name} ${bms_name} heating"
switch:
- platform: jk_bms_ble
jk_bms_ble_id: jk_bms_ble${bms_id}
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} Charge switch"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} Discharge switch"
balancer:
name: "${name} ${bms_name} Balance switch"
@@ -109,7 +112,6 @@ binary_sensor:
name: "${name} ${bms_name} timed stored data"
charging_float_mode:
name: "${name} ${bms_name} charging float mode"
# +--------------------------------------+
- platform: ble_client
ble_client_id: ble_client${bms_id}
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.5
# Updated : 2025.01.28
# Version : 1.2.6
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -58,8 +58,8 @@ esp32_ble_tracker:
}
ble_client:
- mac_address: ${bms_ble_mac_address}
id: ble_client${bms_id}
- id: ble_client${bms_id}
mac_address: ${bms_ble_mac_address}
jk_bms_ble:
- ble_client_id: ble_client${bms_id}
@@ -91,8 +91,10 @@ switch:
- platform: jk_bms_ble
jk_bms_ble_id: jk_bms_ble${bms_id}
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} Charge switch"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} Discharge switch"
balancer:
name: "${name} ${bms_name} Balance switch"
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.5
# Updated : 2025.01.28
# Version : 1.2.6
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -58,8 +58,8 @@ esp32_ble_tracker:
}
ble_client:
- mac_address: ${bms_ble_mac_address}
id: ble_client${bms_id}
- id: ble_client${bms_id}
mac_address: ${bms_ble_mac_address}
jk_bms_ble:
- ble_client_id: ble_client${bms_id}
@@ -91,8 +91,10 @@ switch:
- platform: jk_bms_ble
jk_bms_ble_id: jk_bms_ble${bms_id}
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} Charge switch"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} Discharge switch"
balancer:
name: "${name} ${bms_name} Balance switch"
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.5
# Updated : 2025.01.25
# Version : 1.2.6
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -73,8 +73,10 @@ switch:
- platform: jk_bms
jk_bms_id: jk_bms${bms_id}
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} Charge switch"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} Discharge switch"
# It is not possible to control the balancer from UART-TTL (confirmed by @syssi)
@@ -1,6 +1,6 @@
# Updated : 2025.01.16
# Version : 1.2.3
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# Updated : 2025.03.30
# Version : 1.1.1
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -18,457 +18,5 @@
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
packages:
bms_base: !include bms_base.yaml
bms_sensors: !include bms_sensors_JK-PB_RS485_bms_full.yaml
bms_combine: !include bms_combine.yaml
bms_temperature_sensor: !include bms_temperature_sensor_5.yaml
bms_errors_bitmask: !include bms_errors_bitmask_JK-PB_RS485.yaml
# +--------------------------------------+
# | Component settings |
# +--------------------------------------+
jk_rs485_bms:
- id: jk_rs485_bms${bms_id}
rs485_address: ${bms_address}
jk_rs485_sniffer_id: ${sniffer_id}
update_interval: ${bms_update_interval}
# +--------------------------------------+
# | Component entities |
# +--------------------------------------+
switch:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
precharging:
name: "${name} ${bms_name} precharging"
charging:
name: "${name} ${bms_name} charging"
discharging:
name: "${name} ${bms_name} discharging"
balancing:
id: bms${bms_id}_switch_balancing
name: "${name} ${bms_name} balancing"
emergency:
name: "${name} ${bms_name} emergency"
heating:
name: "${name} ${bms_name} heating"
display_always_on:
name: "${name} ${bms_name} display_always_on"
charging_float_mode:
name: "${name} ${bms_name} charging float mode"
timed_stored_data:
name: "${name} ${bms_name} timed stored data"
disable_temperature_sensors:
name: "${name} ${bms_name} disable temperature sensors"
smart_sleep_on:
name: "${name} ${bms_name} smart sleep on"
disable_pcl_module:
name: "${name} ${bms_name} disable pcl module"
gps_heartbeat:
name: "${name} ${bms_name} gps heartbeat"
port_selection:
name: "${name} ${bms_name} port selection"
special_charger:
name: "${name} ${bms_name} special charger"
binary_sensor:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
status_balancing:
id: bms${bms_id}_equalizing
name: "${name} ${bms_name} status balancing"
status_precharging:
name: "${name} ${bms_name} status precharging"
status_charging:
id: bms${bms_id}_charging_allowed
name: "${name} ${bms_name} status charging"
status_discharging:
id: bms${bms_id}_discharging_allowed
name: "${name} ${bms_name} status discharging"
status_online:
id: bms${bms_id}_online_status
name: "${name} ${bms_name} status online"
status_heating:
name: "${name} ${bms_name} status heating"
alarm_wireres:
name: "${name} ${bms_name} alarm WireRes"
alarm_mosotp:
name: "${name} ${bms_name} alarm MosOTP"
alarm_cellquantity:
name: "${name} ${bms_name} alarm CellQuantity"
alarm_cursensorerr:
name: "${name} ${bms_name} alarm CurSensorErr"
alarm_cellovp:
name: "${name} ${bms_name} alarm CellOVP"
alarm_batovp:
name: "${name} ${bms_name} alarm BatOVP"
alarm_chocp:
name: "${name} ${bms_name} alarm ChOCP"
alarm_chscp:
name: "${name} ${bms_name} alarm ChSCP"
alarm_chotp:
name: "${name} ${bms_name} alarm ChOTP"
alarm_chutp:
name: "${name} ${bms_name} alarm ChUTP"
alarm_cpuauxcommuerr:
name: "${name} ${bms_name} alarm CPUAuxCommuErr"
alarm_celluvp:
name: "${name} ${bms_name} alarm CellUVP"
alarm_batuvp:
name: "${name} ${bms_name} alarm BatUVP"
alarm_dchocp:
name: "${name} ${bms_name} alarm DchOCP"
alarm_dchscp:
name: "${name} ${bms_name} alarm DchSCP"
alarm_dchotp:
name: "${name} ${bms_name} alarm DchOTP"
alarm_chargemos:
name: "${name} ${bms_name} alarm ChargeMOS"
alarm_dischargemos:
name: "${name} ${bms_name} alarm DischargeMOS"
alarm_gpsdisconneted:
name: "${name} ${bms_name} alarm GPSDisconneted"
alarm_modifypwdintime:
name: "${name} ${bms_name} alarm ModifyPWDinTime"
alarm_dischargeonfailed:
name: "${name} ${bms_name} alarm DischargeOnFailed"
alarm_batteryovertemp:
name: "${name} ${bms_name} alarm BatteryOverTemp"
alarm_temperaturesensoranomaly:
name: "${name} ${bms_name} alarm TemperatureSensorAnomaly"
alarm_plcmoduleanomaly:
name: "${name} ${bms_name} alarm PLCModuleAnomaly"
alarm_mostempsensorabsent:
name: "${name} ${bms_name} alarm MOSTempSensorAbsent"
alarm_battempsensor1absent:
name: "${name} ${bms_name} alarm BATTempSensor1Absent"
alarm_battempsensor2absent:
name: "${name} ${bms_name} alarm BATTempSensor2Absent"
alarm_battempsensor3absent:
name: "${name} ${bms_name} alarm BATTempSensor3Absent"
alarm_battempsensor4absent:
name: "${name} ${bms_name} alarm BATTempSensor4Absent"
alarm_battempsensor5absent:
name: "${name} ${bms_name} alarm BATTempSensor5Absent"
sensor:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
balancing_direction:
name: "${name} ${bms_name} balancing direction"
cell_voltage_min:
id: bms${bms_id}_min_cell_voltage
name: "${name} ${bms_name} cell voltage min"
cell_voltage_max:
id: bms${bms_id}_max_cell_voltage
name: "${name} ${bms_name} cell voltage max"
cell_voltage_min_cell_number:
id: bms${bms_id}_min_voltage_cell
name: "${name} ${bms_name} cell voltage min cell number"
cell_voltage_max_cell_number:
id: bms${bms_id}_max_voltage_cell
name: "${name} ${bms_name} cell voltage max cell number"
cell_delta_voltage:
name: "${name} ${bms_name} cell delta voltage"
cell_average_voltage:
id: bms${bms_id}_average_cell_voltage
name: "${name} ${bms_name} cell average voltage"
cell_resistance_min:
name: "${name} ${bms_name} cell resistance min"
cell_resistance_max:
name: "${name} ${bms_name} cell resistance max"
cell_resistance_min_cell_number:
name: "${name} ${bms_name} cell resistance min cell number"
cell_resistance_max_cell_number:
name: "${name} ${bms_name} cell resistance max cell number"
cell_voltage_01:
name: "${name} ${bms_name} cell voltage 01"
cell_voltage_02:
name: "${name} ${bms_name} cell voltage 02"
cell_voltage_03:
name: "${name} ${bms_name} cell voltage 03"
cell_voltage_04:
name: "${name} ${bms_name} cell voltage 04"
cell_voltage_05:
name: "${name} ${bms_name} cell voltage 05"
cell_voltage_06:
name: "${name} ${bms_name} cell voltage 06"
cell_voltage_07:
name: "${name} ${bms_name} cell voltage 07"
cell_voltage_08:
name: "${name} ${bms_name} cell voltage 08"
cell_voltage_09:
name: "${name} ${bms_name} cell voltage 09"
cell_voltage_10:
name: "${name} ${bms_name} cell voltage 10"
cell_voltage_11:
name: "${name} ${bms_name} cell voltage 11"
cell_voltage_12:
name: "${name} ${bms_name} cell voltage 12"
cell_voltage_13:
name: "${name} ${bms_name} cell voltage 13"
cell_voltage_14:
name: "${name} ${bms_name} cell voltage 14"
cell_voltage_15:
name: "${name} ${bms_name} cell voltage 15"
cell_voltage_16:
name: "${name} ${bms_name} cell voltage 16"
# cell_voltage_17:
# name: "${name} ${bms_name} cell voltage 17"
# cell_voltage_18:
# name: "${name} ${bms_name} cell voltage 18"
# cell_voltage_19:
# name: "${name} ${bms_name} cell voltage 19"
# cell_voltage_20:
# name: "${name} ${bms_name} cell voltage 20"
# cell_voltage_21:
# name: "${name} ${bms_name} cell voltage 21"
# cell_voltage_22:
# name: "${name} ${bms_name} cell voltage 22"
# cell_voltage_23:
# name: "${name} ${bms_name} cell voltage 23"
# cell_voltage_24:
# name: "${name} ${bms_name} cell voltage 24"
cell_resistance_01:
name: "${name} ${bms_name} cell resistance 01"
cell_resistance_02:
name: "${name} ${bms_name} cell resistance 02"
cell_resistance_03:
name: "${name} ${bms_name} cell resistance 03"
cell_resistance_04:
name: "${name} ${bms_name} cell resistance 04"
cell_resistance_05:
name: "${name} ${bms_name} cell resistance 05"
cell_resistance_06:
name: "${name} ${bms_name} cell resistance 06"
cell_resistance_07:
name: "${name} ${bms_name} cell resistance 07"
cell_resistance_08:
name: "${name} ${bms_name} cell resistance 08"
cell_resistance_09:
name: "${name} ${bms_name} cell resistance 09"
cell_resistance_10:
name: "${name} ${bms_name} cell resistance 10"
cell_resistance_11:
name: "${name} ${bms_name} cell resistance 11"
cell_resistance_12:
name: "${name} ${bms_name} cell resistance 12"
cell_resistance_13:
name: "${name} ${bms_name} cell resistance 13"
cell_resistance_14:
name: "${name} ${bms_name} cell resistance 14"
cell_resistance_15:
name: "${name} ${bms_name} cell resistance 15"
cell_resistance_16:
name: "${name} ${bms_name} cell resistance 16"
# cell_resistance_17:
# name: "${name} ${bms_name} cell resistance 17"
# cell_resistance_18:
# name: "${name} ${bms_name} cell resistance 18"
# cell_resistance_19:
# name: "${name} ${bms_name} cell resistance 19"
# cell_resistance_20:
# name: "${name} ${bms_name} cell resistance 20"
# cell_resistance_21:
# name: "${name} ${bms_name} cell resistance 21"
# cell_resistance_22:
# name: "${name} ${bms_name} cell resistance 22"
# cell_resistance_23:
# name: "${name} ${bms_name} cell resistance 23"
# cell_resistance_24:
# name: "${name} ${bms_name} cell resistance 24"
battery_voltage:
id: bms${bms_id}_total_voltage
name: "${name} ${bms_name} battery voltage"
battery_current:
id: bms${bms_id}_current
name: "${name} ${bms_name} battery current"
battery_power:
id: bms${bms_id}_power
name: "${name} ${bms_name} battery power"
battery_power_charging:
id: bms${bms_id}_charging_power
name: "${name} ${bms_name} battery power charging"
battery_power_discharging:
id: bms${bms_id}_discharging_power
name: "${name} ${bms_name} battery power discharging"
temperature_sensor_1:
id: bms${bms_id}_temperature_sensor_1
name: "${name} ${bms_name} temperature sensor 1"
temperature_sensor_2:
id: bms${bms_id}_temperature_sensor_2
name: "${name} ${bms_name} temperature sensor 2"
temperature_sensor_3:
id: bms${bms_id}_temperature_sensor_3
name: "${name} ${bms_name} temperature sensor 3"
temperature_sensor_4:
id: bms${bms_id}_temperature_sensor_4
name: "${name} ${bms_name} temperature sensor 4"
temperature_sensor_5:
id: bms${bms_id}_temperature_sensor_5
name: "${name} ${bms_name} temperature sensor 5"
temperature_powertube:
name: "${name} ${bms_name} temperature powertube"
battery_capacity_state_of_charge:
id: bms${bms_id}_state_of_charge
name: "${name} ${bms_name} battery capacity state of charge"
battery_capacity_remaining:
id: bms${bms_id}_capacity_remaining_ah
name: "${name} ${bms_name} battery capacity remaining"
charging_cycles:
id: bms${bms_id}_charging_cycles
name: "${name} ${bms_name} charging cycles"
battery_capacity_total_charging_cycle:
name: "${name} ${bms_name} battery capacity total charging cycle"
battery_total_runtime:
name: "${name} ${bms_name} battery total runtime"
balancing_current:
name: "${name} ${bms_name} balancing current"
errors_bitmask:
id: bms${bms_id}_errors_bitmask
name: "${name} ${bms_name} errors bitmask"
cell_count_real:
name: "${name} ${bms_name} cell count real"
smart_sleep_time:
name: "${name} ${bms_name} smart sleep time"
powertube_temperature_protection:
name: "${name} ${bms_name} powertube temperature protection"
powertube_temperature_protection_recovery:
name: "${name} ${bms_name} powertube temperature protection recovery"
battery_total_alarms_count:
name: "${name} ${bms_name} battery total alarms count"
battery_total_alarms_active:
name: "${name} ${bms_name} battery total alarms active"
emergency_time_countdown:
name: "${name} ${bms_name} emergency time countdown"
uart1_protocol_number:
name: "${name} ${bms_name} uart1 protocol number"
uart2_protocol_number:
name: "${name} ${bms_name} uart2 protocol number"
battery_soh_valuation:
name: "${name} ${bms_name} battery soh valuation"
discharging_overcurrent_protection_release_time:
name: "${name} ${bms_name} discharging overcurrent protection release time"
discharging_short_circuit_protection_release_time:
name: "${name} ${bms_name} discharging short circuit protection release time"
charging_overcurrent_protection_release_time:
name: "${name} ${bms_name} charging overcurrent protection release time"
charging_short_circuit_protection_release_time:
name: "${name} ${bms_name} charging short circuit protection release time"
cell_undervoltage_protection_release_time:
name: "${name} ${bms_name} cell undervoltage protection release time"
cell_overvoltage_protection_release_time:
name: "${name} ${bms_name} cell overvoltage protection release time"
text_sensor:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
errors:
name: "${name} ${bms_name} errors"
operation_status:
name: "${name} ${bms_name} operation status"
battery_type:
name: "${name} ${bms_name} battery type"
total_runtime_formatted:
name: "${name} ${bms_name} total runtime formatted"
info_vendorid:
name: "${name} ${bms_name} info vendorid"
info_hardware_version:
name: "${name} ${bms_name} info hardware version"
info_software_version:
name: "${name} ${bms_name} info software version"
info_device_name:
name: "${name} ${bms_name} info device name"
info_device_password:
name: "${name} ${bms_name} info device password"
network_nodes_available:
name: "${name} ${bms_name} network nodes available"
info_device_serial_number:
name: "${name} ${bms_name} info device serial number"
info_device_setup_passcode:
name: "${name} ${bms_name} info device setup passcode"
number:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
cell_smart_sleep_voltage:
name: "${name} ${bms_name} cell smart sleep voltage"
cell_overvoltage_protection:
id: bms${bms_id}_cell_ovp
name: "${name} ${bms_name} cell overvoltage protection"
cell_overvoltage_protection_recovery:
id: bms${bms_id}_cell_ovpr
name: "${name} ${bms_name} cell overvoltage protection recovery"
cell_request_charge_voltage:
name: "${name} ${bms_name} cell request charge voltage"
cell_request_charge_voltage_time:
name: "${name} ${bms_name} cell request charge voltage time"
cell_request_float_voltage:
name: "${name} ${bms_name} cell request float voltage"
cell_request_float_voltage_time:
name: "${name} ${bms_name} cell request float voltage time"
cell_balancing_trigger_voltage:
id: bms${bms_id}_balance_trigger_voltage
name: "${name} ${bms_name} balancing trigger voltage"
cell_balancing_starting_voltage:
name: "${name} ${bms_name} cell balancing starting voltage"
max_balancing_current:
name: "${name} ${bms_name} max balancing current"
cell_soc100_voltage:
name: "${name} ${bms_name} cell soc100 voltage"
cell_soc0_voltage:
name: "${name} ${bms_name} cell soc0 voltage"
cell_undervoltage_protection:
id: bms${bms_id}_cell_uvp
name: "${name} ${bms_name} cell undervoltage protection"
cell_undervoltage_protection_recovery:
id: bms${bms_id}_cell_uvpr
name: "${name} ${bms_name} cell undervoltage protection recovery"
cell_power_off_voltage:
name: "${name} ${bms_name} cell power off voltage"
cell_count_settings:
id: bms${bms_id}_cell_count
name: "${name} ${bms_name} cell count settings"
battery_capacity_total_settings:
id: bms${bms_id}_battery_capacity
name: "${name} ${bms_name} battery capacity total setting"
max_charging_current:
id: bms${bms_id}_max_charge_current
name: "${name} ${bms_name} max charging current"
max_discharging_current:
id: bms${bms_id}_max_discharge_current
name: "${name} ${bms_name} max discharging current"
charging_overcurrent_protection_delay:
name: "${name} ${bms_name} charging overcurrent protection delay"
charging_overcurrent_protection_recovery_delay:
name: "${name} ${bms_name} charging overcurrent protection recovery delay"
discharging_overcurrent_protection_delay:
name: "${name} ${bms_name} discharging overcurrent protection delay"
discharging_overcurrent_protection_recovery_delay:
name: "${name} ${bms_name} discharging overcurrent protection recovery delay"
short_circuit_protection_delay:
name: "${name} ${bms_name} short circuit protection delay"
short_circuit_protection_recovery_delay:
name: "${name} ${bms_name} short circuit protection recovery delay"
precharging_time_from_discharge:
name: "${name} ${bms_name} precharging time from discharge"
charging_overtemperature_protection:
name: "${name} ${bms_name} charging overtemperature protection"
charging_overtemperature_protection_recovery:
name: "${name} ${bms_name} charging overtemperature protection recovery"
discharging_overtemperature_protection:
name: "${name} ${bms_name} discharging overtemperature protection"
discharging_overtemperature_protection_recovery:
name: "${name} ${bms_name} discharging overtemperature protection recovery"
charging_lowtemperature_protection:
name: "${name} ${bms_name} charging lowtemperature protection"
charging_lowtemperature_protection_recovery:
name: "${name} ${bms_name} charging lowtemperature protection recovery"
mos_overtemperature_protection:
name: "${name} ${bms_name} mos overtemperature protection"
mos_overtemperature_protection_recovery:
name: "${name} ${bms_name} mos overtemperature protection recovery"
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.3
# Updated : 2025.01.25
# Version : 1.2.4
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -43,11 +43,12 @@ switch:
precharging:
name: "${name} ${bms_name} precharging"
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} charging"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} discharging"
balancing:
id: bms${bms_id}_switch_balancing
name: "${name} ${bms_name} balancing"
emergency:
name: "${name} ${bms_name} emergency"
@@ -0,0 +1,22 @@
# Updated : 2025.03.30
# Version : 1.1.1
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
packages:
bms_sensors: !include bms_sensors_JK-PB_RS485_bms_standard.yaml
bms_combine: !include bms_combine.yaml
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.6
# Updated : 2025.01.25
# Version : 1.2.7
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -29,9 +29,12 @@ logger:
# +--------------------------------------+
external_components:
- source: github://txubelaxu/esphome-jk-bms@main
refresh: 0s
components: [ jk_rs485_sniffer , jk_rs485_bms ]
- source: github://Sleeper85/esphome-components@main
refresh: 0s
components: [ jk_rs485_sniffer , jk_rs485_bms ]
# - source:
# type: local
# path: ../esphome-components/components
jk_rs485_sniffer:
- id: ${sniffer_id}
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.6
# Updated : 2025.01.25
# Version : 1.2.7
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -29,9 +29,12 @@ logger:
# +--------------------------------------+
external_components:
- source: github://txubelaxu/esphome-jk-bms@main
refresh: 0s
components: [ jk_rs485_sniffer , jk_rs485_bms ]
- source: github://Sleeper85/esphome-components@main
refresh: 0s
components: [ jk_rs485_sniffer , jk_rs485_bms ]
# - source:
# type: local
# path: ../esphome-components/components
jk_rs485_sniffer:
- id: ${sniffer_id}
+4 -4
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.18
# Version : 1.1.2
# Updated : 2025.01.25
# Version : 1.1.3
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -128,10 +128,10 @@ sensor:
- or:
- throttle: 10s
- delta: 0.01
# state_of_charge
# battery_soc
- platform: modbus_controller
modbus_controller_id: modbus_controller${bms_id}
id: bms${bms_id}_state_of_charge
id: bms${bms_id}_battery_soc
name: "${name} ${bms_name} SoC"
register_type: read
address: 11
@@ -1,5 +1,5 @@
# Updated : 2025.01.17
# Version : 1.1.1
# Updated : 2025.01.25
# Version : 1.1.2
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -74,21 +74,24 @@ sensor:
uint16_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state;
uint16_t yambms_errors_bitmask = 0;
if (bms_errors_bitmask & 0x0001) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0002) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0004) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0008) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0010) yambms_errors_bitmask |= 0x0020;
if (bms_errors_bitmask & 0x0020) yambms_errors_bitmask |= 0x0040;
if (bms_errors_bitmask & 0x0040) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0080) yambms_errors_bitmask |= 0x0010;
if (bms_errors_bitmask & 0x0100) yambms_errors_bitmask |= 0x0100;
if (bms_errors_bitmask & 0x0200) yambms_errors_bitmask |= 0x0080;
if (bms_errors_bitmask & 0x0400) yambms_errors_bitmask |= 0x0400;
if (bms_errors_bitmask & 0x0800) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x1000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x2000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x4000) yambms_errors_bitmask |= 0x0000;
if (bms_errors_bitmask & 0x8000) yambms_errors_bitmask |= 0x0000;
if (bms_errors_bitmask > 0)
{
if (bms_errors_bitmask & 0x0001) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0002) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0004) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0008) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0010) yambms_errors_bitmask |= 0x0020;
if (bms_errors_bitmask & 0x0020) yambms_errors_bitmask |= 0x0040;
if (bms_errors_bitmask & 0x0040) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0080) yambms_errors_bitmask |= 0x0010;
if (bms_errors_bitmask & 0x0100) yambms_errors_bitmask |= 0x0100;
if (bms_errors_bitmask & 0x0200) yambms_errors_bitmask |= 0x0080;
if (bms_errors_bitmask & 0x0400) yambms_errors_bitmask |= 0x0400;
if (bms_errors_bitmask & 0x0800) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x1000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x2000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x4000) yambms_errors_bitmask |= 0x0000;
if (bms_errors_bitmask & 0x8000) yambms_errors_bitmask |= 0x0000;
}
return yambms_errors_bitmask;
+21 -18
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.17
# Version : 1.1.1
# Updated : 2025.01.25
# Version : 1.1.2
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -74,21 +74,24 @@ sensor:
uint16_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state;
uint16_t yambms_errors_bitmask = 0;
if (bms_errors_bitmask & 0x0001) yambms_errors_bitmask |= 0x0020;
if (bms_errors_bitmask & 0x0002) yambms_errors_bitmask |= 0x0040;
if (bms_errors_bitmask & 0x0004) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0008) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0010) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0020) yambms_errors_bitmask |= 0x0080;
if (bms_errors_bitmask & 0x0040) yambms_errors_bitmask |= 0x0400;
if (bms_errors_bitmask & 0x0080) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0100) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0200) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0400) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0800) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x1000) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x2000) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x4000) yambms_errors_bitmask |= 0x0100;
if (bms_errors_bitmask & 0x8000) yambms_errors_bitmask |= 0x0400;
if (bms_errors_bitmask > 0)
{
if (bms_errors_bitmask & 0x0001) yambms_errors_bitmask |= 0x0020;
if (bms_errors_bitmask & 0x0002) yambms_errors_bitmask |= 0x0040;
if (bms_errors_bitmask & 0x0004) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0008) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0010) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0020) yambms_errors_bitmask |= 0x0080;
if (bms_errors_bitmask & 0x0040) yambms_errors_bitmask |= 0x0400;
if (bms_errors_bitmask & 0x0080) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0100) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0200) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0400) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0800) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x1000) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x2000) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x4000) yambms_errors_bitmask |= 0x0100;
if (bms_errors_bitmask & 0x8000) yambms_errors_bitmask |= 0x0400;
}
return yambms_errors_bitmask;
+21 -18
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.17
# Version : 1.1.1
# Updated : 2025.01.25
# Version : 1.1.2
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -74,21 +74,24 @@ sensor:
uint16_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state;
uint16_t yambms_errors_bitmask = 0;
if (bms_errors_bitmask & 0x0001) yambms_errors_bitmask |= 0x0000;
if (bms_errors_bitmask & 0x0002) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0004) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0008) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0010) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0020) yambms_errors_bitmask |= 0x0100;
if (bms_errors_bitmask & 0x0040) yambms_errors_bitmask |= 0x0080;
if (bms_errors_bitmask & 0x0080) yambms_errors_bitmask |= 0x1000;
if (bms_errors_bitmask & 0x0100) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0200) yambms_errors_bitmask |= 0x0010;
if (bms_errors_bitmask & 0x0400) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0800) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x1000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x2000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x4000) yambms_errors_bitmask |= 0x0000;
if (bms_errors_bitmask & 0x8000) yambms_errors_bitmask |= 0x0000;
if (bms_errors_bitmask > 0)
{
if (bms_errors_bitmask & 0x0001) yambms_errors_bitmask |= 0x0000;
if (bms_errors_bitmask & 0x0002) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0004) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0008) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x0010) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0020) yambms_errors_bitmask |= 0x0100;
if (bms_errors_bitmask & 0x0040) yambms_errors_bitmask |= 0x0080;
if (bms_errors_bitmask & 0x0080) yambms_errors_bitmask |= 0x1000;
if (bms_errors_bitmask & 0x0100) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0200) yambms_errors_bitmask |= 0x0010;
if (bms_errors_bitmask & 0x0400) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0800) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x1000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x2000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x4000) yambms_errors_bitmask |= 0x0000;
if (bms_errors_bitmask & 0x8000) yambms_errors_bitmask |= 0x0000;
}
return yambms_errors_bitmask;
@@ -1,4 +1,4 @@
# Updated : 2025.01.22
# Updated : 2025.01.25
# Version : 1.1.2
# GitHub : https://github.com/syssi/esphome-jk-bms
@@ -33,7 +33,7 @@
# Bit 9 Charge UTP 0000 0010 0000 0000 0x0200
# Bit 10 CPU aux comm error 0000 0100 0000 0000 0x0400
# Bit 11 Cell UVP 0000 1000 0000 0000 0x0800
# Bit 12 Batt UVP 0001 0000 0000 0000 0x1000
# Bit 12 Battery UVP 0001 0000 0000 0000 0x1000
# Bit 13 Discharge OCP 0010 0000 0000 0000 0x2000
# Bit 14 Discharge SCP 0100 0000 0000 0000 0x4000
# Bit 15 Discharge OTP 1000 0000 0000 0000 0x8000
@@ -79,24 +79,31 @@ sensor:
- throttle: 10s
- delta: 1
lambda: |-
uint16_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state;
uint32_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state;
uint16_t yambms_errors_bitmask = 0;
# if (bms_errors_bitmask & 0x0001) yambms_errors_bitmask |= 0x0800;
# if (bms_errors_bitmask & 0x0002) yambms_errors_bitmask |= 0x0008;
# if (bms_errors_bitmask & 0x0004) yambms_errors_bitmask |= 0x0800;
# if (bms_errors_bitmask & 0x0008) yambms_errors_bitmask |= 0x0800;
# if (bms_errors_bitmask & 0x0010) yambms_errors_bitmask |= 0x0002;
# if (bms_errors_bitmask & 0x0020) yambms_errors_bitmask |= 0x0002;
# if (bms_errors_bitmask & 0x0040) yambms_errors_bitmask |= 0x0100;
# if (bms_errors_bitmask & 0x0080) yambms_errors_bitmask |= 0x0400;
# if (bms_errors_bitmask & 0x0100) yambms_errors_bitmask |= 0x0020;
# if (bms_errors_bitmask & 0x0200) yambms_errors_bitmask |= 0x0010;
# if (bms_errors_bitmask & 0x0400) yambms_errors_bitmask |= 0x0800;
# if (bms_errors_bitmask & 0x0800) yambms_errors_bitmask |= 0x0004;
# if (bms_errors_bitmask & 0x1000) yambms_errors_bitmask |= 0x0004;
# if (bms_errors_bitmask & 0x2000) yambms_errors_bitmask |= 0x0080;
# if (bms_errors_bitmask & 0x4000) yambms_errors_bitmask |= 0x0400;
# if (bms_errors_bitmask & 0x8000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask > 0)
{
if (bms_errors_bitmask & 0x0001) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0002) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x0004) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0008) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0010) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0020) yambms_errors_bitmask |= 0x0002;
if (bms_errors_bitmask & 0x0040) yambms_errors_bitmask |= 0x0100;
if (bms_errors_bitmask & 0x0080) yambms_errors_bitmask |= 0x0400;
if (bms_errors_bitmask & 0x0100) yambms_errors_bitmask |= 0x0020;
if (bms_errors_bitmask & 0x0200) yambms_errors_bitmask |= 0x0010;
if (bms_errors_bitmask & 0x0400) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x0800) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x1000) yambms_errors_bitmask |= 0x0004;
if (bms_errors_bitmask & 0x2000) yambms_errors_bitmask |= 0x0080;
if (bms_errors_bitmask & 0x4000) yambms_errors_bitmask |= 0x0400;
if (bms_errors_bitmask & 0x8000) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x10000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x20000) yambms_errors_bitmask |= 0x0800;
if (bms_errors_bitmask & 0x200000) yambms_errors_bitmask |= 0x0008;
if (bms_errors_bitmask & 0x400000) yambms_errors_bitmask |= 0x0800;
}
return yambms_errors_bitmask;
+1 -1
View File
@@ -60,7 +60,7 @@ modbus_controller:
- address: 11
value_type: U_WORD
read_lambda: |-
return uint16_t(id(bms${bms_id}_state_of_charge).state);
return uint16_t(id(bms${bms_id}_battery_soc).state);
# battery_capacity (Ah)
- address: 12
value_type: U_WORD
@@ -0,0 +1,61 @@
# Updated : 2025.01.27
# Version : 1.1.2
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
script:
- id: bms${bms_id}_script_cutoff_timer
then:
- delay: ${bms_cutoff_timer}
- switch.turn_off: bms${bms_id}_charge_switch
- logger.log: "BMS ${bms_id} charge_switch Turn OFF"
interval:
- interval: ${bms_combine_interval}
then:
- lambda: |-
float battery_v = id(bms${bms_id}_total_voltage).state;
float rebulk_v = id(${yambms_id}_rebulk_voltage).state;
// Charge switch `Turn ON` conditions (Charge switch OFF and ReBulk V.)
if (!id(bms${bms_id}_charge_switch).state && (battery_v <= rebulk_v))
{
id(bms${bms_id}_charge_switch).turn_on();
ESP_LOGD("main", "BMS ${bms_id} charge_switch Turn ON");
}
// Charge switch `Turn OFF` conditions
else if (id(${yambms_id}_charge_status) == "Cut-Off")
{
// The cells are equalizing
if (id(bms${bms_id}_equalizing).state)
{
// Stop cut-off timer
if (id(bms${bms_id}_script_cutoff_timer).is_running()) id(bms${bms_id}_script_cutoff_timer).stop();
}
// The cells are not equalizing and Cut-Off timer not running
else if (!id(bms${bms_id}_script_cutoff_timer).is_running())
{
// Start cut-off timer
// If the conditions continue to be respected the `Charge switch` will be turned OFF
id(bms${bms_id}_script_cutoff_timer).execute();
}
}
// Cut-off timer is running ?
else if (id(bms${bms_id}_script_cutoff_timer).is_running())
{
id(bms${bms_id}_script_cutoff_timer).stop(); // Stop cut-off timer
}
+6 -6
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.17
# Version : 1.1.2
# Updated : 2025.01.25
# Version : 1.1.3
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -28,7 +28,7 @@ sensor:
update_interval: ${bms_update_interval}
accuracy_decimals: 0
unit_of_measurement: Ah
device_class: energy_storage
icon: mdi:car-battery
filters:
- or:
- throttle: 10s
@@ -42,7 +42,7 @@ sensor:
update_interval: ${bms_update_interval}
accuracy_decimals: 0
unit_of_measurement: Ah
device_class: energy_storage
icon: mdi:car-battery
filters:
- or:
- throttle: 10s
@@ -93,8 +93,8 @@ sensor:
# state_of_charge
- platform: template
id: bms${bms_id}_state_of_charge
name: "${name} ${bms_name} SoC"
id: bms${bms_id}_battery_soc
name: "${name} ${bms_name} Battery SoC"
update_interval: ${bms_update_interval}
accuracy_decimals: 0
unit_of_measurement: '%'
+313
View File
@@ -0,0 +1,313 @@
# Updated : 2025.01.28
# Version : 1.1.1
# GitHub : https://github.com/syssi/esphome-jdb-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
packages:
bms_base: !include bms_base.yaml
bms_temperature_sensor: !include bms_temperature_sensor_6.yaml
bms_errors_bitmask: !include bms_errors_bitmask_JBD.yaml
ota:
on_begin:
then:
- switch.turn_off: bms${bms_id}_enable_bluetooth_connection
- logger.log: "BLE shutdown for flashing"
# +--------------------------------------+
# | Component settings |
# +--------------------------------------+
external_components:
- source: github://syssi/esphome-jbd-bms@main
refresh: 0s
esp32_ble_tracker:
scan_parameters:
active: false
ble_client:
- id: ble_client${bms_id}
mac_address: ${bms_ble_mac_address}
jbd_bms_ble:
- id: jbd_bms_ble${bms_id}
ble_client_id: ble_client${bms_id}
update_interval: ${bms_update_interval} # Some Liontron BMS models require an update interval of less than 8s
# +--------------------------------------+
# | Component entities |
# +--------------------------------------+
button:
- platform: jbd_bms_ble
jbd_bms_ble_id: jbd_bms_ble${bms_id}
retrieve_hardware_version:
name: "${name} ${bms_name} retrieve hardware version"
binary_sensor:
- platform: jbd_bms_ble
jbd_bms_ble_id: jbd_bms_ble${bms_id}
balancing:
id: bms${bms_id}_equalizing
name: "${name} ${bms_name} balancing"
charging:
id: bms${bms_id}_charging_allowed
name: "${name} ${bms_name} charging"
discharging:
id: bms${bms_id}_discharging_allowed
name: "${name} ${bms_name} discharging"
online_status:
id: bms${bms_id}_online_status
name: "${name} ${bms_name} online status"
switch:
- platform: jbd_bms_ble
jbd_bms_ble_id: jbd_bms_ble${bms_id}
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} Charge switch"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} Discharge switch"
# +--------------------------------------+
- platform: ble_client
ble_client_id: ble_client${bms_id}
id: bms${bms_id}_enable_bluetooth_connection
name: "${name} ${bms_name} ${bms_name} Enable Bluetooth connection"
# +--------------------------------------+
sensor:
- platform: jbd_bms_ble
jbd_bms_ble_id: jbd_bms_ble${bms_id}
battery_strings:
name: "${name} ${bms_name} battery strings"
current:
id: bms${bms_id}_current
name: "${name} ${bms_name} current"
power:
id: bms${bms_id}_power
name: "${name} ${bms_name} power"
charging_power:
id: bms${bms_id}_charging_power
name: "${name} ${bms_name} charging power"
discharging_power:
id: bms${bms_id}_discharging_power
name: "${name} ${bms_name} discharging power"
state_of_charge:
id: bms${bms_id}_state_of_charge
name: "${name} ${bms_name} state of charge"
nominal_capacity:
id: bms${bms_id}_battery_capacity
name: "${name} ${bms_name} nominal capacity"
charging_cycles:
id: bms${bms_id}_charging_cycles
name: "${name} ${bms_name} charging cycles"
capacity_remaining:
id: bms${bms_id}_capacity_remaining_ah
name: "${name} ${bms_name} capacity remaining"
battery_cycle_capacity:
name: "${name} ${bms_name} battery cycle capacity"
total_voltage:
id: bms${bms_id}_total_voltage
name: "${name} ${bms_name} total voltage"
average_cell_voltage:
id: bms${bms_id}_average_cell_voltage
name: "${name} ${bms_name} average cell voltage"
delta_cell_voltage:
id: bms${bms_id}_delta_cell_voltage
name: "${name} ${bms_name} delta cell voltage"
min_cell_voltage:
id: bms${bms_id}_min_cell_voltage
name: "${name} ${bms_name} min cell voltage"
max_cell_voltage:
id: bms${bms_id}_max_cell_voltage
name: "${name} ${bms_name} max cell voltage"
min_voltage_cell:
id: bms${bms_id}_min_voltage_cell
name: "${name} ${bms_name} min voltage cell"
max_voltage_cell:
id: bms${bms_id}_max_voltage_cell
name: "${name} ${bms_name} max voltage cell"
temperature_1:
id: bms${bms_id}_temperature_sensor_1
name: "${name} ${bms_name} temperature 1"
temperature_2:
id: bms${bms_id}_temperature_sensor_2
name: "${name} ${bms_name} temperature 2"
temperature_3:
id: bms${bms_id}_temperature_sensor_3
name: "${name} ${bms_name} temperature 3"
temperature_4:
id: bms${bms_id}_temperature_sensor_4
name: "${name} ${bms_name} temperature 4"
temperature_5:
id: bms${bms_id}_temperature_sensor_5
name: "${name} ${bms_name} temperature 5"
temperature_6:
id: bms${bms_id}_temperature_sensor_6
name: "${name} ${bms_name} temperature 6"
cell_voltage_1:
name: "${name} ${bms_name} cell voltage 1"
cell_voltage_2:
name: "${name} ${bms_name} cell voltage 2"
cell_voltage_3:
name: "${name} ${bms_name} cell voltage 3"
cell_voltage_4:
name: "${name} ${bms_name} cell voltage 4"
cell_voltage_5:
name: "${name} ${bms_name} cell voltage 5"
cell_voltage_6:
name: "${name} ${bms_name} cell voltage 6"
cell_voltage_7:
name: "${name} ${bms_name} cell voltage 7"
cell_voltage_8:
name: "${name} ${bms_name} cell voltage 8"
cell_voltage_9:
name: "${name} ${bms_name} cell voltage 9"
cell_voltage_10:
name: "${name} ${bms_name} cell voltage 10"
cell_voltage_11:
name: "${name} ${bms_name} cell voltage 11"
cell_voltage_12:
name: "${name} ${bms_name} cell voltage 12"
cell_voltage_13:
name: "${name} ${bms_name} cell voltage 13"
cell_voltage_14:
name: "${name} ${bms_name} cell voltage 14"
cell_voltage_15:
name: "${name} ${bms_name} cell voltage 15"
cell_voltage_16:
name: "${name} ${bms_name} cell voltage 16"
# cell_voltage_17:
# name: "${name} ${bms_name} cell voltage 17"
# cell_voltage_18:
# name: "${name} ${bms_name} cell voltage 18"
# cell_voltage_19:
# name: "${name} ${bms_name} cell voltage 19"
# cell_voltage_20:
# name: "${name} ${bms_name} cell voltage 20"
# cell_voltage_21:
# name: "${name} ${bms_name} cell voltage 21"
# cell_voltage_22:
# name: "${name} ${bms_name} cell voltage 22"
# cell_voltage_23:
# name: "${name} ${bms_name} cell voltage 23"
# cell_voltage_24:
# name: "${name} ${bms_name} cell voltage 24"
# cell_voltage_25:
# name: "${name} ${bms_name} cell voltage 25"
# cell_voltage_26:
# name: "${name} ${bms_name} cell voltage 26"
# cell_voltage_27:
# name: "${name} ${bms_name} cell voltage 27"
# cell_voltage_28:
# name: "${name} ${bms_name} cell voltage 28"
# cell_voltage_29:
# name: "${name} ${bms_name} cell voltage 29"
# cell_voltage_30:
# name: "${name} ${bms_name} cell voltage 30"
# cell_voltage_31:
# name: "${name} ${bms_name} cell voltage 31"
# cell_voltage_32:
# name: "${name} ${bms_name} cell voltage 32"
operation_status_bitmask:
name: "${name} ${bms_name} operation status bitmask"
errors_bitmask:
id: bms${bms_id}_errors_bitmask
name: "${name} ${bms_name} errors bitmask"
balancer_status_bitmask:
name: "${name} ${bms_name} balancer status bitmask"
software_version:
name: "${name} ${bms_name} software version"
# Required sensors cannot be retrieved from BMS
# max_charge_current
- platform: template
id: bms${bms_id}_max_charge_current
name: "${name} ${bms_name} max charge current"
update_interval: ${bms_update_interval}
accuracy_decimals: 0
unit_of_measurement: A
icon: mdi:current-dc
filters:
- or:
- throttle: 10s
- delta: 1
lambda: return ${bms_max_charge_current};
# max_discharge_current
- platform: template
id: bms${bms_id}_max_discharge_current
name: "${name} ${bms_name} max discharge current"
update_interval: ${bms_update_interval}
accuracy_decimals: 0
unit_of_measurement: A
icon: mdi:current-dc
filters:
- or:
- throttle: 10s
- delta: 1
lambda: return ${bms_max_discharge_current};
# cell_ovp
- platform: template
id: bms${bms_id}_cell_ovp
name: "${name} ${bms_name} cell ovp"
update_interval: ${bms_update_interval}
accuracy_decimals: 3
unit_of_measurement: V
device_class: voltage
filters:
- or:
- throttle: 10s
- delta: 0.001
lambda: return ${bms_cell_ovp};
# cell_uvp
- platform: template
id: bms${bms_id}_cell_uvp
name: "${name} ${bms_name} cell uvp"
update_interval: ${bms_update_interval}
accuracy_decimals: 3
unit_of_measurement: V
device_class: voltage
filters:
- or:
- throttle: 10s
- delta: 0.001
lambda: return ${bms_cell_uvp};
# balance_trigger_voltage
- platform: template
id: bms${bms_id}_balance_trigger_voltage
name: "${name} ${bms_name} balance trigger voltage"
update_interval: ${bms_update_interval}
accuracy_decimals: 3
unit_of_measurement: V
device_class: voltage
filters:
- or:
- throttle: 10s
- delta: 0.001
lambda: return ${bms_balance_trigger_voltage};
text_sensor:
- platform: jbd_bms_ble
jbd_bms_ble_id: jbd_bms_ble${bms_id}
errors:
name: "${name} ${bms_name} errors"
operation_status:
name: "${name} ${bms_name} operation status"
device_model:
name: "${name} ${bms_name} device model"
+5 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.1.2
# Updated : 2025.01.28
# Version : 1.1.3
# GitHub : https://github.com/syssi/esphome-jdb-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -20,7 +20,7 @@
packages:
bms_base: !include bms_base.yaml
bms_temperature_sensor: !include bms_temperature_sensor_6.yaml
bms_errors_bitmask: !include bms_errors_bitmask_JBD_UART.yaml
bms_errors_bitmask: !include bms_errors_bitmask_JBD.yaml
# +--------------------------------------+
# | Component settings |
@@ -70,8 +70,10 @@ switch:
- platform: jbd_bms
jbd_bms_id: jbd_bms${bms_id}
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} Charge switch"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} Discharge switch"
sensor:
@@ -1,4 +1,4 @@
# Updated : 2025.01.16
# Updated : 2025.01.28
# Version : 1.2.6
# GitHub : https://github.com/syssi/esphome-jk-bms
@@ -53,8 +53,8 @@ esp32_ble_tracker:
}
ble_client:
- mac_address: ${bms_ble_mac_address}
id: ble_client${bms_id}
- id: ble_client${bms_id}
mac_address: ${bms_ble_mac_address}
jk_bms_ble:
- ble_client_id: ble_client${bms_id}
@@ -86,8 +86,10 @@ switch:
- platform: jk_bms_ble
jk_bms_ble_id: jk_bms_ble${bms_id}
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} Charge switch"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} Discharge switch"
balancer:
name: "${name} ${bms_name} Balance switch"
+3 -1
View File
@@ -1,4 +1,4 @@
# Updated : 2025.01.16
# Updated : 2025.01.25
# Version : 1.2.6
# GitHub : https://github.com/syssi/esphome-jk-bms
@@ -79,8 +79,10 @@ switch:
- platform: jk_bms
jk_bms_id: jk_bms${bms_id}
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} Charge switch"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} Discharge switch"
# It is not possible to control the balancer from UART-TTL (confirmed by @syssi)
@@ -0,0 +1,474 @@
# Updated : 2025.03.30
# Version : 1.2.5
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
packages:
bms_base: !include bms_base.yaml
bms_temperature_sensor: !include bms_temperature_sensor_5.yaml
bms_errors_bitmask: !include bms_errors_bitmask_JK-PB_RS485.yaml
# +--------------------------------------+
# | Component settings |
# +--------------------------------------+
jk_rs485_bms:
- id: jk_rs485_bms${bms_id}
rs485_address: ${bms_address}
jk_rs485_sniffer_id: ${sniffer_id}
update_interval: ${bms_update_interval}
# +--------------------------------------+
# | Component entities |
# +--------------------------------------+
switch:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
precharging:
name: "${name} ${bms_name} precharging"
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} charging"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} discharging"
balancing:
name: "${name} ${bms_name} balancing"
emergency:
name: "${name} ${bms_name} emergency"
heating:
name: "${name} ${bms_name} heating"
display_always_on:
name: "${name} ${bms_name} display_always_on"
charging_float_mode:
name: "${name} ${bms_name} charging float mode"
timed_stored_data:
name: "${name} ${bms_name} timed stored data"
disable_temperature_sensors:
name: "${name} ${bms_name} disable temperature sensors"
smart_sleep_on:
name: "${name} ${bms_name} smart sleep on"
disable_pcl_module:
name: "${name} ${bms_name} disable pcl module"
gps_heartbeat:
name: "${name} ${bms_name} gps heartbeat"
port_selection:
name: "${name} ${bms_name} port selection"
special_charger:
name: "${name} ${bms_name} special charger"
binary_sensor:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
status_balancing:
id: bms${bms_id}_equalizing
name: "${name} ${bms_name} status balancing"
status_precharging:
name: "${name} ${bms_name} status precharging"
status_charging:
id: bms${bms_id}_charging_allowed
name: "${name} ${bms_name} status charging"
status_discharging:
id: bms${bms_id}_discharging_allowed
name: "${name} ${bms_name} status discharging"
status_online:
id: bms${bms_id}_online_status
name: "${name} ${bms_name} status online"
status_heating:
name: "${name} ${bms_name} status heating"
alarm_wireres:
name: "${name} ${bms_name} alarm WireRes"
alarm_mosotp:
name: "${name} ${bms_name} alarm MosOTP"
alarm_cellquantity:
name: "${name} ${bms_name} alarm CellQuantity"
alarm_cursensorerr:
name: "${name} ${bms_name} alarm CurSensorErr"
alarm_cellovp:
name: "${name} ${bms_name} alarm CellOVP"
alarm_batovp:
name: "${name} ${bms_name} alarm BatOVP"
alarm_chocp:
name: "${name} ${bms_name} alarm ChOCP"
alarm_chscp:
name: "${name} ${bms_name} alarm ChSCP"
alarm_chotp:
name: "${name} ${bms_name} alarm ChOTP"
alarm_chutp:
name: "${name} ${bms_name} alarm ChUTP"
alarm_cpuauxcommuerr:
name: "${name} ${bms_name} alarm CPUAuxCommuErr"
alarm_celluvp:
name: "${name} ${bms_name} alarm CellUVP"
alarm_batuvp:
name: "${name} ${bms_name} alarm BatUVP"
alarm_dchocp:
name: "${name} ${bms_name} alarm DchOCP"
alarm_dchscp:
name: "${name} ${bms_name} alarm DchSCP"
alarm_dchotp:
name: "${name} ${bms_name} alarm DchOTP"
alarm_chargemos:
name: "${name} ${bms_name} alarm ChargeMOS"
alarm_dischargemos:
name: "${name} ${bms_name} alarm DischargeMOS"
alarm_gpsdisconneted:
name: "${name} ${bms_name} alarm GPSDisconneted"
alarm_modifypwdintime:
name: "${name} ${bms_name} alarm ModifyPWDinTime"
alarm_dischargeonfailed:
name: "${name} ${bms_name} alarm DischargeOnFailed"
alarm_batteryovertemp:
name: "${name} ${bms_name} alarm BatteryOverTemp"
alarm_temperaturesensoranomaly:
name: "${name} ${bms_name} alarm TemperatureSensorAnomaly"
alarm_plcmoduleanomaly:
name: "${name} ${bms_name} alarm PLCModuleAnomaly"
alarm_mostempsensorabsent:
name: "${name} ${bms_name} alarm MOSTempSensorAbsent"
alarm_battempsensor1absent:
name: "${name} ${bms_name} alarm BATTempSensor1Absent"
alarm_battempsensor2absent:
name: "${name} ${bms_name} alarm BATTempSensor2Absent"
alarm_battempsensor3absent:
name: "${name} ${bms_name} alarm BATTempSensor3Absent"
alarm_battempsensor4absent:
name: "${name} ${bms_name} alarm BATTempSensor4Absent"
alarm_battempsensor5absent:
name: "${name} ${bms_name} alarm BATTempSensor5Absent"
sensor:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
balancing_direction:
name: "${name} ${bms_name} balancing direction"
cell_voltage_min:
id: bms${bms_id}_min_cell_voltage
name: "${name} ${bms_name} cell voltage min"
cell_voltage_max:
id: bms${bms_id}_max_cell_voltage
name: "${name} ${bms_name} cell voltage max"
cell_voltage_min_cell_number:
id: bms${bms_id}_min_voltage_cell
name: "${name} ${bms_name} cell voltage min cell number"
cell_voltage_max_cell_number:
id: bms${bms_id}_max_voltage_cell
name: "${name} ${bms_name} cell voltage max cell number"
cell_delta_voltage:
name: "${name} ${bms_name} cell delta voltage"
cell_average_voltage:
id: bms${bms_id}_average_cell_voltage
name: "${name} ${bms_name} cell average voltage"
cell_resistance_min:
name: "${name} ${bms_name} cell resistance min"
cell_resistance_max:
name: "${name} ${bms_name} cell resistance max"
cell_resistance_min_cell_number:
name: "${name} ${bms_name} cell resistance min cell number"
cell_resistance_max_cell_number:
name: "${name} ${bms_name} cell resistance max cell number"
cell_voltage_01:
name: "${name} ${bms_name} cell voltage 01"
cell_voltage_02:
name: "${name} ${bms_name} cell voltage 02"
cell_voltage_03:
name: "${name} ${bms_name} cell voltage 03"
cell_voltage_04:
name: "${name} ${bms_name} cell voltage 04"
cell_voltage_05:
name: "${name} ${bms_name} cell voltage 05"
cell_voltage_06:
name: "${name} ${bms_name} cell voltage 06"
cell_voltage_07:
name: "${name} ${bms_name} cell voltage 07"
cell_voltage_08:
name: "${name} ${bms_name} cell voltage 08"
cell_voltage_09:
name: "${name} ${bms_name} cell voltage 09"
cell_voltage_10:
name: "${name} ${bms_name} cell voltage 10"
cell_voltage_11:
name: "${name} ${bms_name} cell voltage 11"
cell_voltage_12:
name: "${name} ${bms_name} cell voltage 12"
cell_voltage_13:
name: "${name} ${bms_name} cell voltage 13"
cell_voltage_14:
name: "${name} ${bms_name} cell voltage 14"
cell_voltage_15:
name: "${name} ${bms_name} cell voltage 15"
cell_voltage_16:
name: "${name} ${bms_name} cell voltage 16"
# cell_voltage_17:
# name: "${name} ${bms_name} cell voltage 17"
# cell_voltage_18:
# name: "${name} ${bms_name} cell voltage 18"
# cell_voltage_19:
# name: "${name} ${bms_name} cell voltage 19"
# cell_voltage_20:
# name: "${name} ${bms_name} cell voltage 20"
# cell_voltage_21:
# name: "${name} ${bms_name} cell voltage 21"
# cell_voltage_22:
# name: "${name} ${bms_name} cell voltage 22"
# cell_voltage_23:
# name: "${name} ${bms_name} cell voltage 23"
# cell_voltage_24:
# name: "${name} ${bms_name} cell voltage 24"
cell_resistance_01:
name: "${name} ${bms_name} cell resistance 01"
cell_resistance_02:
name: "${name} ${bms_name} cell resistance 02"
cell_resistance_03:
name: "${name} ${bms_name} cell resistance 03"
cell_resistance_04:
name: "${name} ${bms_name} cell resistance 04"
cell_resistance_05:
name: "${name} ${bms_name} cell resistance 05"
cell_resistance_06:
name: "${name} ${bms_name} cell resistance 06"
cell_resistance_07:
name: "${name} ${bms_name} cell resistance 07"
cell_resistance_08:
name: "${name} ${bms_name} cell resistance 08"
cell_resistance_09:
name: "${name} ${bms_name} cell resistance 09"
cell_resistance_10:
name: "${name} ${bms_name} cell resistance 10"
cell_resistance_11:
name: "${name} ${bms_name} cell resistance 11"
cell_resistance_12:
name: "${name} ${bms_name} cell resistance 12"
cell_resistance_13:
name: "${name} ${bms_name} cell resistance 13"
cell_resistance_14:
name: "${name} ${bms_name} cell resistance 14"
cell_resistance_15:
name: "${name} ${bms_name} cell resistance 15"
cell_resistance_16:
name: "${name} ${bms_name} cell resistance 16"
# cell_resistance_17:
# name: "${name} ${bms_name} cell resistance 17"
# cell_resistance_18:
# name: "${name} ${bms_name} cell resistance 18"
# cell_resistance_19:
# name: "${name} ${bms_name} cell resistance 19"
# cell_resistance_20:
# name: "${name} ${bms_name} cell resistance 20"
# cell_resistance_21:
# name: "${name} ${bms_name} cell resistance 21"
# cell_resistance_22:
# name: "${name} ${bms_name} cell resistance 22"
# cell_resistance_23:
# name: "${name} ${bms_name} cell resistance 23"
# cell_resistance_24:
# name: "${name} ${bms_name} cell resistance 24"
battery_voltage:
id: bms${bms_id}_total_voltage
name: "${name} ${bms_name} battery voltage"
battery_current:
id: bms${bms_id}_current
name: "${name} ${bms_name} battery current"
battery_power:
id: bms${bms_id}_power
name: "${name} ${bms_name} battery power"
battery_power_charging:
id: bms${bms_id}_charging_power
name: "${name} ${bms_name} battery power charging"
battery_power_discharging:
id: bms${bms_id}_discharging_power
name: "${name} ${bms_name} battery power discharging"
temperature_sensor_1:
id: bms${bms_id}_temperature_sensor_1
name: "${name} ${bms_name} temperature sensor 1"
temperature_sensor_2:
id: bms${bms_id}_temperature_sensor_2
name: "${name} ${bms_name} temperature sensor 2"
temperature_sensor_3:
id: bms${bms_id}_temperature_sensor_3
name: "${name} ${bms_name} temperature sensor 3"
temperature_sensor_4:
id: bms${bms_id}_temperature_sensor_4
name: "${name} ${bms_name} temperature sensor 4"
temperature_sensor_5:
id: bms${bms_id}_temperature_sensor_5
name: "${name} ${bms_name} temperature sensor 5"
temperature_powertube:
name: "${name} ${bms_name} temperature powertube"
battery_capacity_state_of_charge:
id: bms${bms_id}_state_of_charge
name: "${name} ${bms_name} battery capacity state of charge"
battery_capacity_remaining:
id: bms${bms_id}_capacity_remaining_ah
name: "${name} ${bms_name} battery capacity remaining"
charging_cycles:
id: bms${bms_id}_charging_cycles
name: "${name} ${bms_name} charging cycles"
battery_capacity_total_charging_cycle:
name: "${name} ${bms_name} battery capacity total charging cycle"
battery_total_runtime:
name: "${name} ${bms_name} battery total runtime"
balancing_current:
name: "${name} ${bms_name} balancing current"
errors_bitmask:
id: bms${bms_id}_errors_bitmask
name: "${name} ${bms_name} errors bitmask"
cell_count_real:
name: "${name} ${bms_name} cell count real"
smart_sleep_time:
name: "${name} ${bms_name} smart sleep time"
powertube_temperature_protection:
name: "${name} ${bms_name} powertube temperature protection"
powertube_temperature_protection_recovery:
name: "${name} ${bms_name} powertube temperature protection recovery"
battery_total_alarms_count:
name: "${name} ${bms_name} battery total alarms count"
battery_total_alarms_active:
name: "${name} ${bms_name} battery total alarms active"
emergency_time_countdown:
name: "${name} ${bms_name} emergency time countdown"
uart1_protocol_number:
name: "${name} ${bms_name} uart1 protocol number"
uart2_protocol_number:
name: "${name} ${bms_name} uart2 protocol number"
battery_soh_valuation:
name: "${name} ${bms_name} battery soh valuation"
discharging_overcurrent_protection_release_time:
name: "${name} ${bms_name} discharging overcurrent protection release time"
discharging_short_circuit_protection_release_time:
name: "${name} ${bms_name} discharging short circuit protection release time"
charging_overcurrent_protection_release_time:
name: "${name} ${bms_name} charging overcurrent protection release time"
charging_short_circuit_protection_release_time:
name: "${name} ${bms_name} charging short circuit protection release time"
cell_undervoltage_protection_release_time:
name: "${name} ${bms_name} cell undervoltage protection release time"
cell_overvoltage_protection_release_time:
name: "${name} ${bms_name} cell overvoltage protection release time"
text_sensor:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
errors:
name: "${name} ${bms_name} errors"
operation_status:
name: "${name} ${bms_name} operation status"
battery_type:
name: "${name} ${bms_name} battery type"
total_runtime_formatted:
name: "${name} ${bms_name} total runtime formatted"
info_vendorid:
name: "${name} ${bms_name} info vendorid"
info_hardware_version:
name: "${name} ${bms_name} info hardware version"
info_software_version:
name: "${name} ${bms_name} info software version"
info_device_name:
name: "${name} ${bms_name} info device name"
info_device_password:
name: "${name} ${bms_name} info device password"
network_nodes_available:
name: "${name} ${bms_name} network nodes available"
info_device_serial_number:
name: "${name} ${bms_name} info device serial number"
info_device_setup_passcode:
name: "${name} ${bms_name} info device setup passcode"
number:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
cell_smart_sleep_voltage:
name: "${name} ${bms_name} cell smart sleep voltage"
cell_overvoltage_protection:
id: bms${bms_id}_cell_ovp
name: "${name} ${bms_name} cell overvoltage protection"
cell_overvoltage_protection_recovery:
id: bms${bms_id}_cell_ovpr
name: "${name} ${bms_name} cell overvoltage protection recovery"
cell_request_charge_voltage:
name: "${name} ${bms_name} cell request charge voltage"
cell_request_charge_voltage_time:
name: "${name} ${bms_name} cell request charge voltage time"
cell_request_float_voltage:
name: "${name} ${bms_name} cell request float voltage"
cell_request_float_voltage_time:
name: "${name} ${bms_name} cell request float voltage time"
cell_balancing_trigger_voltage:
id: bms${bms_id}_balance_trigger_voltage
name: "${name} ${bms_name} balancing trigger voltage"
cell_balancing_starting_voltage:
name: "${name} ${bms_name} cell balancing starting voltage"
max_balancing_current:
name: "${name} ${bms_name} max balancing current"
cell_soc100_voltage:
name: "${name} ${bms_name} cell soc100 voltage"
cell_soc0_voltage:
name: "${name} ${bms_name} cell soc0 voltage"
cell_undervoltage_protection:
id: bms${bms_id}_cell_uvp
name: "${name} ${bms_name} cell undervoltage protection"
cell_undervoltage_protection_recovery:
id: bms${bms_id}_cell_uvpr
name: "${name} ${bms_name} cell undervoltage protection recovery"
cell_power_off_voltage:
name: "${name} ${bms_name} cell power off voltage"
cell_count_settings:
id: bms${bms_id}_cell_count
name: "${name} ${bms_name} cell count settings"
battery_capacity_total_settings:
id: bms${bms_id}_battery_capacity
name: "${name} ${bms_name} battery capacity total setting"
max_charging_current:
id: bms${bms_id}_max_charge_current
name: "${name} ${bms_name} max charging current"
max_discharging_current:
id: bms${bms_id}_max_discharge_current
name: "${name} ${bms_name} max discharging current"
charging_overcurrent_protection_delay:
name: "${name} ${bms_name} charging overcurrent protection delay"
charging_overcurrent_protection_recovery_delay:
name: "${name} ${bms_name} charging overcurrent protection recovery delay"
discharging_overcurrent_protection_delay:
name: "${name} ${bms_name} discharging overcurrent protection delay"
discharging_overcurrent_protection_recovery_delay:
name: "${name} ${bms_name} discharging overcurrent protection recovery delay"
short_circuit_protection_delay:
name: "${name} ${bms_name} short circuit protection delay"
short_circuit_protection_recovery_delay:
name: "${name} ${bms_name} short circuit protection recovery delay"
precharging_time_from_discharge:
name: "${name} ${bms_name} precharging time from discharge"
charging_overtemperature_protection:
name: "${name} ${bms_name} charging overtemperature protection"
charging_overtemperature_protection_recovery:
name: "${name} ${bms_name} charging overtemperature protection recovery"
discharging_overtemperature_protection:
name: "${name} ${bms_name} discharging overtemperature protection"
discharging_overtemperature_protection_recovery:
name: "${name} ${bms_name} discharging overtemperature protection recovery"
charging_lowtemperature_protection:
name: "${name} ${bms_name} charging lowtemperature protection"
charging_lowtemperature_protection_recovery:
name: "${name} ${bms_name} charging lowtemperature protection recovery"
mos_overtemperature_protection:
name: "${name} ${bms_name} mos overtemperature protection"
mos_overtemperature_protection_recovery:
name: "${name} ${bms_name} mos overtemperature protection recovery"
@@ -0,0 +1,353 @@
# Updated : 2025.04.01
# Version : 1.2.5
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
packages:
bms_base: !include bms_base.yaml
bms_temperature_sensor: !include bms_temperature_sensor_5.yaml
bms_errors_bitmask: !include bms_errors_bitmask_JK-PB_RS485.yaml
# +--------------------------------------+
# | Component settings |
# +--------------------------------------+
jk_rs485_bms:
- id: jk_rs485_bms${bms_id}
rs485_address: ${bms_address}
jk_rs485_sniffer_id: ${sniffer_id}
update_interval: ${bms_update_interval}
# +--------------------------------------+
# | Component entities |
# +--------------------------------------+
switch:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
precharging:
name: "${name} ${bms_name} precharging"
charging:
id: bms${bms_id}_charge_switch
name: "${name} ${bms_name} charging"
discharging:
id: bms${bms_id}_discharge_switch
name: "${name} ${bms_name} discharging"
balancing:
name: "${name} ${bms_name} balancing"
emergency:
name: "${name} ${bms_name} emergency"
heating:
name: "${name} ${bms_name} heating"
display_always_on:
name: "${name} ${bms_name} display_always_on"
charging_float_mode:
name: "${name} ${bms_name} charging float mode"
timed_stored_data:
name: "${name} ${bms_name} timed stored data"
disable_temperature_sensors:
name: "${name} ${bms_name} disable temperature sensors"
smart_sleep_on:
name: "${name} ${bms_name} smart sleep on"
disable_pcl_module:
name: "${name} ${bms_name} disable pcl module"
gps_heartbeat:
name: "${name} ${bms_name} gps heartbeat"
port_selection:
name: "${name} ${bms_name} port selection"
special_charger:
name: "${name} ${bms_name} special charger"
binary_sensor:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
status_balancing:
id: bms${bms_id}_equalizing
name: "${name} ${bms_name} status balancing"
status_precharging:
name: "${name} ${bms_name} status precharging"
status_charging:
id: bms${bms_id}_charging_allowed
name: "${name} ${bms_name} status charging"
status_discharging:
id: bms${bms_id}_discharging_allowed
name: "${name} ${bms_name} status discharging"
status_online:
id: bms${bms_id}_online_status
name: "${name} ${bms_name} status online"
status_heating:
name: "${name} ${bms_name} status heating"
sensor:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
balancing_direction:
name: "${name} ${bms_name} balancing direction"
cell_voltage_min:
id: bms${bms_id}_min_cell_voltage
name: "${name} ${bms_name} cell voltage min"
cell_voltage_max:
id: bms${bms_id}_max_cell_voltage
name: "${name} ${bms_name} cell voltage max"
cell_voltage_min_cell_number:
id: bms${bms_id}_min_voltage_cell
name: "${name} ${bms_name} cell voltage min cell number"
cell_voltage_max_cell_number:
id: bms${bms_id}_max_voltage_cell
name: "${name} ${bms_name} cell voltage max cell number"
cell_delta_voltage:
name: "${name} ${bms_name} cell delta voltage"
cell_average_voltage:
id: bms${bms_id}_average_cell_voltage
name: "${name} ${bms_name} cell average voltage"
cell_resistance_min:
name: "${name} ${bms_name} cell resistance min"
cell_resistance_max:
name: "${name} ${bms_name} cell resistance max"
cell_resistance_min_cell_number:
name: "${name} ${bms_name} cell resistance min cell number"
cell_resistance_max_cell_number:
name: "${name} ${bms_name} cell resistance max cell number"
battery_voltage:
id: bms${bms_id}_total_voltage
name: "${name} ${bms_name} battery voltage"
battery_current:
id: bms${bms_id}_current
name: "${name} ${bms_name} battery current"
battery_power:
id: bms${bms_id}_power
name: "${name} ${bms_name} battery power"
battery_power_charging:
id: bms${bms_id}_charging_power
name: "${name} ${bms_name} battery power charging"
battery_power_discharging:
id: bms${bms_id}_discharging_power
name: "${name} ${bms_name} battery power discharging"
temperature_sensor_1:
id: bms${bms_id}_temperature_sensor_1
name: "${name} ${bms_name} temperature sensor 1"
temperature_sensor_2:
id: bms${bms_id}_temperature_sensor_2
name: "${name} ${bms_name} temperature sensor 2"
temperature_sensor_3:
id: bms${bms_id}_temperature_sensor_3
name: "${name} ${bms_name} temperature sensor 3"
temperature_sensor_4:
id: bms${bms_id}_temperature_sensor_4
name: "${name} ${bms_name} temperature sensor 4"
temperature_sensor_5:
id: bms${bms_id}_temperature_sensor_5
name: "${name} ${bms_name} temperature sensor 5"
temperature_powertube:
name: "${name} ${bms_name} temperature powertube"
battery_capacity_state_of_charge:
id: bms${bms_id}_state_of_charge
name: "${name} ${bms_name} battery capacity state of charge"
battery_capacity_remaining:
id: bms${bms_id}_capacity_remaining_ah
name: "${name} ${bms_name} battery capacity remaining"
charging_cycles:
id: bms${bms_id}_charging_cycles
name: "${name} ${bms_name} charging cycles"
battery_capacity_total_charging_cycle:
name: "${name} ${bms_name} battery capacity total charging cycle"
battery_total_runtime:
name: "${name} ${bms_name} battery total runtime"
balancing_current:
name: "${name} ${bms_name} balancing current"
errors_bitmask:
id: bms${bms_id}_errors_bitmask
name: "${name} ${bms_name} errors bitmask"
cell_count_real:
name: "${name} ${bms_name} cell count real"
battery_total_alarms_count:
name: "${name} ${bms_name} battery total alarms count"
battery_total_alarms_active:
name: "${name} ${bms_name} battery total alarms active"
uart1_protocol_number:
name: "${name} ${bms_name} uart1 protocol number"
uart2_protocol_number:
name: "${name} ${bms_name} uart2 protocol number"
battery_soh_valuation:
name: "${name} ${bms_name} battery soh valuation"
cell_voltage_01:
name: "${name} ${bms_name} cell voltage 01"
cell_voltage_02:
name: "${name} ${bms_name} cell voltage 02"
cell_voltage_03:
name: "${name} ${bms_name} cell voltage 03"
cell_voltage_04:
name: "${name} ${bms_name} cell voltage 04"
cell_voltage_05:
name: "${name} ${bms_name} cell voltage 05"
cell_voltage_06:
name: "${name} ${bms_name} cell voltage 06"
cell_voltage_07:
name: "${name} ${bms_name} cell voltage 07"
cell_voltage_08:
name: "${name} ${bms_name} cell voltage 08"
cell_voltage_09:
name: "${name} ${bms_name} cell voltage 09"
cell_voltage_10:
name: "${name} ${bms_name} cell voltage 10"
cell_voltage_11:
name: "${name} ${bms_name} cell voltage 11"
cell_voltage_12:
name: "${name} ${bms_name} cell voltage 12"
cell_voltage_13:
name: "${name} ${bms_name} cell voltage 13"
cell_voltage_14:
name: "${name} ${bms_name} cell voltage 14"
cell_voltage_15:
name: "${name} ${bms_name} cell voltage 15"
cell_voltage_16:
name: "${name} ${bms_name} cell voltage 16"
# cell_voltage_17:
# name: "${name} ${bms_name} cell voltage 17"
# cell_voltage_18:
# name: "${name} ${bms_name} cell voltage 18"
# cell_voltage_19:
# name: "${name} ${bms_name} cell voltage 19"
# cell_voltage_20:
# name: "${name} ${bms_name} cell voltage 20"
# cell_voltage_21:
# name: "${name} ${bms_name} cell voltage 21"
# cell_voltage_22:
# name: "${name} ${bms_name} cell voltage 22"
# cell_voltage_23:
# name: "${name} ${bms_name} cell voltage 23"
# cell_voltage_24:
# name: "${name} ${bms_name} cell voltage 24"
cell_resistance_01:
name: "${name} ${bms_name} cell resistance 01"
cell_resistance_02:
name: "${name} ${bms_name} cell resistance 02"
cell_resistance_03:
name: "${name} ${bms_name} cell resistance 03"
cell_resistance_04:
name: "${name} ${bms_name} cell resistance 04"
cell_resistance_05:
name: "${name} ${bms_name} cell resistance 05"
cell_resistance_06:
name: "${name} ${bms_name} cell resistance 06"
cell_resistance_07:
name: "${name} ${bms_name} cell resistance 07"
cell_resistance_08:
name: "${name} ${bms_name} cell resistance 08"
cell_resistance_09:
name: "${name} ${bms_name} cell resistance 09"
cell_resistance_10:
name: "${name} ${bms_name} cell resistance 10"
cell_resistance_11:
name: "${name} ${bms_name} cell resistance 11"
cell_resistance_12:
name: "${name} ${bms_name} cell resistance 12"
cell_resistance_13:
name: "${name} ${bms_name} cell resistance 13"
cell_resistance_14:
name: "${name} ${bms_name} cell resistance 14"
cell_resistance_15:
name: "${name} ${bms_name} cell resistance 15"
cell_resistance_16:
name: "${name} ${bms_name} cell resistance 16"
# cell_resistance_17:
# name: "${name} ${bms_name} cell resistance 17"
# cell_resistance_18:
# name: "${name} ${bms_name} cell resistance 18"
# cell_resistance_19:
# name: "${name} ${bms_name} cell resistance 19"
# cell_resistance_20:
# name: "${name} ${bms_name} cell resistance 20"
# cell_resistance_21:
# name: "${name} ${bms_name} cell resistance 21"
# cell_resistance_22:
# name: "${name} ${bms_name} cell resistance 22"
# cell_resistance_23:
# name: "${name} ${bms_name} cell resistance 23"
# cell_resistance_24:
# name: "${name} ${bms_name} cell resistance 24"
text_sensor:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
errors:
name: "${name} ${bms_name} errors"
operation_status:
name: "${name} ${bms_name} operation status"
battery_type:
name: "${name} ${bms_name} battery type"
total_runtime_formatted:
name: "${name} ${bms_name} total runtime formatted"
info_vendorid:
name: "${name} ${bms_name} info vendorid"
info_hardware_version:
name: "${name} ${bms_name} info hardware version"
info_software_version:
name: "${name} ${bms_name} info software version"
info_device_name:
name: "${name} ${bms_name} info device name"
info_device_password:
name: "${name} ${bms_name} info device password"
network_nodes_available:
name: "${name} ${bms_name} network nodes available"
info_device_serial_number:
name: "${name} ${bms_name} info device serial number"
info_device_setup_passcode:
name: "${name} ${bms_name} info device setup passcode"
number:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
cell_smart_sleep_voltage:
name: "${name} ${bms_name} cell smart sleep voltage"
battery_capacity_total_settings:
id: bms${bms_id}_battery_capacity
name: "${name} ${bms_name} battery capacity total setting"
cell_count_settings:
id: bms${bms_id}_cell_count
name: "${name} ${bms_name} cell count settings"
max_charging_current:
id: bms${bms_id}_max_charge_current
name: "${name} ${bms_name} max charging current"
max_discharging_current:
id: bms${bms_id}_max_discharge_current
name: "${name} ${bms_name} max discharging current"
cell_overvoltage_protection:
id: bms${bms_id}_cell_ovp
name: "${name} ${bms_name} cell overvoltage protection"
cell_overvoltage_protection_recovery:
id: bms${bms_id}_cell_ovpr
name: "${name} ${bms_name} cell overvoltage protection recovery"
cell_balancing_trigger_voltage:
id: bms${bms_id}_balance_trigger_voltage
name: "${name} ${bms_name} balancing trigger voltage"
cell_balancing_starting_voltage:
name: "${name} ${bms_name} cell balancing starting voltage"
max_balancing_current:
name: "${name} ${bms_name} max balancing current"
cell_soc100_voltage:
name: "${name} ${bms_name} cell soc100 voltage"
cell_soc0_voltage:
name: "${name} ${bms_name} cell soc0 voltage"
cell_undervoltage_protection:
id: bms${bms_id}_cell_uvp
name: "${name} ${bms_name} cell undervoltage protection"
cell_undervoltage_protection_recovery:
id: bms${bms_id}_cell_uvpr
name: "${name} ${bms_name} cell undervoltage protection recovery"
cell_power_off_voltage:
name: "${name} ${bms_name} cell power off voltage"
+3 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.6
# Updated : 2025.03.21
# Version : 1.2.7
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -78,7 +78,7 @@ light:
rgb_order: GRB
pin: 8
num_leds: 1
rmt_channel: 0
# rmt_channel: 0
chipset: ws2812
entity_category: config
default_transition_length: 0ms
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.6
# Updated : 2025.03.21
# Version : 1.2.7
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -25,6 +25,7 @@ packages:
device_base: !include ../base/device_base.yaml
device_base_wifi: !include ../base/device_base_wifi.yaml
device_cpu_freq_240: !include board_options_cpu_freq_240_esp32-s3.yaml
board_rgb_led: !include board_options_rgb_led_status.yaml
# From platform-espressif32 6.1.0
# https://github.com/espressif/esp-idf/releases
@@ -87,9 +88,7 @@ light:
rgb_order: GRB
pin: 35
num_leds: 1
rmt_channel: 0
# rmt_channel: 0
chipset: ws2812
entity_category: config
default_transition_length: 0ms
<<: !include board_options_rgb_led_status.yaml
+3 -4
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.6
# Updated : 2025.03.21
# Version : 1.2.7
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -93,8 +93,7 @@ light:
rgb_order: GRB
pin: 48
num_leds: 1
rmt_channel: 0
# rmt_channel: 0
chipset: ws2812
entity_category: config
default_transition_length: 0ms
# restore_mode: ALWAYS_ON
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.6
# Updated : 2025.03.21
# Version : 1.2.7
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -99,7 +99,7 @@ light:
rgb_order: GRB
pin: 48
num_leds: 1
rmt_channel: 0
# rmt_channel: 0
chipset: ws2812
entity_category: config
default_transition_length: 0ms
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.6
# Updated : 2025.03.21
# Version : 1.2.7
# GitHub : https://github.com/SeByDocKy/pvbrain2
substitutions:
@@ -59,7 +59,7 @@ light:
rgb_order: GRB
pin: 48
num_leds: 1
rmt_channel: 0
# rmt_channel: 0
chipset: ws2812
entity_category: config
default_transition_length: 0ms
+8 -4
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.6
# Updated : 2025.03.21
# Version : 1.2.7
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -32,7 +32,11 @@ packages:
esp32:
board: m5stack-atom
framework:
type: arduino
type: esp-idf
esphome:
platformio_options:
board_build.flash_mode: dio # use Dual IO (dio) instead of Quad IO (qio) to prevent boot loop after flashing
wifi:
id: my_network
@@ -69,7 +73,7 @@ light:
rgb_order: GRB
pin: 27
num_leds: 1
rmt_channel: 0
# rmt_channel: 0
chipset: ws2812
entity_category: config
default_transition_length: 0ms
+7 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.2.6
# Updated : 2025.03.21
# Version : 1.2.7
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -34,6 +34,10 @@ esp32:
framework:
type: esp-idf
esphome:
platformio_options:
board_build.flash_mode: dio # use Dual IO (dio) instead of Quad IO (qio) to prevent boot loop after flashing
wifi:
id: my_network
ssid: !secret wifi_ssid
@@ -69,7 +73,7 @@ light:
rgb_order: GRB
pin: 27
num_leds: 1
rmt_channel: 0
# rmt_channel: 0
chipset: ws2812
entity_category: config
default_transition_length: 0ms
+91
View File
@@ -0,0 +1,91 @@
# Updated : 2025.03.12
# Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
substitutions:
board_chip: "ESP32"
board_name: "EVB"
packages:
device_base: !include ../base/device_base.yaml
device_base_ethernet: !include ../base/device_base_ethernet.yaml
esp32:
board: esp32-evb
framework:
type: esp-idf
esphome:
platformio_options:
board_build.flash_mode: dio # use Dual IO (dio) instead of Quad IO (qio) to prevent boot loop after flashing
ethernet:
id: my_network
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO0_IN
phy_addr: 0
logger:
baud_rate: 0 # frees the 3rd UART and avoids some bugs like "WK2168 with canbus" or "BLE client with RS485 modbus"
uart:
# UART 0 : uart used for ESP32 flashing and logs, can be released if necessary (tx_pin: 1, rx_pin: 3)
# UART 1
- id: uart_esp_1
tx_pin: GPIO4
rx_pin: GPIO36
baud_rate: 115200
rx_buffer_size: 512
# UART 2
- id: uart_esp_2
tx_pin: GPIO16
rx_pin: GPIO13
baud_rate: 115200
rx_buffer_size: 512
canbus:
# CANBUS NODE 1
- platform: esp32_can
id: canbus_node1
tx_pin: 5 # to CAN board CTX
rx_pin: 35 # to CAN board CRX (with 4.7K resistor except for SN65HVD230)
can_id: 1
bit_rate: 500kbps
# +--------------------------------------+
# | Inverter Heartbeat Light |
# +--------------------------------------+
light:
# ESP Light used to see the inverter heartbeat
# Internal : only specifying an id without a name will implicitly set this to true.
- platform: binary
id: esp_light
output: esp_output
output:
# ESP32 board without LED
- platform: template
id: esp_output
type: binary
write_action:
- logger.log: "Inverter Heartbeat Output"
#- lambda: C++ code; # action to be performed at each inverter heartbeat
@@ -0,0 +1,93 @@
# Updated : 2025.03.26
# Version : 1.2.6
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
substitutions:
board_chip: "ESP32"
board_name: "Generic"
packages:
device_base: !include ../base/device_base.yaml
device_base_wifi: !include ../base/device_base_wifi.yaml
device_cpu_freq_240: !include board_options_cpu_freq_240_esp32.yaml
esp32:
board: esp32dev
framework:
type: esp-idf
esphome:
platformio_options:
board_build.flash_mode: dio # use Dual IO (dio) instead of Quad IO (qio) to prevent boot loop after flashing
wifi:
id: my_network
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: !secret domain
logger:
baud_rate: 0 # frees the 3rd UART and avoids some bugs like "WK2168 with canbus" or "BLE client with RS485 modbus"
uart:
# UART 0 : uart used for ESP32 flashing and logs, can be released if necessary (tx_pin: 1, rx_pin: 3)
# UART 1
- id: uart_esp_1
tx_pin: 17
rx_pin: 16
baud_rate: 115200
rx_buffer_size: 512
# UART 2
- id: uart_esp_2
tx_pin: 19
rx_pin: 18
baud_rate: 115200
rx_buffer_size: 512
# UART 3
- id: uart_esp_3
tx_pin: 26
rx_pin: 25
baud_rate: 115200
rx_buffer_size: 512
# canbus:
# # CANBUS NODE 1
# - platform: esp32_can
# id: canbus_node1
# tx_pin: 23 # to CAN board CTX
# rx_pin: 22 # to CAN board CRX (with 4.7K resistor except for SN65HVD230)
# can_id: 1
# bit_rate: 500kbps
# +--------------------------------------+
# | Inverter Heartbeat Light |
# +--------------------------------------+
light:
# ESP Light used to see the inverter heartbeat
# Internal : only specifying an id without a name will implicitly set this to true.
- platform: binary
output: esp_led
id: esp_light
output:
# ESP LED
- platform: gpio
pin: 2
id: esp_led
inverted: true
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.1.2
# Updated : 2025.03.21
# Version : 1.1.3
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -78,7 +78,7 @@ light:
rgb_order: GRB
pin: 4
num_leds: 1
rmt_channel: 0
# rmt_channel: 0
chipset: ws2812
entity_category: config
default_transition_length: 0ms
+7 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2024.12.23
# Version : 1.1.1
# Updated : 2025.01.25
# Version : 1.1.2
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -18,10 +18,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
substitutions:
# YamBMS settings
yambms_id: 'yambms1'
yambms_name: 'YamBMS 1'
# Shunt settings
shunt_update_interval: '3s' # frequency at which Shunt data is refreshed
shunt_combine_interval: '1s' # frequency at which data is combined in YamBMS
# BMS settings
bms_battery_chemistry: '1' # 1-LFP | 2-Li-ion | 3-LTO
bms_update_interval: '3s' # frequency at which BMS data is refreshed, going below '3s' can cause problems
bms_combine_interval: '1s' # frequency at which data is combined in YamBMS
bms_battery_chemistry: '1' # 1-LFP | 2-Li-ion | 3-LTO
bms_cutoff_timer: '60s'
@@ -72,9 +72,9 @@ sensor:
temperature:
name: ${name} ${shunt_name} Temperature
charged_kwh:
name: ${name} ${shunt_name} Charged Power
name: ${name} ${shunt_name} Charged Energy
discharged_kwh:
name: ${name} ${shunt_name} Discharged Power
name: ${name} ${shunt_name} Discharged Energy
battery_capacity_ah:
name: ${name} ${shunt_name} Battery Capacity
soc100_voltage:
+12 -25
View File
@@ -1,5 +1,5 @@
# Updated : 2025.01.16
# Version : 1.5.3
# Updated : 2025.01.28
# Version : 1.5.4
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -108,15 +108,15 @@ globals:
- id: ${yambms_id}_auto_cvl
type: float
restore_value: no
initial_value: '-1.0'
initial_value: '0.0'
- id: ${yambms_id}_auto_ccl
type: float
restore_value: no
initial_value: '-1.0'
initial_value: '0.0'
- id: ${yambms_id}_auto_dcl
type: float
restore_value: no
initial_value: '-1.0'
initial_value: '0.0'
- id: ${yambms_id}_eoc
type: bool
restore_value: no
@@ -406,12 +406,7 @@ sensor:
return 0;
// Bulk
else if (id(${yambms_id}_charging_instruction).state == "Bulk")
{
if(id(${yambms_id}_auto_cvl) == -1.0) // Auto CVL not used
return (id(${yambms_id}_bulk_voltage).state + id(${yambms_id}_inverter_offset_v).state);
else
return (id(${yambms_id}_auto_cvl) + id(${yambms_id}_inverter_offset_v).state);
}
return (id(${yambms_id}_bulk_voltage).state + id(${yambms_id}_inverter_offset_v).state + id(${yambms_id}_auto_cvl));
// Float
else if (id(${yambms_id}_charging_instruction).state == "Float")
return (id(${yambms_id}_float_voltage).state + id(${yambms_id}_inverter_offset_v).state);
@@ -455,12 +450,7 @@ sensor:
lambda: |-
// Charging Allowed
if ((id(${yambms_id}_charging_instruction).state == "Bulk") | (id(${yambms_id}_charging_instruction).state == "Float"))
{
if(id(${yambms_id}_auto_ccl) == -1.0) // Auto CCL not used
return id(${yambms_id}_max_charge_current).state;
else
return id(${yambms_id}_auto_ccl);
}
return (id(${yambms_id}_max_charge_current).state + id(${yambms_id}_auto_ccl));
// Charging Not Allowed
else return 0;
@@ -481,12 +471,7 @@ sensor:
lambda: |-
// Discharging Allowed
if (id(${yambms_id}_discharging_instruction).state == true)
{
if(id(${yambms_id}_auto_dcl) == -1.0) // Auto DCL not used
return id(${yambms_id}_max_discharge_current).state;
else
return id(${yambms_id}_auto_dcl);
}
return (id(${yambms_id}_max_discharge_current).state + id(${yambms_id}_auto_dcl));
// Discharging Not Allowed
else return 0;
@@ -635,13 +620,15 @@ text_sensor:
id(${yambms_id}_charge_status) = "Cut-Off";
// If the EOC Timer switch is enabled
if (id(${yambms_id}_switch_eoc_timer).state) {
if (id(${yambms_id}_switch_eoc_timer).state)
{
// Start EOC timer : the charging process ends at the latest at the end of this timer (30min by default)
if (!id(${yambms_id}_script_eoc_timer).is_running()) id(${yambms_id}_script_eoc_timer).execute();
}
// End Of Charge
// Equalizing
if (id(${yambms_id}_equalizing).state) {
if (id(${yambms_id}_equalizing).state)
{
// Stop cut-off timer
if (id(${yambms_id}_script_cutoff_timer).is_running()) id(${yambms_id}_script_cutoff_timer).stop();
}
+23 -8
View File
@@ -1,5 +1,5 @@
# Updated : 2024.11.15
# Version : 1.2.2
# Updated : 2025.01.28
# Version : 1.2.3
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -42,7 +42,7 @@ sensor:
# +--------------------------------------+
# | Auto Charge Current Limit |
# +--------------------------------------+
# First, an initial charge current is calculated based upon the maximum cell voltage but only if the Auto Charge Current switch is enabled.
# First, an initial charge current delta is calculated based upon the maximum cell voltage but only if the Auto Charge Current switch is enabled.
- platform: copy
source_id: ${yambms_id}_max_cell_voltage
name: ${name} ${yambms_name} Initial Charge Current
@@ -53,12 +53,24 @@ sensor:
filters:
- lambda: !lambda |-
// Variables
double max_charge_a = id(${yambms_id}_max_charge_current).state;
double cell_bulk_v = (id(${yambms_id}_bulk_voltage).state / id(${yambms_id}_cell_count).state);
double cell_float_v = (id(${yambms_id}_float_voltage).state / id(${yambms_id}_cell_count).state);
double cell_high_v = ((id(${yambms_id}_cell_ovp).state + cell_bulk_v) / 2);
// Auto Charge Current function
if (id(${yambms_id}_max_cell_voltage).state > cell_high_v) return 0.0;
else return max(0.0,(- pow(${charge_a_factor_curve_end}, pow( max(0.0, ((x - cell_float_v) / (cell_high_v - cell_float_v))),${charge_a_factor_curve_shape}))+2) * id(${yambms_id}_max_charge_current).state);
if (!id(${yambms_id}_switch_auto_ccl).state) {
// No change to charge current required
return 0.0;
} else if (id(${yambms_id}_max_cell_voltage).state > cell_high_v) {
// Set CCL delta to maximum as max cell voltage too high
return -max_charge_a;
} else {
// Set CCL delta to automatic value
return max(0.0,(- pow(${charge_a_factor_curve_end}, pow( max(0.0, ((x - cell_float_v) / (cell_high_v - cell_float_v))),${charge_a_factor_curve_shape}))+2) * max_charge_a)
- max_charge_a;
}
# Second, an exponential moving average is calculated. This will be used to smooth the transition between different initial charge current values.
- platform: copy
source_id: auto_ccl_initial
@@ -72,6 +84,7 @@ sensor:
alpha: 0.15
send_every: 1
send_first_at: 1
# Third, if the instantaneous initial charge current value is lower than the moving average, use that, otherwise use the moving average.
# This means that cell voltage spikes will be reacted to quickly, but reduced cell voltages will not, preventing oscillation of requested current.
- platform: copy
@@ -84,6 +97,8 @@ sensor:
internal: true
filters:
- lambda: !lambda |-
if (id(${yambms_id}_switch_auto_ccl).state) id(${yambms_id}_auto_ccl) = (round(min(id(auto_ccl_moving_average).state, x) * 10) / 10);
else id(${yambms_id}_auto_ccl) = -1.0; // Auto CCL not used
return (round(min(id(auto_ccl_moving_average).state, x) * 10) / 10);
// Variables
double auto_ccl = round(min(id(auto_ccl_moving_average).state, x) * 10) / 10;
id(${yambms_id}_auto_ccl) = auto_ccl;
return auto_ccl;
+7 -6
View File
@@ -1,5 +1,5 @@
# Updated : 2024.08.08
# Version : 2.4.1
# Updated : 2025.01.25
# Version : 2.4.2
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -74,6 +74,7 @@ sensor:
double max_CVL = id(${yambms_id}_bulk_voltage).state + id(${yambms_id}_auto_cvl_boost_charge_v).state; // Maximum CVL
double min_CVL = id(${yambms_id}_float_voltage).state; // Minimum CVL
double CVL = id(${yambms_id}_bulk_voltage).state; // Starting CVL
double CVL_orig = id(${yambms_id}_bulk_voltage).state; // Starting CVL snapshot
double kp = ${charge_v_kp}; // Proportional gain, adjust as needed
double ki = ${charge_v_ki}; // Integral gain, adjust as needed
@@ -83,7 +84,7 @@ sensor:
// Check feature enabled
if (!id(${yambms_id}_switch_auto_cvl).state){
id(${yambms_id}_auto_cvl) = -1.0;
id(${yambms_id}_auto_cvl) = 0.0;
return id(${yambms_id}_bulk_voltage).state;
} else {
// PI Algorithm
@@ -94,7 +95,7 @@ sensor:
integral = 0;
}
// Check if max cell voltage is in deadband
if ((max_cell_v <= max_allowed_voltage) & (max_cell_v >= cell_bulk_v)) {
if ((max_cell_v <= max_allowed_voltage) && (max_cell_v >= cell_bulk_v)) {
// No integral error within deadband zone
} else {
integral = prev_integral + error * dt;
@@ -114,8 +115,8 @@ sensor:
else {
prev_integral = integral;
}
id(${yambms_id}_auto_cvl) = CVL;
return CVL;
id(${yambms_id}_auto_cvl) = CVL - CVL_orig;
return CVL - CVL_orig;
}
filters:
- round: 1
+22 -7
View File
@@ -1,5 +1,5 @@
# Updated : 2024.11.15
# Version : 1.2.2
# Updated : 2025.01.25
# Version : 1.2.3
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -55,10 +55,22 @@ sensor:
filters:
- lambda: !lambda |-
// Variables
double max_discharge_a = id(${yambms_id}_max_discharge_current).state;
double cell_low_v = id(${yambms_id}_cell_uvp).state + 0.2;
// Auto Discharge Current function
if (id(${yambms_id}_min_cell_voltage).state < cell_low_v) return 0.0;
else return max(0.0,(- pow(${discharge_a_factor_curve_end}, pow( max(0.0, ((x - ${discharge_knee_v}) / (cell_low_v - ${discharge_knee_v}))),${discharge_a_factor_curve_shape}))+2) * id(${yambms_id}_max_discharge_current).state);
if (!id(${yambms_id}_switch_auto_dcl).state) {
// No change to discharge current required
return 0.0;
} else if (id(${yambms_id}_min_cell_voltage).state < cell_low_v) {
// Set DCL delta to maximum as min cell voltage too low
return -max_discharge_a;
} else {
// Set DCL delta to automatic value
return max(0.0,(- pow(${discharge_a_factor_curve_end}, pow( max(0.0, ((x - ${discharge_knee_v}) / (cell_low_v - ${discharge_knee_v}))),${discharge_a_factor_curve_shape}))+2) * max_discharge_a)
- max_discharge_a;
}
# Second, an exponential moving average is calculated. This will be used to smooth the transition between different initial discharge current values.
- platform: copy
source_id: auto_dcl_initial
@@ -72,6 +84,7 @@ sensor:
alpha: 0.15
send_every: 1
send_first_at: 1
# Third, if the instantaneous initial discharge current value is lower than the moving average, use that, otherwise use the moving average.
# This means that cell voltage drops will be reacted to quickly, but increased cell voltages will not, preventing oscillation of requested current.
- platform: copy
@@ -84,6 +97,8 @@ sensor:
internal: true
filters:
- lambda: !lambda |-
if (id(${yambms_id}_switch_auto_dcl).state) id(${yambms_id}_auto_dcl) = (round(min(id(auto_dcl_moving_average).state, x) * 10) / 10);
else id(${yambms_id}_auto_dcl) = -1.0; // Auto DCL not used
return (round(min(id(auto_dcl_moving_average).state, x) * 10) / 10);
// Variables
double auto_dcl = round(min(id(auto_dcl_moving_average).state, x) * 10) / 10;
id(${yambms_id}_auto_dcl) = auto_dcl;
return auto_dcl;
+3 -3
View File
@@ -536,7 +536,7 @@ sensor:
update_interval: ${yambms_update_interval}
accuracy_decimals: 0
unit_of_measurement: Ah
device_class: energy_storage
icon: mdi:car-battery
filters:
- or:
- throttle: 10s
@@ -550,7 +550,7 @@ sensor:
update_interval: ${yambms_update_interval}
accuracy_decimals: 0
unit_of_measurement: Ah
device_class: energy_storage
icon: mdi:car-battery
filters:
- or:
- throttle: 10s
@@ -563,7 +563,7 @@ sensor:
update_interval: ${yambms_update_interval}
accuracy_decimals: 0
unit_of_measurement: Ah
device_class: energy_storage
icon: mdi:car-battery
filters:
- or:
- throttle: 10s
+33
View File
@@ -0,0 +1,33 @@
# Updated : 2025.03.12
# Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
# This YAML is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
switch:
- platform: template
name: "${name} ${yambms_name} Force Float"
id: ${yambms_id}_switch_force_float
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
entity_category: config
interval:
- interval: ${yambms_update_interval}
then:
- lambda: |-
// Force Float => Float
if (id(${yambms_id}_switch_force_float).state) id(${yambms_id}_charge_status) = "Float";