From dbb3a98a2d79a7fba8c5ccc5684ed64639362d8c Mon Sep 17 00:00:00 2001 From: Sleeper85 <153944466+Sleeper85@users.noreply.github.com> Date: Sat, 16 Nov 2024 19:43:10 +0100 Subject: [PATCH] YamBMS 1.5.1 --- .../YamBMS_HA_Dashboard_DEMO.yaml | 1367 +++++++++++++++++ ...S_HA_Dashboard_JK-ALL_UART_BLE_3xBMS.yaml} | 566 ++++--- ...amBMS_HA_Dashboard_JK-PB_RS485_3xBMS.yaml} | 46 +- ...YamBMS_HA_Dashboard_JK-PB_RS485_7xBMS.yaml | 66 +- .../YamBMS_HA_Dashboard_without_BMS.yaml | 322 ++++ multi-bms_DEMO.yaml | 246 +++ multi-bms_DEMO_AtomS3.yaml | 242 +++ multi-bms_JBD_UART.yaml | 188 +++ multi-bms_JK-ALL_BLE.yaml | 31 +- multi-bms_JK-B_UART.yaml | 23 +- multi-bms_JK-B_UART_pvbrain2.yaml | 18 +- multi-bms_JK-PB_RS485_mode2.yaml | 23 +- multi-bms_JK-PB_RS485_mode2_AtomS3.yaml | 189 +++ multi-bms_JK-PB_RS485_mode2_ETH01-EVO.yaml | 19 +- multi-bms_JK-PB_RS485_mode2_pvbrain2.yaml | 18 +- multi-bms_SEPLOS_V1_V2_RS485.yaml | 201 +++ one-bms_JK-ALL_BLE.yaml | 33 +- one-bms_JK-B_UART.yaml | 23 +- one-bms_JK-PB_RS485_mode2.yaml | 23 +- packages/base/device_base.yaml | 6 +- packages/base/device_base_ethernet.yaml | 6 +- packages/bms/bms_FAKE.yaml | 344 +++++ packages/bms/bms_JBD_UART_full.yaml | 311 ++++ packages/bms/bms_JK-ALL_BLE_V14_full.yaml | 46 +- packages/bms/bms_JK-ALL_BLE_full.yaml | 45 +- packages/bms/bms_JK-ALL_BLE_minimal.yaml | 45 +- packages/bms/bms_JK-ALL_BLE_standard.yaml | 62 +- packages/bms/bms_JK-B_RS485_DISPLAY_full.yaml | 351 +++++ packages/bms/bms_JK-B_UART_full.yaml | 45 +- packages/bms/bms_JK-B_UART_minimal.yaml | 34 +- packages/bms/bms_JK-PB_RS485_bms_full.yaml | 36 +- packages/bms/bms_JK-PB_RS485_bms_minimal.yaml | 31 +- packages/bms/bms_JK-PB_RS485_sniffer.yaml | 18 +- .../bms/bms_JK-PB_RS485_sniffer_talk_pin.yaml | 18 +- .../bms/bms_SEPLOS_V1_V2_RS485_bms_full.yaml | 254 +++ .../bms/bms_SEPLOS_V1_V2_RS485_modbus.yaml | 39 + packages/bms/bms_combine.yaml | 130 +- packages/bms/bms_temperature_sensor_2.yaml | 93 ++ packages/bms/bms_temperature_sensor_4.yaml | 113 ++ packages/bms/bms_temperature_sensor_5.yaml | 123 ++ packages/bms/bms_temperature_sensor_6.yaml | 133 ++ packages/board/board_atom-lite.yaml | 8 +- packages/board/board_atom-matrix.yaml | 8 +- packages/board/board_atom-s3-lite.yaml | 8 +- packages/board/board_atom-s3.yaml | 283 ++++ packages/board/board_atom-s3r.yaml | 183 +++ ...isplay.yaml => board_display_128x128.yaml} | 171 +-- packages/board/board_esp32-c3-devkitm-1.yaml | 9 +- packages/board/board_esp32-c3-eth01-evo.yaml | 40 +- packages/board/board_esp32-devkit-v1.yaml | 25 +- packages/board/board_esp32-s3-devkitc-1.yaml | 8 +- .../board_esp32-s3-devkitc-1_mcp2515.yaml | 8 +- packages/shunt/shunt_combine.yaml | 33 +- .../{shunt_example.yaml => shunt_fake.yaml} | 20 +- ...k_khf.yaml => shunt_junctek_khf_UART.yaml} | 13 +- .../shunt/shunt_victron_smartshunt_BLE.yaml | 106 ++ .../shunt_victron_smartshunt_BLE_connect.yaml | 76 + ...aml => shunt_victron_smartshunt_UART.yaml} | 10 + ...unt_victron_smartshunt_UART_pvbrain2.yaml} | 11 + packages/yambms/yambms.yaml | 206 ++- packages/yambms/yambms_auto_ccl.yaml | 10 +- packages/yambms/yambms_auto_dcl.yaml | 12 +- packages/yambms/yambms_canbus.yaml | 10 +- packages/yambms/yambms_combine.yaml | 408 ++--- 64 files changed, 6382 insertions(+), 1211 deletions(-) create mode 100644 HomeAssistant_Dashboards/YamBMS_HA_Dashboard_DEMO.yaml rename HomeAssistant_Dashboards/{YamBMS_HA_Dashboard_JK-ALL_UART_BLE.yaml => YamBMS_HA_Dashboard_JK-ALL_UART_BLE_3xBMS.yaml} (80%) rename HomeAssistant_Dashboards/{YamBMS_HA_Dashboard_JK-PB_RS485.yaml => YamBMS_HA_Dashboard_JK-PB_RS485_3xBMS.yaml} (98%) create mode 100644 HomeAssistant_Dashboards/YamBMS_HA_Dashboard_without_BMS.yaml create mode 100644 multi-bms_DEMO.yaml create mode 100644 multi-bms_DEMO_AtomS3.yaml create mode 100644 multi-bms_JBD_UART.yaml create mode 100644 multi-bms_JK-PB_RS485_mode2_AtomS3.yaml create mode 100644 multi-bms_SEPLOS_V1_V2_RS485.yaml create mode 100644 packages/bms/bms_FAKE.yaml create mode 100644 packages/bms/bms_JBD_UART_full.yaml create mode 100644 packages/bms/bms_JK-B_RS485_DISPLAY_full.yaml create mode 100644 packages/bms/bms_SEPLOS_V1_V2_RS485_bms_full.yaml create mode 100644 packages/bms/bms_SEPLOS_V1_V2_RS485_modbus.yaml create mode 100644 packages/bms/bms_temperature_sensor_2.yaml create mode 100644 packages/bms/bms_temperature_sensor_4.yaml create mode 100644 packages/bms/bms_temperature_sensor_5.yaml create mode 100644 packages/bms/bms_temperature_sensor_6.yaml create mode 100644 packages/board/board_atom-s3.yaml create mode 100644 packages/board/board_atom-s3r.yaml rename packages/board/{board_atom-s3-display.yaml => board_display_128x128.yaml} (61%) rename packages/shunt/{shunt_example.yaml => shunt_fake.yaml} (89%) rename packages/shunt/{shunt_junctek_khf.yaml => shunt_junctek_khf_UART.yaml} (90%) create mode 100644 packages/shunt/shunt_victron_smartshunt_BLE.yaml create mode 100644 packages/shunt/shunt_victron_smartshunt_BLE_connect.yaml rename packages/shunt/{shunt_victron_smartshunt.yaml => shunt_victron_smartshunt_UART.yaml} (93%) rename packages/shunt/{shunt_victron_smartshunt_pvbrain2.yaml => shunt_victron_smartshunt_UART_pvbrain2.yaml} (93%) diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_DEMO.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_DEMO.yaml new file mode 100644 index 0000000..8da9d3f --- /dev/null +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_DEMO.yaml @@ -0,0 +1,1367 @@ +# Updated : 2024.11.11 +# Version : 1.5.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 . + +views: + - title: YamBMS + type: sections + max_columns: 3 + sections: + - type: grid + cards: + - graph: line + type: sensor + entity: sensor.yambms_demo_yambms_1_total_voltage_o + detail: 2 + layout_options: + grid_columns: 2 + grid_rows: 2 + name: Voltage + hours_to_show: 8 + - graph: line + type: sensor + entity: sensor.yambms_demo_yambms_1_battery_soc + detail: 2 + name: SoC + hours_to_show: 8 + - type: gauge + entity: sensor.yambms_demo_yambms_1_current_s + needle: true + severity: + green: 0 + yellow: -250 + red: -500 + max: 500 + min: -500 + name: Current + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: gauge + entity: sensor.yambms_demo_yambms_1_power_s + needle: true + severity: + green: 0 + yellow: -2500 + red: -5000 + max: 5000 + min: -5000 + name: Power + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: tile + entity: sensor.yambms_demo_yambms_1_installed_battery_capacity_s + name: Installed Battery Capacity + - type: tile + entity: sensor.yambms_demo_yambms_1_battery_soh + name: Battery SoH + - type: tile + entity: sensor.yambms_demo_yambms_1_battery_capacity_s + name: Battery Capacity + - type: tile + entity: sensor.yambms_demo_yambms_1_capacity_remaining_s + name: Capacity Remaining + - type: tile + entity: sensor.yambms_demo_yambms_1_delta_cell_voltage + name: Delta Cell Voltage + - type: tile + entity: binary_sensor.yambms_demo_yambms_1_bms_equalizing_state + name: Equalizing state + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_max_cell_voltage + name: Max Cell V. + - entity: sensor.yambms_demo_yambms_1_max_voltage_cell + name: Cell number + layout_options: + grid_columns: 2 + grid_rows: 2 + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_min_cell_voltage + name: Min Cell V. + - entity: sensor.yambms_demo_yambms_1_min_voltage_cell + name: Cell number + layout_options: + grid_columns: 2 + grid_rows: 2 + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_max_temperature + name: Max temp. + - entity: sensor.yambms_demo_yambms_1_max_temperature_sensor + name: Sensor number + layout_options: + grid_columns: 2 + grid_rows: 2 + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_min_temperature + name: Min temp. + - entity: sensor.yambms_demo_yambms_1_min_temperature_sensor + name: Sensor number + layout_options: + grid_columns: 2 + grid_rows: 2 + title: YamBMS - Battery + column_span: 1 + - type: grid + cards: + - type: tile + entity: binary_sensor.yambms_demo_canbus_1_status + name: CANBUS Status + - type: tile + entity: binary_sensor.yambms_demo_esp32_online_status + name: ESP32 Status + - type: tile + entity: sensor.yambms_demo_yambms_1_charging_status + name: Charging Status + - type: tile + entity: sensor.yambms_demo_yambms_1_last_complete_charge + name: Last Complete Charge + - type: tile + entity: sensor.yambms_demo_yambms_1_charging_instruction + name: Charging Instruction + - type: tile + entity: binary_sensor.yambms_demo_yambms_1_discharging_instruction + name: Discharging Instruction + - type: tile + entity: sensor.yambms_demo_yambms_1_alarm + name: Alarm + - type: tile + entity: sensor.yambms_demo_yambms_1_warning + name: Warning + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_bms_count + name: BMS count + - entity: sensor.yambms_demo_yambms_1_bms_combined + name: BMS combined + - entity: sensor.yambms_demo_yambms_1_bms_blocking_charge + name: BMS blocking charge + - entity: sensor.yambms_demo_yambms_1_bms_blocking_discharge + name: BMS blocking discharge + - entity: sensor.yambms_demo_yambms_1_bms_in_alarm + name: BMS in alarm + layout_options: + grid_columns: 2 + grid_rows: 4 + - type: tile + entity: sensor.yambms_demo_esp32_uptime + name: ESP32 Uptime + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_shunt_count + name: Shunt count + - entity: sensor.yambms_demo_yambms_1_shunt_combined + name: Shunt combined + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_requested_charge_voltage + name: Requested Charge Voltage + - entity: sensor.yambms_demo_yambms_1_requested_charge_current + name: Requested Charge Current + - entity: sensor.yambms_demo_yambms_1_requested_discharge_voltage + name: Requested Discharge Voltage + - entity: sensor.yambms_demo_yambms_1_requested_discharge_current + name: Requested Discharge Current + - entity: binary_sensor.yambms_demo_yambms_1_requested_force_charge + name: Requested Force Charge + - type: tile + entity: sensor.yambms_demo_yambms_1_running_version + name: Running version + - type: tile + entity: sensor.yambms_demo_yambms_1_last_version + name: Last version + title: YamBMS - Status + column_span: 1 + - title: Control + cards: + - type: entities + entities: + - entity: select.yambms_demo_canbus_1_bms_name + name: CANBUS 1 BMS Name + - entity: select.yambms_demo_canbus_1_protocol + name: CANBUS 1 Protocol + title: YamBMS - CANBUS Protocol + - type: entities + entities: + - entity: switch.yambms_demo_yambms_1_charge_enabled + name: YamBMS 1 Charge enabled + - entity: switch.yambms_demo_yambms_1_discharge_enabled + name: YamBMS 1 Discharge enabled + - entity: binary_sensor.yambms_demo_yambms_1_bms_charging_allowed + name: YamBMS 1 BMS Charging allowed + - entity: binary_sensor.yambms_demo_yambms_1_bms_discharging_allowed + name: YamBMS 1 BMS Discharging allowed + title: YamBMS - Charge / Discharge switch + - type: entities + entities: + - entity: switch.yambms_demo_yambms_1_automatic_charge_voltage + name: Automatic Charge Voltage + - entity: number.yambms_demo_yambms_1_auto_cvl_boost_charge_v + name: Auto CVL Boost Charge V. + title: YamBMS - Auto CVL + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_charging_status + name: Charging Status + - entity: sensor.yambms_demo_yambms_1_charging_instruction + name: Charging Instruction + - entity: switch.yambms_demo_yambms_1_float_charge_enabled + name: Float charge enabled + - entity: switch.yambms_demo_yambms_1_eoc_timer_enabled + name: EOC timer enabled + - entity: number.yambms_demo_yambms_1_bulk_voltage + name: Bulk voltage + - entity: number.yambms_demo_yambms_1_float_voltage + name: Float voltage + - entity: number.yambms_demo_yambms_1_inverter_offset_v + name: Inverter Offset V. + title: YamBMS - Charging Settings + - type: entities + entities: + - entity: switch.yambms_demo_yambms_1_automatic_charge_current + name: Automatic Charge Current + - entity: switch.yambms_demo_yambms_1_automatic_discharge_current + name: Automatic Discharge Current + title: YamBMS - Auto CCL / DCL + - type: entities + entities: + - entity: number.yambms_demo_yambms_1_rebulk_soc + name: Rebulk SoC + - entity: number.yambms_demo_yambms_1_rebulk_v + name: Rebulk V. + - entity: switch.yambms_demo_yambms_1_force_bulk_top_bal + name: Force Bulk (top bal) + title: YamBMS - ReBulk + - type: entities + entities: + - entity: number.yambms_demo_yambms_1_max_charge_current + name: Max charge current (%) + - entity: number.yambms_demo_yambms_1_max_discharge_current + name: Max discharge current (%) + title: YamBMS - Max current (%) + - type: entities + entities: + - entity: switch.yambms_demo_yambms_1_request_force_charge + name: Request force charge + - entity: number.yambms_demo_yambms_1_request_force_charge_start_soc + name: Force charge Start SoC + - entity: number.yambms_demo_yambms_1_request_force_charge_stop_soc + name: Force charge Stop SoC + - entity: binary_sensor.yambms_demo_yambms_1_requested_force_charge + name: Requested Force Charge + title: YamBMS - Request force charge + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_requested_charge_voltage + name: Requested Charge Voltage + - entity: sensor.yambms_demo_yambms_1_requested_discharge_voltage + name: Requested Discharge Voltage + - entity: sensor.yambms_demo_yambms_1_requested_charge_current + name: Requested Charge Current + - entity: sensor.yambms_demo_yambms_1_requested_discharge_current + name: Requested Discharge Current + title: YamBMS - Requested Values + - type: entities + entities: + - entity: sensor.yambms_demo_yambms_1_last_complete_charge + name: Last Complete Charge + - entity: binary_sensor.yambms_demo_esp32_online_status + name: ESP32 Online Status + - entity: sensor.yambms_demo_esp32_uptime + name: ESP32 Uptime + - entity: sensor.yambms_demo_esp32_esphome_version + name: ESP32 ESPHome version + - entity: button.yambms_demo_esp32_restart + name: ESP32 Restart + title: YamBMS - Diagnostic + - type: entities + entities: + - entity: binary_sensor.yambms_demo_canbus_1_status + name: CANBUS 1 Status + - entity: switch.yambms_demo_canbus_1_inverter_heartbeat_monitoring + name: CANBUS 1 Inverter Heartbeat Monitoring + - entity: sensor.yambms_demo_canbus_1_inverter_heartbeat + name: CANBUS 1 Inverter Heartbeat + title: YamBMS - Inverter Heartbeat + - type: entities + entities: + - entity: sensor.yambms_demo_debug_heap_free + name: Debug Heap free (%) + - entity: sensor.yambms_demo_debug_heap_free_2 + name: Debug Heap free + - entity: sensor.yambms_demo_debug_heap_max_block + name: Debug Heap max block (%) + - entity: sensor.yambms_demo_debug_heap_max_block_2 + name: Debug Heap max block + - entity: sensor.yambms_demo_debug_loop_time + name: Debug Loop time + - entity: sensor.yambms_demo_debug_reset_reason + name: Debug Reset reason + title: YamBMS - DEBUG + - title: BMS + type: sections + max_columns: 3 + sections: + - type: grid + title: BMS 1 + column_span: 1 + cards: + - type: grid + square: false + columns: 1 + cards: + - type: markdown + content: >- +
Time : {{ + states('sensor.yambms_demo_bms_1_total_runtime_formatted') | + upper }} + layout_options: + grid_columns: 2 + grid_rows: 1 + - type: grid + square: false + columns: 1 + cards: + - type: markdown + content: >- +
Error : {{ + states('sensor.yambms_demo_bms_1_errors')}} + layout_options: + grid_columns: 2 + grid_rows: 1 + - type: grid + square: false + columns: 3 + cards: + - type: markdown + content: >- +
Charge : {% if + states('switch.yambms_demo_bms_1_charge_switch') == 'on' %} + {{ + states('switch.yambms_demo_bms_1_charge_switch') | upper + }} {% else %} {{ + states('switch.yambms_demo_bms_1_charge_switch') | upper + }} {% endif %} + - type: markdown + content: >- +
Discharge : {% if + states('switch.yambms_demo_bms_1_discharge_switch') == 'on' + %} {{ + states('switch.yambms_demo_bms_1_discharge_switch') | upper + }} {% else %} {{ + states('switch.yambms_demo_bms_1_discharge_switch') | upper + }} {% endif %} + - type: markdown + content: >- +
Balance : {% if + states('switch.yambms_demo_bms_1_balance_switch') == 'on' %} + {{ + states('switch.yambms_demo_bms_1_balance_switch') | upper + }} {% else %} {{ + states('switch.yambms_demo_bms_1_balance_switch') | upper + }} {% endif %} + - type: grid + square: false + columns: 2 + cards: + - type: markdown + content: >- +
{{ + states('sensor.yambms_demo_bms_1_total_voltage') }} + V
Battery Power :  {{ states('sensor.yambms_demo_bms_1_power') }} + W
Battery Capacity :  {{ + states('sensor.yambms_demo_bms_1_battery_capacity') + }} Ah
Cycle Capacity :  {{ + states('sensor.yambms_demo_bms_1_charging_cycles') + }} Ah
Ave. Cell Vol. :  {{ + states('sensor.yambms_demo_bms_1_average_cell_voltage') }} + V
Balance Cur. :  {{ + states('sensor.yambms_demo_bms_1_balancing_current') }} + A
Battery T1 :  {{ + states('sensor.yambms_demo_bms_1_temperature_sensor_1') }} + °C + - type: markdown + content: >- +
{{ + states('sensor.yambms_demo_bms_1_current') }} A
+ Remain Battery :  {{ + states('sensor.yambms_demo_bms_1_soc') }} + %
Remain Capacity :  {{ + states('sensor.yambms_demo_bms_1_capacity_remaining') }} + Ah
Cycle Count :  {{ + states('sensor.yambms_demo_bms_1_charging_cycles') + }}
Delta Cell Vol. :  {{ + states('sensor.yambms_demo_bms_1_delta_cell_voltage') }} + V
MOS Temp. :  {{ + states('sensor.yambms_demo_bms_1_power_tube_temperature') }} + °C
Battery T2 :  {{ + states('sensor.yambms_demo_bms_1_temperature_sensor_2') }} + °C + - type: grid + square: false + columns: 1 + cards: + - type: markdown + content:
Cells Voltage / Wire Resistance + - type: grid + square: false + columns: 2 + cards: + - type: markdown + content: >- +
01.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '1' %} + {{ + states('sensor.yambms_demo_bms_1_cell_voltage_01') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '1' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_01') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_01') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_01') }} Ω +
02.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '2' %} + {{ + states('sensor.yambms_demo_bms_1_cell_voltage_02') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '2' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_02') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_02') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_02') }} Ω +
03.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '3' %} + {{ + states('sensor.yambms_demo_bms_1_cell_voltage_03') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '3' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_03') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_03') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_03') }} Ω +
04.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '4' %} + {{ + states('sensor.yambms_demo_bms_1_cell_voltage_04') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '4' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_04') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_04') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_04') }} Ω +
05.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '5' %} + {{ + states('sensor.yambms_demo_bms_1_cell_voltage_05') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '5' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_05') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_05') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_05') }} Ω +
06.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '6' %} + {{ + states('sensor.yambms_demo_bms_1_cell_voltage_06') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '6' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_06') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_06') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_06') }} Ω +
07.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '7' %} + {{ + states('sensor.yambms_demo_bms_1_cell_voltage_07') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '7' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_07') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_07') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_07') }} Ω +
08.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '8' %} + {{ + states('sensor.yambms_demo_bms_1_cell_voltage_08') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '8' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_08') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_08') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_08') }} Ω +
+ - type: markdown + content: >- +
09.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '9' %} + {{ + states('sensor.yambms_demo_bms_1_cell_voltage_09') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '9' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_09') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_09') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_09') }} Ω +
10.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '10' + %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_10') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '10' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_10') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_10') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_10') }} Ω +
11.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '11' + %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_11') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '11' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_11') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_11') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_11') }} Ω +
12.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '12' + %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_12') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '12' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_12') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_12') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_12') }} Ω +
13.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '13' + %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_13') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '13' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_13') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_13') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_13') }} Ω +
14.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '14' + %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_14') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '14' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_14') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_14') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_14') }} Ω +
15.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '15' + %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_15') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '15' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_15') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_15') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_15') }} Ω +
16.    {% if + states('sensor.yambms_demo_bms_1_max_voltage_cell') == '16' + %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_16') }} V + {% elif states('sensor.yambms_demo_bms_1_min_voltage_cell') == + '16' %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_16') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_1_cell_voltage_16') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_1_cell_resistance_16') }} Ω +
+ - type: entity-filter + entities: + - entity: switch.yambms_demo_bms_1_combine_enabled + name: Combine + - entity: binary_sensor.yambms_demo_bms_1_combine_availability + name: Cb. Availability + - entity: binary_sensor.yambms_demo_bms_1_can_be_combined + name: Can be combined + conditions: + - condition: state + state_not: unavailable + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: entity-filter + entities: + - entity: switch.yambms_demo_bms_1_charge_switch + name: Charge + - entity: switch.yambms_demo_bms_1_discharge_switch + name: Discharge + - entity: switch.yambms_demo_bms_1_balance_switch + name: Balance + conditions: + - condition: state + state_not: unavailable + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: grid + title: BMS 2 + column_span: 1 + cards: + - type: grid + square: false + columns: 1 + cards: + - type: markdown + content: >- +
Time : {{ + states('sensor.yambms_demo_bms_2_total_runtime_formatted') | + upper }} + layout_options: + grid_columns: 2 + grid_rows: 1 + - type: grid + square: false + columns: 1 + cards: + - type: markdown + content: >- +
Error : {{ + states('sensor.yambms_demo_bms_2_errors')}} + layout_options: + grid_columns: 2 + grid_rows: 1 + - type: grid + square: false + columns: 3 + cards: + - type: markdown + content: >- +
Charge : {% if + states('switch.yambms_demo_bms_2_charge_switch') == 'on' %} + {{ + states('switch.yambms_demo_bms_2_charge_switch') | upper + }} {% else %} {{ + states('switch.yambms_demo_bms_2_charge_switch') | upper + }} {% endif %} + - type: markdown + content: >- +
Discharge : {% if + states('switch.yambms_demo_bms_2_discharge_switch') == 'on' + %} {{ + states('switch.yambms_demo_bms_2_discharge_switch') | upper + }} {% else %} {{ + states('switch.yambms_demo_bms_2_discharge_switch') | upper + }} {% endif %} + - type: markdown + content: >- +
Balance : {% if + states('switch.yambms_demo_bms_2_balance_switch') == 'on' %} + {{ + states('switch.yambms_demo_bms_2_balance_switch') | upper + }} {% else %} {{ + states('switch.yambms_demo_bms_2_balance_switch') | upper + }} {% endif %} + - type: grid + square: false + columns: 2 + cards: + - type: markdown + content: >- +
{{ + states('sensor.yambms_demo_bms_2_total_voltage') }} + V
Battery Power :  {{ states('sensor.yambms_demo_bms_2_power') }} + W
Battery Capacity :  {{ + states('sensor.yambms_demo_bms_2_battery_capacity') + }} Ah
Cycle Capacity :  {{ + states('sensor.yambms_demo_bms_2_charging_cycles') + }} Ah
Ave. Cell Vol. :  {{ + states('sensor.yambms_demo_bms_2_average_cell_voltage') }} + V
Balance Cur. :  {{ + states('sensor.yambms_demo_bms_2_balancing_current') }} + A
Battery T1 :  {{ + states('sensor.yambms_demo_bms_2_temperature_sensor_1') }} + °C + - type: markdown + content: >- +
{{ + states('sensor.yambms_demo_bms_2_current') }} A
+ Remain Battery :  {{ + states('sensor.yambms_demo_bms_2_soc') }} + %
Remain Capacity :  {{ + states('sensor.yambms_demo_bms_2_capacity_remaining') }} + Ah
Cycle Count :  {{ + states('sensor.yambms_demo_bms_2_charging_cycles') + }}
Delta Cell Vol. :  {{ + states('sensor.yambms_demo_bms_2_delta_cell_voltage') }} + V
MOS Temp. :  {{ + states('sensor.yambms_demo_bms_2_power_tube_temperature') }} + °C
Battery T2 :  {{ + states('sensor.yambms_demo_bms_2_temperature_sensor_2') }} + °C + - type: grid + square: false + columns: 1 + cards: + - type: markdown + content:
Cells Voltage / Wire Resistance + - type: grid + square: false + columns: 2 + cards: + - type: markdown + content: >- +
01.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '1' %} + {{ + states('sensor.yambms_demo_bms_2_cell_voltage_01') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '1' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_01') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_01') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_01') }} Ω +
02.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '2' %} + {{ + states('sensor.yambms_demo_bms_2_cell_voltage_02') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '2' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_02') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_02') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_02') }} Ω +
03.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '3' %} + {{ + states('sensor.yambms_demo_bms_2_cell_voltage_03') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '3' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_03') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_03') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_03') }} Ω +
04.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '4' %} + {{ + states('sensor.yambms_demo_bms_2_cell_voltage_04') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '4' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_04') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_04') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_04') }} Ω +
05.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '5' %} + {{ + states('sensor.yambms_demo_bms_2_cell_voltage_05') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '5' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_05') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_05') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_05') }} Ω +
06.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '6' %} + {{ + states('sensor.yambms_demo_bms_2_cell_voltage_06') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '6' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_06') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_06') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_06') }} Ω +
07.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '7' %} + {{ + states('sensor.yambms_demo_bms_2_cell_voltage_07') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '7' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_07') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_07') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_07') }} Ω +
08.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '8' %} + {{ + states('sensor.yambms_demo_bms_2_cell_voltage_08') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '8' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_08') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_08') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_08') }} Ω +
+ - type: markdown + content: >- +
09.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '9' %} + {{ + states('sensor.yambms_demo_bms_2_cell_voltage_09') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '9' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_09') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_09') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_09') }} Ω +
10.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '10' + %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_10') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '10' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_10') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_10') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_10') }} Ω +
11.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '11' + %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_11') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '11' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_11') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_11') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_11') }} Ω +
12.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '12' + %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_12') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '12' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_12') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_12') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_12') }} Ω +
13.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '13' + %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_13') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '13' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_13') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_13') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_13') }} Ω +
14.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '14' + %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_14') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '14' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_14') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_14') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_14') }} Ω +
15.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '15' + %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_15') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '15' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_15') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_15') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_15') }} Ω +
16.    {% if + states('sensor.yambms_demo_bms_2_max_voltage_cell') == '16' + %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_16') }} V + {% elif states('sensor.yambms_demo_bms_2_min_voltage_cell') == + '16' %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_16') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_2_cell_voltage_16') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_2_cell_resistance_16') }} Ω +
+ - type: entity-filter + entities: + - entity: switch.yambms_demo_bms_2_combine_enabled + name: Combine + - entity: binary_sensor.yambms_demo_bms_2_combine_availability + name: Cb. Availability + - entity: binary_sensor.yambms_demo_bms_2_can_be_combined + name: Can be combined + conditions: + - condition: state + state_not: unavailable + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: entity-filter + entities: + - entity: switch.yambms_demo_bms_2_charge_switch + name: Charge + - entity: switch.yambms_demo_bms_2_discharge_switch + name: Discharge + - entity: switch.yambms_demo_bms_2_balance_switch + name: Balance + conditions: + - condition: state + state_not: unavailable + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: grid + title: BMS 3 + column_span: 1 + cards: + - type: grid + square: false + columns: 1 + cards: + - type: markdown + content: >- +
Time : {{ + states('sensor.yambms_demo_bms_3_total_runtime_formatted') | + upper }} + layout_options: + grid_columns: 2 + grid_rows: 1 + - type: grid + square: false + columns: 1 + cards: + - type: markdown + content: >- +
Error : {{ + states('sensor.yambms_demo_bms_3_errors')}} + layout_options: + grid_columns: 2 + grid_rows: 1 + - type: grid + square: false + columns: 3 + cards: + - type: markdown + content: >- +
Charge : {% if + states('switch.yambms_demo_bms_3_charge_switch') == 'on' %} + {{ + states('switch.yambms_demo_bms_3_charge_switch') | upper + }} {% else %} {{ + states('switch.yambms_demo_bms_3_charge_switch') | upper + }} {% endif %} + - type: markdown + content: >- +
Discharge : {% if + states('switch.yambms_demo_bms_3_discharge_switch') == 'on' + %} {{ + states('switch.yambms_demo_bms_3_discharge_switch') | upper + }} {% else %} {{ + states('switch.yambms_demo_bms_3_discharge_switch') | upper + }} {% endif %} + - type: markdown + content: >- +
Balance : {% if + states('switch.yambms_demo_bms_3_balance_switch') == 'on' %} + {{ + states('switch.yambms_demo_bms_3_balance_switch') | upper + }} {% else %} {{ + states('switch.yambms_demo_bms_3_balance_switch') | upper + }} {% endif %} + - type: grid + square: false + columns: 2 + cards: + - type: markdown + content: >- +
{{ + states('sensor.yambms_demo_bms_3_total_voltage') }} + V
Battery Power :  {{ states('sensor.yambms_demo_bms_3_power') }} + W
Battery Capacity :  {{ + states('sensor.yambms_demo_bms_3_battery_capacity') + }} Ah
Cycle Capacity :  {{ + states('sensor.yambms_demo_bms_3_charging_cycles') + }} Ah
Ave. Cell Vol. :  {{ + states('sensor.yambms_demo_bms_3_average_cell_voltage') }} + V
Balance Cur. :  {{ + states('sensor.yambms_demo_bms_3_balancing_current') }} + A
Battery T1 :  {{ + states('sensor.yambms_demo_bms_3_temperature_sensor_1') }} + °C + - type: markdown + content: >- +
{{ + states('sensor.yambms_demo_bms_3_current') }} A
+ Remain Battery :  {{ + states('sensor.yambms_demo_bms_3_soc') }} + %
Remain Capacity :  {{ + states('sensor.yambms_demo_bms_3_capacity_remaining') }} + Ah
Cycle Count :  {{ + states('sensor.yambms_demo_bms_3_charging_cycles') + }}
Delta Cell Vol. :  {{ + states('sensor.yambms_demo_bms_3_delta_cell_voltage') }} + V
MOS Temp. :  {{ + states('sensor.yambms_demo_bms_3_power_tube_temperature') }} + °C
Battery T2 :  {{ + states('sensor.yambms_demo_bms_3_temperature_sensor_2') }} + °C + - type: grid + square: false + columns: 1 + cards: + - type: markdown + content:
Cells Voltage / Wire Resistance + - type: grid + square: false + columns: 2 + cards: + - type: markdown + content: >- +
01.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '1' %} + {{ + states('sensor.yambms_demo_bms_3_cell_voltage_01') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '1' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_01') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_01') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_01') }} Ω +
02.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '2' %} + {{ + states('sensor.yambms_demo_bms_3_cell_voltage_02') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '2' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_02') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_02') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_02') }} Ω +
03.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '3' %} + {{ + states('sensor.yambms_demo_bms_3_cell_voltage_03') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '3' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_03') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_03') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_03') }} Ω +
04.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '4' %} + {{ + states('sensor.yambms_demo_bms_3_cell_voltage_04') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '4' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_04') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_04') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_04') }} Ω +
05.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '5' %} + {{ + states('sensor.yambms_demo_bms_3_cell_voltage_05') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '5' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_05') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_05') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_05') }} Ω +
06.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '6' %} + {{ + states('sensor.yambms_demo_bms_3_cell_voltage_06') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '6' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_06') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_06') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_06') }} Ω +
07.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '7' %} + {{ + states('sensor.yambms_demo_bms_3_cell_voltage_07') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '7' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_07') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_07') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_07') }} Ω +
08.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '8' %} + {{ + states('sensor.yambms_demo_bms_3_cell_voltage_08') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '8' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_08') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_08') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_08') }} Ω +
+ - type: markdown + content: >- +
09.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '9' %} + {{ + states('sensor.yambms_demo_bms_3_cell_voltage_09') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '9' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_09') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_09') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_09') }} Ω +
10.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '10' + %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_10') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '10' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_10') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_10') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_10') }} Ω +
11.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '11' + %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_11') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '11' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_11') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_11') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_11') }} Ω +
12.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '12' + %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_12') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '12' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_12') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_12') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_12') }} Ω +
13.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '13' + %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_13') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '13' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_13') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_13') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_13') }} Ω +
14.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '14' + %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_14') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '14' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_14') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_14') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_14') }} Ω +
15.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '15' + %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_15') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '15' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_15') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_15') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_15') }} Ω +
16.    {% if + states('sensor.yambms_demo_bms_3_max_voltage_cell') == '16' + %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_16') }} V + {% elif states('sensor.yambms_demo_bms_3_min_voltage_cell') == + '16' %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_16') }} V + {% else %} {{ + states('sensor.yambms_demo_bms_3_cell_voltage_16') }} V {% + endif %}    /    {{ + states('sensor.yambms_demo_bms_3_cell_resistance_16') }} Ω +
+ - type: entity-filter + entities: + - entity: switch.yambms_demo_bms_3_combine_enabled + name: Combine + - entity: binary_sensor.yambms_demo_bms_3_combine_availability + name: Cb. Availability + - entity: binary_sensor.yambms_demo_bms_3_can_be_combined + name: Can be combined + conditions: + - condition: state + state_not: unavailable + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: entity-filter + entities: + - entity: switch.yambms_demo_bms_3_charge_switch + name: Charge + - entity: switch.yambms_demo_bms_3_discharge_switch + name: Discharge + - entity: switch.yambms_demo_bms_3_balance_switch + name: Balance + conditions: + - condition: state + state_not: unavailable + layout_options: + grid_columns: 2 + grid_rows: 3 + - title: Shunt + type: sections + max_columns: 3 + sections: + - type: grid + cards: + - graph: line + type: sensor + entity: sensor.yambms_demo_shunt_1_voltage + detail: 2 + layout_options: + grid_columns: 2 + grid_rows: 2 + name: Voltage + hours_to_show: 8 + - graph: line + type: sensor + entity: sensor.yambms_demo_shunt_1_soc + detail: 2 + name: SoC + hours_to_show: 8 + - type: gauge + entity: sensor.yambms_demo_shunt_1_current + needle: true + severity: + green: 0 + yellow: -250 + red: -500 + max: 500 + min: -500 + name: Current + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: gauge + entity: sensor.yambms_demo_shunt_1_power + needle: true + severity: + green: 0 + yellow: -2500 + red: -5000 + max: 5000 + min: -5000 + name: Power + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: entity-filter + entities: + - entity: sensor.yambms_demo_shunt_1_voltage + name: Shunt 1 Voltage + - entity: sensor.yambms_demo_shunt_1_current + name: Shunt 1 Current + - entity: sensor.yambms_demo_shunt_1_power + name: Shunt 1 Power + - entity: sensor.yambms_demo_shunt_1_soc + name: Shunt 1 SoC + - entity: sensor.yambms_demo_shunt_1_temperature + name: Shunt 1 Temperature + - entity: sensor.yambms_demo_shunt_1_charged_power + name: Shunt 1 Charged Power + - entity: sensor.yambms_demo_shunt_1_discharged_power + name: Shunt 1 Discharged Power + - entity: sensor.yambms_demo_shunt_1_battery_capacity + name: Shunt 1 Battery Capacity + conditions: + - condition: state + state_not: unavailable + - type: entities + entities: + - entity: switch.yambms_demo_shunt_1_combine_enabled + name: Shunt 1 Combine enabled + - entity: binary_sensor.yambms_demo_shunt_1_combine_availability + name: Shunt 1 Combine Availability + - entity: binary_sensor.yambms_demo_shunt_1_can_be_combined + name: Shunt 1 Can be combined + title: Shunt 1 + column_span: 1 diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-ALL_UART_BLE.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-ALL_UART_BLE_3xBMS.yaml similarity index 80% rename from HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-ALL_UART_BLE.yaml rename to HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-ALL_UART_BLE_3xBMS.yaml index d1a0aa6..3caff0b 100644 --- a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-ALL_UART_BLE.yaml +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-ALL_UART_BLE_3xBMS.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.04 -# Version : 1.1.4 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -81,7 +81,7 @@ views: entity: sensor.yambms_yambms_1_delta_cell_voltage name: Delta Cell Voltage - type: tile - entity: binary_sensor.yambms_yambms_1_equalizing_state + entity: binary_sensor.yambms_yambms_1_bms_equalizing_state name: Equalizing state - type: entities entities: @@ -133,14 +133,14 @@ views: entity: sensor.yambms_yambms_1_charging_status name: Charging Status - type: tile - entity: sensor.yambms_esp32_uptime - name: ESP32 Uptime + entity: sensor.yambms_yambms_1_last_complete_charge + name: Last Complete Charge - type: tile entity: sensor.yambms_yambms_1_charging_instruction name: Charging Instruction - type: tile - entity: sensor.yambms_yambms_1_last_complete_charge - name: Last Complete Charge + entity: binary_sensor.yambms_yambms_1_discharging_instruction + name: Discharging Instruction - type: tile entity: sensor.yambms_yambms_1_alarm name: Alarm @@ -153,11 +153,18 @@ views: name: BMS count - entity: sensor.yambms_yambms_1_bms_combined name: BMS combined + - entity: sensor.yambms_yambms_1_bms_blocking_charge + name: BMS blocking charge + - entity: sensor.yambms_yambms_1_bms_blocking_discharge + name: BMS blocking discharge - entity: sensor.yambms_yambms_1_bms_in_alarm name: BMS in alarm layout_options: grid_columns: 2 - grid_rows: 3 + grid_rows: 4 + - type: tile + entity: sensor.yambms_esp32_uptime + name: ESP32 Uptime - type: entities entities: - entity: sensor.yambms_yambms_1_shunt_count @@ -202,10 +209,10 @@ views: name: YamBMS 1 Charge enabled - entity: switch.yambms_yambms_1_discharge_enabled name: YamBMS 1 Discharge enabled - - entity: binary_sensor.yambms_yambms_1_bms_charge_switch_state - name: YamBMS 1 BMS Charge switch state - - entity: binary_sensor.yambms_yambms_1_bms_discharge_switch_state - name: YamBMS 1 BMS Discharge switch state + - entity: binary_sensor.yambms_yambms_1_bms_charging_allowed + name: YamBMS 1 BMS Charging allowed + - entity: binary_sensor.yambms_yambms_1_bms_discharging_allowed + name: YamBMS 1 BMS Discharging allowed title: YamBMS - Charge / Discharge switch - type: entities entities: @@ -360,8 +367,8 @@ views: - type: markdown content: >-
Discharge : {% if - states('binary_sensor.yambms_jk_bms_1_discharging') == 'on' - %} {{ + states('binary_sensor.yambms_jk_bms_1_discharging') == 'on' %} + {{ states('binary_sensor.yambms_jk_bms_1_discharging') | upper }} {% else %} {{ states('binary_sensor.yambms_jk_bms_1_discharging') | upper @@ -409,9 +416,8 @@ views: color=#41CD52>{{ states('sensor.yambms_jk_bms_1_capacity_remaining') }} Ah
Cycle Count :  {{ - states('sensor.yambms_jk_bms_1_charging_cycles') - }}
Delta Cell Vol. :  {{ + states('sensor.yambms_jk_bms_1_charging_cycles') }}
+ Delta Cell Vol. :  {{ states('sensor.yambms_jk_bms_1_delta_cell_voltage') }} V
MOS Temp. :  {{ states('sensor.yambms_jk_bms_1_power_tube_temperature') }} @@ -437,86 +443,78 @@ views: {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '1' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_01') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_01') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_01') }} Ω -
02.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_01') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_01') }} Ω
+ 02.    {% if states('sensor.yambms_jk_bms_1_max_voltage_cell') == '2' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_02') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '2' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_02') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_02') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_02') }} Ω -
03.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_02') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_02') }} Ω
+ 03.    {% if states('sensor.yambms_jk_bms_1_max_voltage_cell') == '3' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_03') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '3' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_03') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_03') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_03') }} Ω -
04.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_03') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_03') }} Ω
+ 04.    {% if states('sensor.yambms_jk_bms_1_max_voltage_cell') == '4' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_04') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '4' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_04') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_04') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_04') }} Ω -
05.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_04') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_04') }} Ω
+ 05.    {% if states('sensor.yambms_jk_bms_1_max_voltage_cell') == '5' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_05') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '5' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_05') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_05') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_05') }} Ω -
06.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_05') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_05') }} Ω
+ 06.    {% if states('sensor.yambms_jk_bms_1_max_voltage_cell') == '6' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_06') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '6' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_06') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_06') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_06') }} Ω -
07.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_06') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_06') }} Ω
+ 07.    {% if states('sensor.yambms_jk_bms_1_max_voltage_cell') == '7' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_07') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '7' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_07') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_07') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_07') }} Ω -
08.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_07') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_07') }} Ω
+ 08.    {% if states('sensor.yambms_jk_bms_1_max_voltage_cell') == '8' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_08') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '8' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_08') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_08') }} V {% - endif %}    /    {{ + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_08') + }} V {% endif %}    /    {{ states('sensor.yambms_jk_bms_1_cell_resistance_08') }} Ω
- type: markdown @@ -528,89 +526,81 @@ views: {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '9' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_09') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_09') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_09') }} Ω -
10.    {% if - states('sensor.yambms_jk_bms_1_max_voltage_cell') == '10' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_09') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_09') }} Ω
+ 10.    {% if + states('sensor.yambms_jk_bms_1_max_voltage_cell') == '10' %} + {{ states('sensor.yambms_jk_bms_1_cell_voltage_10') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '10' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_10') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_10') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_10') }} Ω -
11.    {% if - states('sensor.yambms_jk_bms_1_max_voltage_cell') == '11' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_10') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_10') }} Ω
+ 11.    {% if + states('sensor.yambms_jk_bms_1_max_voltage_cell') == '11' %} + {{ states('sensor.yambms_jk_bms_1_cell_voltage_11') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '11' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_11') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_11') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_11') }} Ω -
12.    {% if - states('sensor.yambms_jk_bms_1_max_voltage_cell') == '12' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_11') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_11') }} Ω
+ 12.    {% if + states('sensor.yambms_jk_bms_1_max_voltage_cell') == '12' %} + {{ states('sensor.yambms_jk_bms_1_cell_voltage_12') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '12' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_12') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_12') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_12') }} Ω -
13.    {% if - states('sensor.yambms_jk_bms_1_max_voltage_cell') == '13' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_12') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_12') }} Ω
+ 13.    {% if + states('sensor.yambms_jk_bms_1_max_voltage_cell') == '13' %} + {{ states('sensor.yambms_jk_bms_1_cell_voltage_13') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '13' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_13') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_13') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_13') }} Ω -
14.    {% if - states('sensor.yambms_jk_bms_1_max_voltage_cell') == '14' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_13') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_13') }} Ω
+ 14.    {% if + states('sensor.yambms_jk_bms_1_max_voltage_cell') == '14' %} + {{ states('sensor.yambms_jk_bms_1_cell_voltage_14') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '14' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_14') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_14') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_14') }} Ω -
15.    {% if - states('sensor.yambms_jk_bms_1_max_voltage_cell') == '15' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_14') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_14') }} Ω
+ 15.    {% if + states('sensor.yambms_jk_bms_1_max_voltage_cell') == '15' %} + {{ states('sensor.yambms_jk_bms_1_cell_voltage_15') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '15' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_15') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_15') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_1_cell_resistance_15') }} Ω -
16.    {% if - states('sensor.yambms_jk_bms_1_max_voltage_cell') == '16' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_15') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_1_cell_resistance_15') }} Ω
+ 16.    {% if + states('sensor.yambms_jk_bms_1_max_voltage_cell') == '16' %} + {{ states('sensor.yambms_jk_bms_1_cell_voltage_16') }} V {% elif states('sensor.yambms_jk_bms_1_min_voltage_cell') == '16' %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_16') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_1_cell_voltage_16') }} V {% - endif %}    /    {{ + {% else %} {{ states('sensor.yambms_jk_bms_1_cell_voltage_16') + }} V {% endif %}    /    {{ states('sensor.yambms_jk_bms_1_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_1_combine_enabled name: Combine @@ -618,6 +608,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_1_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -678,8 +671,8 @@ views: - type: markdown content: >-
Discharge : {% if - states('binary_sensor.yambms_jk_bms_2_discharging') == 'on' - %} {{ + states('binary_sensor.yambms_jk_bms_2_discharging') == 'on' %} + {{ states('binary_sensor.yambms_jk_bms_2_discharging') | upper }} {% else %} {{ states('binary_sensor.yambms_jk_bms_2_discharging') | upper @@ -727,9 +720,8 @@ views: color=#41CD52>{{ states('sensor.yambms_jk_bms_2_capacity_remaining') }} Ah
Cycle Count :  {{ - states('sensor.yambms_jk_bms_2_charging_cycles') - }}
Delta Cell Vol. :  {{ + states('sensor.yambms_jk_bms_2_charging_cycles') }}
+ Delta Cell Vol. :  {{ states('sensor.yambms_jk_bms_2_delta_cell_voltage') }} V
MOS Temp. :  {{ states('sensor.yambms_jk_bms_2_power_tube_temperature') }} @@ -755,86 +747,78 @@ views: {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '1' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_01') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_01') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_01') }} Ω -
02.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_01') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_01') }} Ω
+ 02.    {% if states('sensor.yambms_jk_bms_2_max_voltage_cell') == '2' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_02') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '2' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_02') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_02') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_02') }} Ω -
03.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_02') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_02') }} Ω
+ 03.    {% if states('sensor.yambms_jk_bms_2_max_voltage_cell') == '3' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_03') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '3' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_03') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_03') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_03') }} Ω -
04.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_03') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_03') }} Ω
+ 04.    {% if states('sensor.yambms_jk_bms_2_max_voltage_cell') == '4' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_04') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '4' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_04') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_04') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_04') }} Ω -
05.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_04') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_04') }} Ω
+ 05.    {% if states('sensor.yambms_jk_bms_2_max_voltage_cell') == '5' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_05') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '5' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_05') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_05') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_05') }} Ω -
06.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_05') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_05') }} Ω
+ 06.    {% if states('sensor.yambms_jk_bms_2_max_voltage_cell') == '6' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_06') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '6' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_06') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_06') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_06') }} Ω -
07.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_06') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_06') }} Ω
+ 07.    {% if states('sensor.yambms_jk_bms_2_max_voltage_cell') == '7' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_07') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '7' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_07') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_07') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_07') }} Ω -
08.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_07') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_07') }} Ω
+ 08.    {% if states('sensor.yambms_jk_bms_2_max_voltage_cell') == '8' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_08') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '8' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_08') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_08') }} V {% - endif %}    /    {{ + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_08') + }} V {% endif %}    /    {{ states('sensor.yambms_jk_bms_2_cell_resistance_08') }} Ω
- type: markdown @@ -846,89 +830,81 @@ views: {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '9' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_09') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_09') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_09') }} Ω -
10.    {% if - states('sensor.yambms_jk_bms_2_max_voltage_cell') == '10' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_09') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_09') }} Ω
+ 10.    {% if + states('sensor.yambms_jk_bms_2_max_voltage_cell') == '10' %} + {{ states('sensor.yambms_jk_bms_2_cell_voltage_10') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '10' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_10') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_10') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_10') }} Ω -
11.    {% if - states('sensor.yambms_jk_bms_2_max_voltage_cell') == '11' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_10') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_10') }} Ω
+ 11.    {% if + states('sensor.yambms_jk_bms_2_max_voltage_cell') == '11' %} + {{ states('sensor.yambms_jk_bms_2_cell_voltage_11') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '11' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_11') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_11') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_11') }} Ω -
12.    {% if - states('sensor.yambms_jk_bms_2_max_voltage_cell') == '12' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_11') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_11') }} Ω
+ 12.    {% if + states('sensor.yambms_jk_bms_2_max_voltage_cell') == '12' %} + {{ states('sensor.yambms_jk_bms_2_cell_voltage_12') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '12' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_12') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_12') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_12') }} Ω -
13.    {% if - states('sensor.yambms_jk_bms_2_max_voltage_cell') == '13' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_12') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_12') }} Ω
+ 13.    {% if + states('sensor.yambms_jk_bms_2_max_voltage_cell') == '13' %} + {{ states('sensor.yambms_jk_bms_2_cell_voltage_13') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '13' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_13') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_13') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_13') }} Ω -
14.    {% if - states('sensor.yambms_jk_bms_2_max_voltage_cell') == '14' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_13') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_13') }} Ω
+ 14.    {% if + states('sensor.yambms_jk_bms_2_max_voltage_cell') == '14' %} + {{ states('sensor.yambms_jk_bms_2_cell_voltage_14') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '14' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_14') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_14') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_14') }} Ω -
15.    {% if - states('sensor.yambms_jk_bms_2_max_voltage_cell') == '15' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_14') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_14') }} Ω
+ 15.    {% if + states('sensor.yambms_jk_bms_2_max_voltage_cell') == '15' %} + {{ states('sensor.yambms_jk_bms_2_cell_voltage_15') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '15' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_15') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_15') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_2_cell_resistance_15') }} Ω -
16.    {% if - states('sensor.yambms_jk_bms_2_max_voltage_cell') == '16' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_15') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_2_cell_resistance_15') }} Ω
+ 16.    {% if + states('sensor.yambms_jk_bms_2_max_voltage_cell') == '16' %} + {{ states('sensor.yambms_jk_bms_2_cell_voltage_16') }} V {% elif states('sensor.yambms_jk_bms_2_min_voltage_cell') == '16' %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_16') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_2_cell_voltage_16') }} V {% - endif %}    /    {{ + {% else %} {{ states('sensor.yambms_jk_bms_2_cell_voltage_16') + }} V {% endif %}    /    {{ states('sensor.yambms_jk_bms_2_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_2_combine_enabled name: Combine @@ -936,6 +912,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_2_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -996,8 +975,8 @@ views: - type: markdown content: >-
Discharge : {% if - states('binary_sensor.yambms_jk_bms_3_discharging') == 'on' - %} {{ + states('binary_sensor.yambms_jk_bms_3_discharging') == 'on' %} + {{ states('binary_sensor.yambms_jk_bms_3_discharging') | upper }} {% else %} {{ states('binary_sensor.yambms_jk_bms_3_discharging') | upper @@ -1045,9 +1024,8 @@ views: color=#41CD52>{{ states('sensor.yambms_jk_bms_3_capacity_remaining') }} Ah
Cycle Count :  {{ - states('sensor.yambms_jk_bms_3_charging_cycles') - }}
Delta Cell Vol. :  {{ + states('sensor.yambms_jk_bms_3_charging_cycles') }}
+ Delta Cell Vol. :  {{ states('sensor.yambms_jk_bms_3_delta_cell_voltage') }} V
MOS Temp. :  {{ states('sensor.yambms_jk_bms_3_power_tube_temperature') }} @@ -1073,86 +1051,78 @@ views: {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '1' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_01') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_01') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_01') }} Ω -
02.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_01') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_01') }} Ω
+ 02.    {% if states('sensor.yambms_jk_bms_3_max_voltage_cell') == '2' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_02') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '2' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_02') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_02') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_02') }} Ω -
03.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_02') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_02') }} Ω
+ 03.    {% if states('sensor.yambms_jk_bms_3_max_voltage_cell') == '3' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_03') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '3' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_03') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_03') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_03') }} Ω -
04.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_03') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_03') }} Ω
+ 04.    {% if states('sensor.yambms_jk_bms_3_max_voltage_cell') == '4' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_04') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '4' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_04') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_04') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_04') }} Ω -
05.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_04') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_04') }} Ω
+ 05.    {% if states('sensor.yambms_jk_bms_3_max_voltage_cell') == '5' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_05') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '5' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_05') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_05') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_05') }} Ω -
06.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_05') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_05') }} Ω
+ 06.    {% if states('sensor.yambms_jk_bms_3_max_voltage_cell') == '6' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_06') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '6' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_06') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_06') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_06') }} Ω -
07.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_06') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_06') }} Ω
+ 07.    {% if states('sensor.yambms_jk_bms_3_max_voltage_cell') == '7' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_07') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '7' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_07') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_07') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_07') }} Ω -
08.    {% if + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_07') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_07') }} Ω
+ 08.    {% if states('sensor.yambms_jk_bms_3_max_voltage_cell') == '8' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_08') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '8' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_08') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_08') }} V {% - endif %}    /    {{ + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_08') + }} V {% endif %}    /    {{ states('sensor.yambms_jk_bms_3_cell_resistance_08') }} Ω
- type: markdown @@ -1164,89 +1134,81 @@ views: {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '9' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_09') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_09') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_09') }} Ω -
10.    {% if - states('sensor.yambms_jk_bms_3_max_voltage_cell') == '10' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_09') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_09') }} Ω
+ 10.    {% if + states('sensor.yambms_jk_bms_3_max_voltage_cell') == '10' %} + {{ states('sensor.yambms_jk_bms_3_cell_voltage_10') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '10' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_10') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_10') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_10') }} Ω -
11.    {% if - states('sensor.yambms_jk_bms_3_max_voltage_cell') == '11' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_10') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_10') }} Ω
+ 11.    {% if + states('sensor.yambms_jk_bms_3_max_voltage_cell') == '11' %} + {{ states('sensor.yambms_jk_bms_3_cell_voltage_11') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '11' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_11') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_11') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_11') }} Ω -
12.    {% if - states('sensor.yambms_jk_bms_3_max_voltage_cell') == '12' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_11') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_11') }} Ω
+ 12.    {% if + states('sensor.yambms_jk_bms_3_max_voltage_cell') == '12' %} + {{ states('sensor.yambms_jk_bms_3_cell_voltage_12') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '12' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_12') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_12') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_12') }} Ω -
13.    {% if - states('sensor.yambms_jk_bms_3_max_voltage_cell') == '13' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_12') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_12') }} Ω
+ 13.    {% if + states('sensor.yambms_jk_bms_3_max_voltage_cell') == '13' %} + {{ states('sensor.yambms_jk_bms_3_cell_voltage_13') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '13' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_13') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_13') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_13') }} Ω -
14.    {% if - states('sensor.yambms_jk_bms_3_max_voltage_cell') == '14' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_13') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_13') }} Ω
+ 14.    {% if + states('sensor.yambms_jk_bms_3_max_voltage_cell') == '14' %} + {{ states('sensor.yambms_jk_bms_3_cell_voltage_14') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '14' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_14') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_14') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_14') }} Ω -
15.    {% if - states('sensor.yambms_jk_bms_3_max_voltage_cell') == '15' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_14') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_14') }} Ω
+ 15.    {% if + states('sensor.yambms_jk_bms_3_max_voltage_cell') == '15' %} + {{ states('sensor.yambms_jk_bms_3_cell_voltage_15') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '15' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_15') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_15') }} V {% - endif %}    /    {{ - states('sensor.yambms_jk_bms_3_cell_resistance_15') }} Ω -
16.    {% if - states('sensor.yambms_jk_bms_3_max_voltage_cell') == '16' - %} {{ + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_15') + }} V {% endif %}    /    {{ + states('sensor.yambms_jk_bms_3_cell_resistance_15') }} Ω
+ 16.    {% if + states('sensor.yambms_jk_bms_3_max_voltage_cell') == '16' %} + {{ states('sensor.yambms_jk_bms_3_cell_voltage_16') }} V {% elif states('sensor.yambms_jk_bms_3_min_voltage_cell') == '16' %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_16') }} V - {% else %} {{ - states('sensor.yambms_jk_bms_3_cell_voltage_16') }} V {% - endif %}    /    {{ + {% else %} {{ states('sensor.yambms_jk_bms_3_cell_voltage_16') + }} V {% endif %}    /    {{ states('sensor.yambms_jk_bms_3_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_3_combine_enabled name: Combine @@ -1254,6 +1216,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_3_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -1349,4 +1314,3 @@ views: name: Shunt 1 Can be combined title: Shunt 1 column_span: 1 - diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485_3xBMS.yaml similarity index 98% rename from HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485.yaml rename to HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485_3xBMS.yaml index f07372c..5f562ad 100644 --- a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485.yaml +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485_3xBMS.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.04 -# Version : 1.1.4 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -81,7 +81,7 @@ views: entity: sensor.yambms_yambms_1_delta_cell_voltage name: Delta Cell Voltage - type: tile - entity: binary_sensor.yambms_yambms_1_equalizing_state + entity: binary_sensor.yambms_yambms_1_bms_equalizing_state name: Equalizing state - type: entities entities: @@ -133,14 +133,14 @@ views: entity: sensor.yambms_yambms_1_charging_status name: Charging Status - type: tile - entity: sensor.yambms_esp32_uptime - name: ESP32 Uptime + entity: sensor.yambms_yambms_1_last_complete_charge + name: Last Complete Charge - type: tile entity: sensor.yambms_yambms_1_charging_instruction name: Charging Instruction - type: tile - entity: sensor.yambms_yambms_1_last_complete_charge - name: Last Complete Charge + entity: binary_sensor.yambms_yambms_1_discharging_instruction + name: Discharging Instruction - type: tile entity: sensor.yambms_yambms_1_alarm name: Alarm @@ -153,11 +153,18 @@ views: name: BMS count - entity: sensor.yambms_yambms_1_bms_combined name: BMS combined + - entity: sensor.yambms_yambms_1_bms_blocking_charge + name: BMS blocking charge + - entity: sensor.yambms_yambms_1_bms_blocking_discharge + name: BMS blocking discharge - entity: sensor.yambms_yambms_1_bms_in_alarm name: BMS in alarm layout_options: grid_columns: 2 - grid_rows: 3 + grid_rows: 4 + - type: tile + entity: sensor.yambms_esp32_uptime + name: ESP32 Uptime - type: entities entities: - entity: sensor.yambms_yambms_1_shunt_count @@ -202,10 +209,10 @@ views: name: YamBMS 1 Charge enabled - entity: switch.yambms_yambms_1_discharge_enabled name: YamBMS 1 Discharge enabled - - entity: binary_sensor.yambms_yambms_1_bms_charge_switch_state - name: YamBMS 1 BMS Charge switch state - - entity: binary_sensor.yambms_yambms_1_bms_discharge_switch_state - name: YamBMS 1 BMS Discharge switch state + - entity: binary_sensor.yambms_yambms_1_bms_charging_allowed + name: YamBMS 1 BMS Charging allowed + - entity: binary_sensor.yambms_yambms_1_bms_discharging_allowed + name: YamBMS 1 BMS Discharging allowed title: YamBMS - Charge / Discharge switch - type: entities entities: @@ -610,7 +617,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_1_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_1_combine_enabled name: Combine @@ -618,6 +625,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_1_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -928,7 +938,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_2_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_2_combine_enabled name: Combine @@ -936,6 +946,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_2_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -1246,7 +1259,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_3_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_3_combine_enabled name: Combine @@ -1254,6 +1267,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_3_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485_7xBMS.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485_7xBMS.yaml index b370aa0..e3c6d46 100644 --- a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485_7xBMS.yaml +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK-PB_RS485_7xBMS.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.04 -# Version : 1.1.4 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -81,7 +81,7 @@ views: entity: sensor.yambms_yambms_1_delta_cell_voltage name: Delta Cell Voltage - type: tile - entity: binary_sensor.yambms_yambms_1_equalizing_state + entity: binary_sensor.yambms_yambms_1_bms_equalizing_state name: Equalizing state - type: entities entities: @@ -133,14 +133,14 @@ views: entity: sensor.yambms_yambms_1_charging_status name: Charging Status - type: tile - entity: sensor.yambms_esp32_uptime - name: ESP32 Uptime + entity: sensor.yambms_yambms_1_last_complete_charge + name: Last Complete Charge - type: tile entity: sensor.yambms_yambms_1_charging_instruction name: Charging Instruction - type: tile - entity: sensor.yambms_yambms_1_last_complete_charge - name: Last Complete Charge + entity: binary_sensor.yambms_yambms_1_discharging_instruction + name: Discharging Instruction - type: tile entity: sensor.yambms_yambms_1_alarm name: Alarm @@ -153,11 +153,18 @@ views: name: BMS count - entity: sensor.yambms_yambms_1_bms_combined name: BMS combined + - entity: sensor.yambms_yambms_1_bms_blocking_charge + name: BMS blocking charge + - entity: sensor.yambms_yambms_1_bms_blocking_discharge + name: BMS blocking discharge - entity: sensor.yambms_yambms_1_bms_in_alarm name: BMS in alarm layout_options: grid_columns: 2 - grid_rows: 3 + grid_rows: 4 + - type: tile + entity: sensor.yambms_esp32_uptime + name: ESP32 Uptime - type: entities entities: - entity: sensor.yambms_yambms_1_shunt_count @@ -202,10 +209,10 @@ views: name: YamBMS 1 Charge enabled - entity: switch.yambms_yambms_1_discharge_enabled name: YamBMS 1 Discharge enabled - - entity: binary_sensor.yambms_yambms_1_bms_charge_switch_state - name: YamBMS 1 BMS Charge switch state - - entity: binary_sensor.yambms_yambms_1_bms_discharge_switch_state - name: YamBMS 1 BMS Discharge switch state + - entity: binary_sensor.yambms_yambms_1_bms_charging_allowed + name: YamBMS 1 BMS Charging allowed + - entity: binary_sensor.yambms_yambms_1_bms_discharging_allowed + name: YamBMS 1 BMS Discharging allowed title: YamBMS - Charge / Discharge switch - type: entities entities: @@ -610,7 +617,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_1_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_1_combine_enabled name: Combine @@ -618,6 +625,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_1_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -928,7 +938,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_2_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_2_combine_enabled name: Combine @@ -936,6 +946,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_2_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -1246,7 +1259,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_3_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_3_combine_enabled name: Combine @@ -1254,6 +1267,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_3_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -1564,7 +1580,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_4_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_4_combine_enabled name: Combine @@ -1572,6 +1588,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_4_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -1882,7 +1901,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_5_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_5_combine_enabled name: Combine @@ -1890,6 +1909,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_5_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -2200,7 +2222,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_6_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_6_combine_enabled name: Combine @@ -2208,6 +2230,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_6_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 @@ -2518,7 +2543,7 @@ views: endif %}    /    {{ states('sensor.yambms_jk_bms_7_cell_resistance_16') }} Ω
- - type: entities + - type: entity-filter entities: - entity: switch.yambms_jk_bms_7_combine_enabled name: Combine @@ -2526,6 +2551,9 @@ views: name: Cb. Availability - entity: binary_sensor.yambms_jk_bms_7_can_be_combined name: Can be combined + conditions: + - condition: state + state_not: unavailable layout_options: grid_columns: 2 grid_rows: 3 diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_without_BMS.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_without_BMS.yaml new file mode 100644 index 0000000..b7d0f62 --- /dev/null +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_without_BMS.yaml @@ -0,0 +1,322 @@ +# Updated : 2024.11.11 +# Version : 1.5.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 . + +views: + - title: YamBMS + type: sections + max_columns: 3 + sections: + - type: grid + cards: + - graph: line + type: sensor + entity: sensor.yambms_yambms_1_total_voltage_o + detail: 2 + layout_options: + grid_columns: 2 + grid_rows: 2 + name: Voltage + hours_to_show: 8 + - graph: line + type: sensor + entity: sensor.yambms_yambms_1_battery_soc + detail: 2 + name: SoC + hours_to_show: 8 + - type: gauge + entity: sensor.yambms_yambms_1_current_s + needle: true + severity: + green: 0 + yellow: -250 + red: -500 + max: 500 + min: -500 + name: Current + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: gauge + entity: sensor.yambms_yambms_1_power_s + needle: true + severity: + green: 0 + yellow: -2500 + red: -5000 + max: 5000 + min: -5000 + name: Power + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: tile + entity: sensor.yambms_yambms_1_installed_battery_capacity_s + name: Installed Battery Capacity + - type: tile + entity: sensor.yambms_yambms_1_battery_soh + name: Battery SoH + - type: tile + entity: sensor.yambms_yambms_1_battery_capacity_s + name: Battery Capacity + - type: tile + entity: sensor.yambms_yambms_1_capacity_remaining_s + name: Capacity Remaining + - type: tile + entity: sensor.yambms_yambms_1_delta_cell_voltage + name: Delta Cell Voltage + - type: tile + entity: binary_sensor.yambms_yambms_1_bms_equalizing_state + name: Equalizing state + - type: entities + entities: + - entity: sensor.yambms_yambms_1_max_cell_voltage + name: Max Cell V. + - entity: sensor.yambms_yambms_1_max_voltage_cell + name: Cell number + layout_options: + grid_columns: 2 + grid_rows: 2 + - type: entities + entities: + - entity: sensor.yambms_yambms_1_min_cell_voltage + name: Min Cell V. + - entity: sensor.yambms_yambms_1_min_voltage_cell + name: Cell number + layout_options: + grid_columns: 2 + grid_rows: 2 + - type: entities + entities: + - entity: sensor.yambms_yambms_1_max_temperature + name: Max temp. + - entity: sensor.yambms_yambms_1_max_temperature_sensor + name: Sensor number + layout_options: + grid_columns: 2 + grid_rows: 2 + - type: entities + entities: + - entity: sensor.yambms_yambms_1_min_temperature + name: Min temp. + - entity: sensor.yambms_yambms_1_min_temperature_sensor + name: Sensor number + layout_options: + grid_columns: 2 + grid_rows: 2 + title: YamBMS - Battery + column_span: 1 + - type: grid + cards: + - type: tile + entity: binary_sensor.yambms_canbus_1_status + name: CANBUS Status + - type: tile + entity: binary_sensor.yambms_esp32_online_status + name: ESP32 Status + - type: tile + entity: sensor.yambms_yambms_1_charging_status + name: Charging Status + - type: tile + entity: sensor.yambms_yambms_1_last_complete_charge + name: Last Complete Charge + - type: tile + entity: sensor.yambms_yambms_1_charging_instruction + name: Charging Instruction + - type: tile + entity: binary_sensor.yambms_yambms_1_discharging_instruction + name: Discharging Instruction + - type: tile + entity: sensor.yambms_yambms_1_alarm + name: Alarm + - type: tile + entity: sensor.yambms_yambms_1_warning + name: Warning + - type: entities + entities: + - entity: sensor.yambms_yambms_1_bms_count + name: BMS count + - entity: sensor.yambms_yambms_1_bms_combined + name: BMS combined + - entity: sensor.yambms_yambms_1_bms_blocking_charge + name: BMS blocking charge + - entity: sensor.yambms_yambms_1_bms_blocking_discharge + name: BMS blocking discharge + - entity: sensor.yambms_yambms_1_bms_in_alarm + name: BMS in alarm + layout_options: + grid_columns: 2 + grid_rows: 4 + - type: tile + entity: sensor.yambms_esp32_uptime + name: ESP32 Uptime + - type: entities + entities: + - entity: sensor.yambms_yambms_1_shunt_count + name: Shunt count + - entity: sensor.yambms_yambms_1_shunt_combined + name: Shunt combined + layout_options: + grid_columns: 2 + grid_rows: 3 + - type: entities + entities: + - entity: sensor.yambms_yambms_1_requested_charge_voltage + name: Requested Charge Voltage + - entity: sensor.yambms_yambms_1_requested_charge_current + name: Requested Charge Current + - entity: sensor.yambms_yambms_1_requested_discharge_voltage + name: Requested Discharge Voltage + - entity: sensor.yambms_yambms_1_requested_discharge_current + name: Requested Discharge Current + - entity: binary_sensor.yambms_yambms_1_requested_force_charge + name: Requested Force Charge + - type: tile + entity: sensor.yambms_yambms_1_running_version + name: Running version + - type: tile + entity: sensor.yambms_yambms_1_last_version + name: Last version + title: YamBMS - Status + column_span: 1 + - title: Control + cards: + - type: entities + entities: + - entity: select.yambms_canbus_1_bms_name + name: CANBUS 1 BMS Name + - entity: select.yambms_canbus_1_protocol + name: CANBUS 1 Protocol + title: YamBMS - CANBUS Protocol + - type: entities + entities: + - entity: switch.yambms_yambms_1_charge_enabled + name: YamBMS 1 Charge enabled + - entity: switch.yambms_yambms_1_discharge_enabled + name: YamBMS 1 Discharge enabled + - entity: binary_sensor.yambms_yambms_1_bms_charging_allowed + name: YamBMS 1 BMS Charging allowed + - entity: binary_sensor.yambms_yambms_1_bms_discharging_allowed + name: YamBMS 1 BMS Discharging allowed + title: YamBMS - Charge / Discharge switch + - type: entities + entities: + - entity: switch.yambms_yambms_1_automatic_charge_voltage + name: Automatic Charge Voltage + - entity: number.yambms_yambms_1_auto_cvl_boost_charge_v + name: Auto CVL Boost Charge V. + title: YamBMS - Auto CVL + - type: entities + entities: + - entity: sensor.yambms_yambms_1_charging_status + name: Charging Status + - entity: sensor.yambms_yambms_1_charging_instruction + name: Charging Instruction + - entity: switch.yambms_yambms_1_float_charge_enabled + name: Float charge enabled + - entity: switch.yambms_yambms_1_eoc_timer_enabled + name: EOC timer enabled + - entity: number.yambms_yambms_1_bulk_voltage + name: Bulk voltage + - entity: number.yambms_yambms_1_float_voltage + name: Float voltage + - entity: number.yambms_yambms_1_inverter_offset_v + name: Inverter Offset V. + title: YamBMS - Charging Settings + - type: entities + entities: + - entity: switch.yambms_yambms_1_automatic_charge_current + name: Automatic Charge Current + - entity: switch.yambms_yambms_1_automatic_discharge_current + name: Automatic Discharge Current + title: YamBMS - Auto CCL / DCL + - type: entities + entities: + - entity: number.yambms_yambms_1_rebulk_soc + name: Rebulk SoC + - entity: number.yambms_yambms_1_rebulk_v + name: Rebulk V. + - entity: switch.yambms_yambms_1_force_bulk_top_bal + name: Force Bulk (top bal) + title: YamBMS - ReBulk + - type: entities + entities: + - entity: number.yambms_yambms_1_max_charge_current + name: Max charge current (%) + - entity: number.yambms_yambms_1_max_discharge_current + name: Max discharge current (%) + title: YamBMS - Max current (%) + - type: entities + entities: + - entity: switch.yambms_yambms_1_request_force_charge + name: Request force charge + - entity: number.yambms_yambms_1_request_force_charge_start_soc + name: Force charge Start SoC + - entity: number.yambms_yambms_1_request_force_charge_stop_soc + name: Force charge Stop SoC + - entity: binary_sensor.yambms_yambms_1_requested_force_charge + name: Requested Force Charge + title: YamBMS - Request force charge + - type: entities + entities: + - entity: sensor.yambms_yambms_1_requested_charge_voltage + name: Requested Charge Voltage + - entity: sensor.yambms_yambms_1_requested_discharge_voltage + name: Requested Discharge Voltage + - entity: sensor.yambms_yambms_1_requested_charge_current + name: Requested Charge Current + - entity: sensor.yambms_yambms_1_requested_discharge_current + name: Requested Discharge Current + title: YamBMS - Requested Values + - type: entities + entities: + - entity: sensor.yambms_yambms_1_last_complete_charge + name: Last Complete Charge + - entity: binary_sensor.yambms_esp32_online_status + name: ESP32 Online Status + - entity: sensor.yambms_esp32_uptime + name: ESP32 Uptime + - entity: sensor.yambms_esp32_esphome_version + name: ESP32 ESPHome version + - entity: button.yambms_esp32_restart + name: ESP32 Restart + title: YamBMS - Diagnostic + - type: entities + entities: + - entity: binary_sensor.yambms_canbus_1_status + name: CANBUS 1 Status + - entity: switch.yambms_canbus_1_inverter_heartbeat_monitoring + name: CANBUS 1 Inverter Heartbeat Monitoring + - entity: sensor.yambms_canbus_1_inverter_heartbeat + name: CANBUS 1 Inverter Heartbeat + title: YamBMS - Inverter Heartbeat + - type: entities + entities: + - entity: sensor.yambms_debug_heap_free + name: Debug Heap free (%) + - entity: sensor.yambms_debug_heap_free_2 + name: Debug Heap free + - entity: sensor.yambms_debug_heap_max_block + name: Debug Heap max block (%) + - entity: sensor.yambms_debug_heap_max_block_2 + name: Debug Heap max block + - entity: sensor.yambms_debug_loop_time + name: Debug Loop time + - entity: sensor.yambms_debug_reset_reason + name: Debug Reset reason + title: YamBMS - DEBUG diff --git a/multi-bms_DEMO.yaml b/multi-bms_DEMO.yaml new file mode 100644 index 0000000..fbcc9cc --- /dev/null +++ b/multi-bms_DEMO.yaml @@ -0,0 +1,246 @@ +# Updated : 2024.11.11 +# Version : 1.5.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 . + +substitutions: + name: yambms-demo + +# 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 + +logger: + level: DEBUG # DEBUG / INFO / WARN + +ota: + platform: esphome + +# Please use the native `api` component instead of the `mqtt` section. +# If you use Home Assistant, the native API is more lightweight. +# If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. +api: + reboot_timeout: 0s + +# If you don't want to use ESPHome's native API you can use MQTT instead. +# In this case don't forget to remove the 'api:' section. +# mqtt: +# broker: !secret mqtt_host +# username: !secret mqtt_username +# password: !secret mqtt_password +# id: mqtt_client + +# Please note that enabling this component will take up a lot of memory and may decrease +# stability and be the cause of reboot depending on the capabilities of the board used. +#web_server: +# port: 80 +# log: false +# ota: false + +# +--------------------------------------+ +# | Packages | +# +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + +packages: + device_base: !include packages/base/device_base.yaml + # Board : uncomment your board + device_board: !include packages/board/board_esp32-devkit-v1.yaml + # device_board: !include packages/board/board_esp32-s3-devkitc-1.yaml + # device_board: !include packages/board/board_atom-s3-lite.yaml + + # device_board: !include + # file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml + # vars: + # yambms_id: 'yambms1' + # canbus_id: 'canbus1' + # display_auto_next_page_interval: '5s' + + shunt1: !include + file: packages/shunt/shunt_fake.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # Shunt vars + shunt_id: '1' # must be a number + shunt_name: 'Shunt 1' + shunt_update_interval: '3s' + shunt_combine_interval: '1s' + # Shunt sensors values + shunt_voltage: '53.41' # V + shunt_current: '37.5' # A + shunt_power: '2003' # W + shunt_soc: '86' # % + + bms1: !include + file: packages/bms/bms_FAKE.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # BMS vars + bms_id: '1' # must be a number + bms_name: 'BMS 1' + bms_update_interval: '3s' + bms_combine_interval: '1s' + # BMS sensors values + bms_battery_capacity: '280' # Ah + bms_battery_capacity_remaining: '243' # Ah + bms_voltage: '53.45' # V + bms_current: '9.2' # A + bms_power: '492' # W + bms_soc: '87' # % + bms_min_cell_voltage: '3.339' # V + bms_min_voltage_cell: '2' # cell number 1~16 + bms_max_cell_voltage: '3.341' # V + bms_max_voltage_cell: '11' # cell number 1~16 + bms_temperature_sensor_1: '21.1' # °C + bms_temperature_sensor_2: '21.3' # °C + bms_temperature_sensor_3: '21.5' # °C + bms_temperature_sensor_4: '21.7' # °C + bms_max_charge_current: '100' # A + bms_max_discharge_current: '100' # A + 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 + bms_charging_cycles: '178' # charging cycles number Used to calculate the SoH + + bms2: !include + file: packages/bms/bms_FAKE.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # BMS vars + bms_id: '2' # must be a number + bms_name: 'BMS 2' + bms_update_interval: '3s' + bms_combine_interval: '1s' + # BMS sensors values + bms_battery_capacity: '280' # Ah + bms_battery_capacity_remaining: '238' # Ah + bms_voltage: '53.41' # V + bms_current: '11.3' # A + bms_power: '604' # W + bms_soc: '85' # % + bms_min_cell_voltage: '3.337' # V + bms_min_voltage_cell: '14' # cell number 1~16 + bms_max_cell_voltage: '3.339' # V + bms_max_voltage_cell: '3' # cell number 1~16 + bms_temperature_sensor_1: '21.8' # °C + bms_temperature_sensor_2: '21.6' # °C + bms_temperature_sensor_3: '21.4' # °C + bms_temperature_sensor_4: '21.2' # °C + bms_max_charge_current: '100' # A + bms_max_discharge_current: '100' # A + 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 + bms_charging_cycles: '226' # charging cycles number Used to calculate the SoH + + bms3: !include + file: packages/bms/bms_FAKE.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # BMS vars + bms_id: '3' # must be a number + bms_name: 'BMS 3' + bms_update_interval: '3s' + bms_combine_interval: '1s' + # BMS sensors values + bms_battery_capacity: '280' # Ah + bms_battery_capacity_remaining: '232' # Ah + bms_voltage: '53.37' # V + bms_current: '15.7' # A + bms_power: '838' # W + bms_soc: '83' # % + bms_min_cell_voltage: '3.334' # V + bms_min_voltage_cell: '7' # cell number 1~16 + bms_max_cell_voltage: '3.336' # V + bms_max_voltage_cell: '9' # cell number 1~16 + bms_temperature_sensor_1: '21.9' # °C + bms_temperature_sensor_2: '22.0' # °C + bms_temperature_sensor_3: '22.1' # °C + bms_temperature_sensor_4: '22.2' # °C + bms_max_charge_current: '100' # A + bms_max_discharge_current: '100' # A + 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 + bms_charging_cycles: '194' # charging cycles number Used to calculate the SoH + + yambms1: !include + file: packages/yambms/yambms.yaml + vars: + # 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' + + canbus1: !include + file: packages/yambms/yambms_canbus.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' # YamBMS ID to retrieve information from + # CANBUS 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 ) | +# +--------------------------------------+ + + device_debug: !include + file: packages/base/device_debug_ESP32.yaml + vars: + debug_name: 'Debug' + debug_update_interval: '5s' diff --git a/multi-bms_DEMO_AtomS3.yaml b/multi-bms_DEMO_AtomS3.yaml new file mode 100644 index 0000000..cbda32f --- /dev/null +++ b/multi-bms_DEMO_AtomS3.yaml @@ -0,0 +1,242 @@ +# Updated : 2024.11.11 +# Version : 1.5.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 . + +substitutions: + name: yambms-demo + +# 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 + +logger: + level: DEBUG # DEBUG / INFO / WARN + +ota: + platform: esphome + +# Please use the native `api` component instead of the `mqtt` section. +# If you use Home Assistant, the native API is more lightweight. +# If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. +api: + reboot_timeout: 0s + +# If you don't want to use ESPHome's native API you can use MQTT instead. +# In this case don't forget to remove the 'api:' section. +# mqtt: +# broker: !secret mqtt_host +# username: !secret mqtt_username +# password: !secret mqtt_password +# id: mqtt_client + +# Please note that enabling this component will take up a lot of memory and may decrease +# stability and be the cause of reboot depending on the capabilities of the board used. +#web_server: +# port: 80 +# log: false +# ota: false + +# +--------------------------------------+ +# | Packages | +# +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + +packages: + device_base: !include packages/base/device_base.yaml + + device_board: !include + file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml + vars: + yambms_id: 'yambms1' + canbus_id: 'canbus1' + display_auto_next_page_interval: '5s' + + shunt1: !include + file: packages/shunt/shunt_fake.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # Shunt vars + shunt_id: '1' # must be a number + shunt_name: 'Shunt 1' + shunt_update_interval: '3s' + shunt_combine_interval: '1s' + # Shunt sensors values + shunt_voltage: '53.41' # V + shunt_current: '37.5' # A + shunt_power: '2003' # W + shunt_soc: '86' # % + + bms1: !include + file: packages/bms/bms_FAKE.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # BMS vars + bms_id: '1' # must be a number + bms_name: 'BMS 1' + bms_update_interval: '3s' + bms_combine_interval: '1s' + # BMS sensors values + bms_battery_capacity: '280' # Ah + bms_battery_capacity_remaining: '243' # Ah + bms_voltage: '53.45' # V + bms_current: '9.2' # A + bms_power: '492' # W + bms_soc: '87' # % + bms_min_cell_voltage: '3.339' # V + bms_min_voltage_cell: '2' # cell number 1~16 + bms_max_cell_voltage: '3.341' # V + bms_max_voltage_cell: '11' # cell number 1~16 + bms_temperature_sensor_1: '21.1' # °C + bms_temperature_sensor_2: '21.3' # °C + bms_temperature_sensor_3: '21.5' # °C + bms_temperature_sensor_4: '21.7' # °C + bms_max_charge_current: '100' # A + bms_max_discharge_current: '100' # A + 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 + bms_charging_cycles: '178' # charging cycles number Used to calculate the SoH + + bms2: !include + file: packages/bms/bms_FAKE.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # BMS vars + bms_id: '2' # must be a number + bms_name: 'BMS 2' + bms_update_interval: '3s' + bms_combine_interval: '1s' + # BMS sensors values + bms_battery_capacity: '280' # Ah + bms_battery_capacity_remaining: '238' # Ah + bms_voltage: '53.41' # V + bms_current: '11.3' # A + bms_power: '604' # W + bms_soc: '85' # % + bms_min_cell_voltage: '3.337' # V + bms_min_voltage_cell: '14' # cell number 1~16 + bms_max_cell_voltage: '3.339' # V + bms_max_voltage_cell: '3' # cell number 1~16 + bms_temperature_sensor_1: '21.8' # °C + bms_temperature_sensor_2: '21.6' # °C + bms_temperature_sensor_3: '21.4' # °C + bms_temperature_sensor_4: '21.2' # °C + bms_max_charge_current: '100' # A + bms_max_discharge_current: '100' # A + 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 + bms_charging_cycles: '226' # charging cycles number Used to calculate the SoH + + bms3: !include + file: packages/bms/bms_FAKE.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # BMS vars + bms_id: '3' # must be a number + bms_name: 'BMS 3' + bms_update_interval: '3s' + bms_combine_interval: '1s' + # BMS sensors values + bms_battery_capacity: '280' # Ah + bms_battery_capacity_remaining: '232' # Ah + bms_voltage: '53.37' # V + bms_current: '15.7' # A + bms_power: '838' # W + bms_soc: '83' # % + bms_min_cell_voltage: '3.334' # V + bms_min_voltage_cell: '7' # cell number 1~16 + bms_max_cell_voltage: '3.336' # V + bms_max_voltage_cell: '9' # cell number 1~16 + bms_temperature_sensor_1: '21.9' # °C + bms_temperature_sensor_2: '22.0' # °C + bms_temperature_sensor_3: '22.1' # °C + bms_temperature_sensor_4: '22.2' # °C + bms_max_charge_current: '100' # A + bms_max_discharge_current: '100' # A + 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 + bms_charging_cycles: '194' # charging cycles number Used to calculate the SoH + + yambms1: !include + file: packages/yambms/yambms.yaml + vars: + # 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' + + canbus1: !include + file: packages/yambms/yambms_canbus.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' # YamBMS ID to retrieve information from + # CANBUS 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 ) | +# +--------------------------------------+ + + device_debug: !include + file: packages/base/device_debug_ESP32.yaml + vars: + debug_name: 'Debug' + debug_update_interval: '5s' diff --git a/multi-bms_JBD_UART.yaml b/multi-bms_JBD_UART.yaml new file mode 100644 index 0000000..99a78e9 --- /dev/null +++ b/multi-bms_JBD_UART.yaml @@ -0,0 +1,188 @@ +# Updated : 2024.11.11 +# Version : 1.5.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 . + +substitutions: + name: yambms + +# 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 + +logger: + level: INFO # DEBUG / INFO / WARN + +ota: + platform: esphome + +# Please use the native `api` component instead of the `mqtt` section. +# If you use Home Assistant, the native API is more lightweight. +# If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. +api: + reboot_timeout: 0s + +# If you don't want to use ESPHome's native API you can use MQTT instead. +# In this case don't forget to remove the 'api:' section. +# mqtt: +# broker: !secret mqtt_host +# username: !secret mqtt_username +# password: !secret mqtt_password +# id: mqtt_client + +# Please note that enabling this component will take up a lot of memory and may decrease +# stability and be the cause of reboot depending on the capabilities of the board used. +#web_server: +# port: 80 +# log: false +# ota: false + +# +--------------------------------------+ +# | Packages | +# +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + +packages: + device_base: !include packages/base/device_base.yaml + # Board : uncomment your board + device_board: !include packages/board/board_esp32-devkit-v1.yaml + # device_board: !include packages/board/board_esp32-s3-devkitc-1.yaml + # device_board: !include packages/board/board_atom-s3-lite.yaml + + # device_board: !include + # file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml + # vars: + # yambms_id: 'yambms1' + # canbus_id: 'canbus1' + # display_auto_next_page_interval: '5s' + + # shunt1: !include + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml + # vars: + # # YamBMS ID + # yambms_id: 'yambms1' + # # Shunt vars + # shunt_id: '1' # must be a number + # shunt_name: 'Shunt 1' + # shunt_update_interval: '3s' + # shunt_combine_interval: '1s' + # shunt_uart_id: uart_esp_0 + + bms1: !include + file: packages/bms/bms_JBD_UART_full.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # BMS vars + bms_id: '1' # must be a number + bms_name: 'BMS 1' + bms_update_interval: '3s' + bms_combine_interval: '1s' + bms_uart_id: uart_esp_1 + bms_rx_timeout: 150ms + # 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 + + bms2: !include + file: packages/bms/bms_JBD_UART_full.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # BMS vars + bms_id: '2' # must be a number + bms_name: 'BMS 2' + bms_update_interval: '3s' + bms_combine_interval: '1s' + bms_uart_id: uart_esp_2 + bms_rx_timeout: 150ms + # 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 + + yambms1: !include + file: packages/yambms/yambms.yaml + vars: + # 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' + + canbus1: !include + file: packages/yambms/yambms_canbus.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' # YamBMS ID to retrieve information from + # CANBUS 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 ) | +# +--------------------------------------+ + + device_debug: !include + file: packages/base/device_debug_ESP32.yaml + vars: + debug_name: 'Debug' + debug_update_interval: '5s' diff --git a/multi-bms_JK-ALL_BLE.yaml b/multi-bms_JK-ALL_BLE.yaml index 0b8c322..77704d3 100644 --- a/multi-bms_JK-ALL_BLE.yaml +++ b/multi-bms_JK-ALL_BLE.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -43,7 +43,7 @@ ota: # Please use the native `api` component instead of the `mqtt` section. # If you use Home Assistant, the native API is more lightweight. # If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. -# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. api: reboot_timeout: 0s @@ -65,22 +65,30 @@ api: # +--------------------------------------+ # | Packages | # +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + +# Max 3 BLE connections. +# The BLE software stack (Bluedroid) on the ESP32 consumes a significant amount of RAM on the device. +# Crashes are likely to occur if you include too many additional components in your device’s configuration. +# https://esphome.io/components/ble_client.html + packages: + device_base: !include packages/base/device_base.yaml # Board : uncomment your board device_board: !include packages/board/board_esp32-devkit-v1.yaml # device_board: !include packages/board/board_esp32-s3-devkitc-1.yaml # device_board: !include packages/board/board_atom-s3-lite.yaml # device_board: !include - # file: packages/board/board_atom-s3-display.yaml + # file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml # vars: # yambms_id: 'yambms1' # canbus_id: 'canbus1' - - device_base: !include packages/base/device_base.yaml + # display_auto_next_page_interval: '5s' # shunt1: !include - # file: packages/shunt/shunt_victron_smartshunt.yaml # shunt_junctek_khf.yaml + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml # vars: # # YamBMS ID # yambms_id: 'yambms1' @@ -91,11 +99,6 @@ packages: # shunt_combine_interval: '1s' # shunt_uart_id: uart_esp_0 - # Max 3 BLE connections. - # The BLE software stack on the ESP32 consumes a significant amount of RAM on the device. - # Crashes are likely to occur if you include too many additional components in your device’s configuration. - # https://esphome.io/components/ble_client.html - bms1: !include file: packages/bms/bms_JK-ALL_BLE_standard.yaml vars: @@ -156,7 +159,7 @@ packages: file: packages/yambms/yambms_canbus.yaml vars: # YamBMS ID - yambms_id: 'yambms1' + yambms_id: 'yambms1' # YamBMS ID to retrieve information from # CANBUS vars canbus_id: 'canbus1' canbus_name: 'CANBUS 1' @@ -164,7 +167,7 @@ packages: 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: '5' + canbus_link_timer: '5s' # +--------------------------------------+ # | DEBUG ( logger level must be DEBUG ) | diff --git a/multi-bms_JK-B_UART.yaml b/multi-bms_JK-B_UART.yaml index 0d92a06..b649170 100644 --- a/multi-bms_JK-B_UART.yaml +++ b/multi-bms_JK-B_UART.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -32,7 +32,7 @@ substitutions: # dns2: 8.8.4.4 logger: - level: WARN # DEBUG / INFO / WARN + level: INFO # DEBUG / INFO / WARN ota: platform: esphome @@ -40,7 +40,7 @@ ota: # Please use the native `api` component instead of the `mqtt` section. # If you use Home Assistant, the native API is more lightweight. # If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. -# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. api: reboot_timeout: 0s @@ -62,22 +62,25 @@ api: # +--------------------------------------+ # | Packages | # +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + packages: + device_base: !include packages/base/device_base.yaml # Board : uncomment your board device_board: !include packages/board/board_esp32-devkit-v1.yaml # device_board: !include packages/board/board_esp32-s3-devkitc-1.yaml # device_board: !include packages/board/board_atom-s3-lite.yaml # device_board: !include - # file: packages/board/board_atom-s3-display.yaml + # file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml # vars: # yambms_id: 'yambms1' # canbus_id: 'canbus1' - - device_base: !include packages/base/device_base.yaml + # display_auto_next_page_interval: '5s' # shunt1: !include - # file: packages/shunt/shunt_victron_smartshunt.yaml # shunt_junctek_khf.yaml + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml # vars: # # YamBMS ID # yambms_id: 'yambms1' @@ -146,7 +149,7 @@ packages: file: packages/yambms/yambms_canbus.yaml vars: # YamBMS ID - yambms_id: 'yambms1' + yambms_id: 'yambms1' # YamBMS ID to retrieve information from # CANBUS vars canbus_id: 'canbus1' canbus_name: 'CANBUS 1' @@ -154,7 +157,7 @@ packages: 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: '5' + canbus_link_timer: '5s' # +--------------------------------------+ # | DEBUG ( logger level must be DEBUG ) | diff --git a/multi-bms_JK-B_UART_pvbrain2.yaml b/multi-bms_JK-B_UART_pvbrain2.yaml index 460a9e9..eaedb2d 100644 --- a/multi-bms_JK-B_UART_pvbrain2.yaml +++ b/multi-bms_JK-B_UART_pvbrain2.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.17 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/SeByDocKy/pvbrain2 # GitHub : https://github.com/Sleeper85/esphome-yambms @@ -46,7 +46,7 @@ substitutions: # dns2: 8.8.4.4 logger: - level: WARN # DEBUG / INFO / WARN + level: INFO # DEBUG / INFO / WARN ota: platform: esphome @@ -54,7 +54,7 @@ ota: # Please use the native `api` component instead of the `mqtt` section. # If you use Home Assistant, the native API is more lightweight. # If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. -# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. api: reboot_timeout: 0s @@ -77,8 +77,8 @@ api: # | PVbrain2 packages | # +--------------------------------------+ packages: - device_board: !include packages/board/board_pvbrain2.yaml device_base: !include packages/base/device_base.yaml + device_board: !include packages/board/board_pvbrain2.yaml # BUS # bus_i2c0: !include pvbrain2/base/device_bus_i2c0.yaml # SX1509 and BME280/BMP280 @@ -97,10 +97,12 @@ packages: # | YamBMS packages | # +--------------------------------------+ +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + # You don't have to import a shunt but you must import at least one BMS. shunt1: !include - file: packages/shunt/shunt_victron_smartshunt_pvbrain2.yaml # shunt_junctek_khf.yaml + file: packages/shunt/shunt_victron_smartshunt_UART_pvbrain2.yaml # shunt_junctek_khf_UART.yaml vars: # YamBMS ID yambms_id: 'yambms1' @@ -169,7 +171,7 @@ packages: file: packages/yambms/yambms_canbus.yaml vars: # YamBMS ID - yambms_id: 'yambms1' + yambms_id: 'yambms1' # YamBMS ID to retrieve information from # CANBUS vars canbus_id: 'canbus1' canbus_name: 'CANBUS 1' @@ -177,7 +179,7 @@ packages: canbus_light_id: 'led_light_1' # on_board_light_io48 # 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: '5' + canbus_link_timer: '5s' # +--------------------------------------+ # | DEBUG ( logger level must be DEBUG ) | diff --git a/multi-bms_JK-PB_RS485_mode2.yaml b/multi-bms_JK-PB_RS485_mode2.yaml index 31240da..81be61c 100644 --- a/multi-bms_JK-PB_RS485_mode2.yaml +++ b/multi-bms_JK-PB_RS485_mode2.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -32,7 +32,7 @@ substitutions: # dns2: 8.8.4.4 logger: - level: WARN # DEBUG / INFO / WARN + level: INFO # DEBUG / INFO / WARN ota: platform: esphome @@ -40,7 +40,7 @@ ota: # Please use the native `api` component instead of the `mqtt` section. # If you use Home Assistant, the native API is more lightweight. # If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. -# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. api: reboot_timeout: 0s @@ -62,22 +62,25 @@ api: # +--------------------------------------+ # | Packages | # +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + packages: + device_base: !include packages/base/device_base.yaml # Board : uncomment your board # device_board: !include packages/board/board_esp32-devkit-v1.yaml # device_board: !include packages/board/board_esp32-s3-devkitc-1.yaml device_board: !include packages/board/board_atom-s3-lite.yaml # device_board: !include - # file: packages/board/board_atom-s3-display.yaml + # file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml # vars: # yambms_id: 'yambms1' # canbus_id: 'canbus1' - - device_base: !include packages/base/device_base.yaml + # display_auto_next_page_interval: '5s' # shunt1: !include - # file: packages/shunt/shunt_victron_smartshunt.yaml # shunt_junctek_khf.yaml + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml # vars: # # YamBMS ID # yambms_id: 'yambms1' @@ -239,7 +242,7 @@ packages: file: packages/yambms/yambms_canbus.yaml vars: # YamBMS ID - yambms_id: 'yambms1' + yambms_id: 'yambms1' # YamBMS ID to retrieve information from # CANBUS vars canbus_id: 'canbus1' canbus_name: 'CANBUS 1' @@ -247,7 +250,7 @@ packages: 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: '5' + canbus_link_timer: '5s' # +--------------------------------------+ # | DEBUG ( logger level must be DEBUG ) | diff --git a/multi-bms_JK-PB_RS485_mode2_AtomS3.yaml b/multi-bms_JK-PB_RS485_mode2_AtomS3.yaml new file mode 100644 index 0000000..bf1d122 --- /dev/null +++ b/multi-bms_JK-PB_RS485_mode2_AtomS3.yaml @@ -0,0 +1,189 @@ +# Updated : 2024.11.11 +# Version : 1.5.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 . + +substitutions: + name: yambms + +# 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 + +logger: + level: INFO # DEBUG / INFO / WARN + +ota: + platform: esphome + +# Please use the native `api` component instead of the `mqtt` section. +# If you use Home Assistant, the native API is more lightweight. +# If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. +api: + reboot_timeout: 0s + +# If you don't want to use ESPHome's native API you can use MQTT instead. +# In this case don't forget to remove the 'api:' section. +# mqtt: +# broker: !secret mqtt_host +# username: !secret mqtt_username +# password: !secret mqtt_password +# id: mqtt_client + +# Please note that enabling this component will take up a lot of memory and may decrease +# stability and be the cause of reboot depending on the capabilities of the board used. +#web_server: +# port: 80 +# log: false +# ota: false + +# +--------------------------------------+ +# | Packages | +# +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + +packages: + device_base: !include packages/base/device_base.yaml + + device_board: !include + file: packages/board/board_atom-s3.yaml + vars: + yambms_id: 'yambms1' + canbus_id: 'canbus1' + display_auto_next_page_interval: '5s' + + # shunt1: !include + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml + # vars: + # # YamBMS ID + # yambms_id: 'yambms1' + # # Shunt vars + # shunt_id: '1' # must be a number + # shunt_name: 'Shunt 1' + # shunt_update_interval: '3s' + # shunt_combine_interval: '1s' + # shunt_uart_id: uart_esp_0 + + # The sniffer represents the ESP node connected to the JK-BMS PB RS485 bus + # If address 0x00 is not detected on the RS485 bus, the sniffer will act directly as a master BMS (mode 2, max 15 BMS) + + # sniffer1: !include + # file: packages/bms/bms_JK-PB_RS485_sniffer_talk_pin.yaml + # vars: + # sniffer_id: 'sniffer1' + # sniffer_protocol: 'JK02_32S' + # sniffer_uart_id: 'uart_esp_1' + # sniffer_talk_pin: 8 # ESP32: 4, ESP32-S3: 8, ESP32-C3: 10 + + sniffer1: !include + file: packages/bms/bms_JK-PB_RS485_sniffer.yaml + vars: + sniffer_id: 'sniffer1' + sniffer_protocol: 'JK02_32S' + sniffer_uart_id: 'uart_esp_1' + + # Mode2 : configure the DIP switches of your BMS from 0x01 to 0x0F (don't use the 0x00 address, maximum 15 BMS) + bms1: !include + file: packages/bms/bms_JK-PB_RS485_bms_full.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # Sniffer ID + sniffer_id: 'sniffer1' + # BMS vars + bms_id: '1' # must be a number + bms_name: 'JK-BMS 1' + bms_rs485_address: '0x01' # BMS 1 DIP switch + bms_update_interval: '3s' # going below '3s' can cause problems + bms_combine_interval: '1s' + + bms2: !include + file: packages/bms/bms_JK-PB_RS485_bms_full.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # Sniffer ID + sniffer_id: 'sniffer1' + # BMS vars + bms_id: '2' # must be a number + bms_name: 'JK-BMS 2' + bms_rs485_address: '0x02' # BMS 2 DIP switch + bms_update_interval: '3s' # going below '3s' can cause problems + bms_combine_interval: '1s' + + yambms1: !include + file: packages/yambms/yambms.yaml + vars: + # 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' + + canbus1: !include + file: packages/yambms/yambms_canbus.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' # YamBMS ID to retrieve information from + # CANBUS 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 ) | +# +--------------------------------------+ + + device_debug: !include + file: packages/base/device_debug_ESP32.yaml + vars: + debug_name: 'Debug' + debug_update_interval: '5s' diff --git a/multi-bms_JK-PB_RS485_mode2_ETH01-EVO.yaml b/multi-bms_JK-PB_RS485_mode2_ETH01-EVO.yaml index 3ec1321..8ccc71b 100644 --- a/multi-bms_JK-PB_RS485_mode2_ETH01-EVO.yaml +++ b/multi-bms_JK-PB_RS485_mode2_ETH01-EVO.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -30,7 +30,7 @@ substitutions: # dns2: 8.8.4.4 logger: - level: WARN # DEBUG / INFO / WARN + level: INFO # DEBUG / INFO / WARN ota: platform: esphome @@ -38,7 +38,7 @@ ota: # Please use the native `api` component instead of the `mqtt` section. # If you use Home Assistant, the native API is more lightweight. # If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. -# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. api: reboot_timeout: 0s @@ -60,12 +60,15 @@ api: # +--------------------------------------+ # | Packages | # +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + packages: - device_board: !include packages/board/board_esp32-c3-eth01-evo.yaml device_base: !include packages/base/device_base_ethernet.yaml + device_board: !include packages/board/board_esp32-c3-eth01-evo.yaml # shunt1: !include - # file: packages/shunt/shunt_victron_smartshunt.yaml # shunt_junctek_khf.yaml + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml # vars: # # YamBMS ID # yambms_id: 'yambms1' @@ -149,7 +152,7 @@ packages: file: packages/yambms/yambms_canbus.yaml vars: # YamBMS ID - yambms_id: 'yambms1' + yambms_id: 'yambms1' # YamBMS ID to retrieve information from # CANBUS vars canbus_id: 'canbus1' canbus_name: 'CANBUS 1' @@ -157,7 +160,7 @@ packages: 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: '5' + canbus_link_timer: '5s' # +--------------------------------------+ # | DEBUG ( logger level must be DEBUG ) | diff --git a/multi-bms_JK-PB_RS485_mode2_pvbrain2.yaml b/multi-bms_JK-PB_RS485_mode2_pvbrain2.yaml index 27d99ce..16b3617 100644 --- a/multi-bms_JK-PB_RS485_mode2_pvbrain2.yaml +++ b/multi-bms_JK-PB_RS485_mode2_pvbrain2.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.17 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/SeByDocKy/pvbrain2 # GitHub : https://github.com/Sleeper85/esphome-yambms @@ -46,7 +46,7 @@ substitutions: # dns2: 8.8.4.4 logger: - level: WARN # DEBUG / INFO / WARN + level: INFO # DEBUG / INFO / WARN ota: platform: esphome @@ -54,7 +54,7 @@ ota: # Please use the native `api` component instead of the `mqtt` section. # If you use Home Assistant, the native API is more lightweight. # If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. -# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. api: reboot_timeout: 0s @@ -77,8 +77,8 @@ api: # | PVbrain2 packages | # +--------------------------------------+ packages: - device_board: !include packages/board/board_pvbrain2.yaml device_base: !include packages/base/device_base.yaml + device_board: !include packages/board/board_pvbrain2.yaml # BUS # bus_i2c0: !include pvbrain2/base/device_bus_i2c0.yaml # SX1509 and BME280/BMP280 @@ -97,10 +97,12 @@ packages: # | YamBMS packages | # +--------------------------------------+ +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + # You don't have to import a shunt but you must import at least one BMS. shunt1: !include - file: packages/shunt/shunt_victron_smartshunt_pvbrain2.yaml # shunt_junctek_khf.yaml + file: packages/shunt/shunt_victron_smartshunt_UART_pvbrain2.yaml # shunt_junctek_khf_UART.yaml vars: # YamBMS ID yambms_id: 'yambms1' @@ -254,7 +256,7 @@ packages: file: packages/yambms/yambms_canbus.yaml vars: # YamBMS ID - yambms_id: 'yambms1' + yambms_id: 'yambms1' # YamBMS ID to retrieve information from # CANBUS vars canbus_id: 'canbus1' canbus_name: 'CANBUS 1' @@ -262,7 +264,7 @@ packages: canbus_light_id: 'led_light_1' # on_board_light_io48 # 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: '5' + canbus_link_timer: '5s' # +--------------------------------------+ # | DEBUG ( logger level must be DEBUG ) | diff --git a/multi-bms_SEPLOS_V1_V2_RS485.yaml b/multi-bms_SEPLOS_V1_V2_RS485.yaml new file mode 100644 index 0000000..efd1e20 --- /dev/null +++ b/multi-bms_SEPLOS_V1_V2_RS485.yaml @@ -0,0 +1,201 @@ +# Updated : 2024.11.11 +# Version : 1.5.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 . + +substitutions: + name: yambms + +# 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 + +logger: + level: INFO # DEBUG / INFO / WARN + +ota: + platform: esphome + +# Please use the native `api` component instead of the `mqtt` section. +# If you use Home Assistant, the native API is more lightweight. +# If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. +api: + reboot_timeout: 0s + +# If you don't want to use ESPHome's native API you can use MQTT instead. +# In this case don't forget to remove the 'api:' section. +# mqtt: +# broker: !secret mqtt_host +# username: !secret mqtt_username +# password: !secret mqtt_password +# id: mqtt_client + +# Please note that enabling this component will take up a lot of memory and may decrease +# stability and be the cause of reboot depending on the capabilities of the board used. +#web_server: +# port: 80 +# log: false +# ota: false + +# +--------------------------------------+ +# | Packages | +# +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + +packages: + device_base: !include packages/base/device_base.yaml + # Board : uncomment your board + device_board: !include packages/board/board_esp32-devkit-v1.yaml + # device_board: !include packages/board/board_esp32-s3-devkitc-1.yaml + # device_board: !include packages/board/board_atom-s3-lite.yaml + + # device_board: !include + # file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml + # vars: + # yambms_id: 'yambms1' + # canbus_id: 'canbus1' + # display_auto_next_page_interval: '5s' + + # shunt1: !include + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml + # vars: + # # YamBMS ID + # yambms_id: 'yambms1' + # # Shunt vars + # shunt_id: '1' # must be a number + # shunt_name: 'Shunt 1' + # shunt_update_interval: '3s' + # shunt_combine_interval: '1s' + # shunt_uart_id: uart_esp_0 + + seplos_modbus1: !include + file: packages/bms/bms_SEPLOS_V1_V2_RS485_modbus.yaml + vars: + seplos_modbus_id: 'seplos_modbus1' + seplos_modbus_uart_id: 'uart_esp_1' + seplos_modbus_baud_rate: '9600' # Please set the baudrate of your Seplos BMS model here. It's sometimes 19200 baud instead of 9600. + seplos_modbus_rx_timeout: 150ms + + bms1: !include + file: packages/bms/bms_SEPLOS_V1_V2_RS485_bms_full.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # Seplos modbus ID + seplos_modbus_id: 'seplos_modbus1' + # BMS vars + bms_id: '1' # must be a number + bms_name: 'BMS 1' + bms_rs485_address: '0x01' # BMS 1 DIP switch + bms_protocol_version: '0x20' # Known protocol versions: 0x20 (Seplos), 0x26 (Boqiang) + bms_update_interval: '3s' # 10s @syssi example + bms_combine_interval: '1s' + # 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 + + bms2: !include + file: packages/bms/bms_SEPLOS_V1_V2_RS485_bms_full.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' + # Seplos modbus ID + seplos_modbus_id: 'seplos_modbus1' + # BMS vars + bms_id: '2' # must be a number + bms_name: 'BMS 2' + bms_rs485_address: '0x02' # BMS 2 DIP switch + bms_protocol_version: '0x20' # Known protocol versions: 0x20 (Seplos), 0x26 (Boqiang) + bms_update_interval: '3s' # 10s @syssi example + bms_combine_interval: '1s' + bms_uart_id: uart_esp_2 + # 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 + + yambms1: !include + file: packages/yambms/yambms.yaml + vars: + # 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' + + canbus1: !include + file: packages/yambms/yambms_canbus.yaml + vars: + # YamBMS ID + yambms_id: 'yambms1' # YamBMS ID to retrieve information from + # CANBUS 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 ) | +# +--------------------------------------+ + + device_debug: !include + file: packages/base/device_debug_ESP32.yaml + vars: + debug_name: 'Debug' + debug_update_interval: '5s' diff --git a/one-bms_JK-ALL_BLE.yaml b/one-bms_JK-ALL_BLE.yaml index 10b3dc1..7a307c3 100644 --- a/one-bms_JK-ALL_BLE.yaml +++ b/one-bms_JK-ALL_BLE.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -43,7 +43,7 @@ ota: # Please use the native `api` component instead of the `mqtt` section. # If you use Home Assistant, the native API is more lightweight. # If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. -# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. api: reboot_timeout: 0s @@ -65,7 +65,16 @@ api: # +--------------------------------------+ # | Packages | # +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + +# Max 3 BLE connections. +# The BLE software stack (Bluedroid) on the ESP32 consumes a significant amount of RAM on the device. +# Crashes are likely to occur if you include too many additional components in your device’s configuration. +# https://esphome.io/components/ble_client.html + packages: + device_base: !include packages/base/device_base.yaml # Board : uncomment your board device_board: !include packages/board/board_esp32-devkit-v1.yaml # device_board: !include packages/board/board_esp32-s3-devkitc-1.yaml @@ -73,15 +82,14 @@ packages: # device_board: !include packages/board/board_atom-s3-lite.yaml # device_board: !include - # file: packages/board/board_atom-s3-display.yaml + # file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml # vars: # yambms_id: 'yambms1' # canbus_id: 'canbus1' - - device_base: !include packages/base/device_base.yaml + # display_auto_next_page_interval: '5s' # shunt1: !include - # file: packages/shunt/shunt_victron_smartshunt.yaml # shunt_junctek_khf.yaml + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml # vars: # # YamBMS ID # yambms_id: 'yambms1' @@ -92,11 +100,6 @@ packages: # shunt_combine_interval: '1s' # shunt_uart_id: uart_esp_0 - # Max 3 BLE connections. - # The BLE software stack on the ESP32 consumes a significant amount of RAM on the device. - # Crashes are likely to occur if you include too many additional components in your device’s configuration. - # https://esphome.io/components/ble_client.html - bms1: !include file: packages/bms/bms_JK-ALL_BLE_standard.yaml vars: @@ -108,7 +111,7 @@ packages: bms_update_interval: '3s' bms_combine_interval: '1s' bms_ble_protocol_version: JK02_32S # JK02_24S < hardware version 11.0 >= JK02_32S - bms_ble_mac_address: C8:47:8C:10:7E:AA + bms_ble_mac_address: C8:47:80:09:37:ED yambms1: !include file: packages/yambms/yambms.yaml @@ -144,7 +147,7 @@ packages: file: packages/yambms/yambms_canbus.yaml vars: # YamBMS ID - yambms_id: 'yambms1' + yambms_id: 'yambms1' # YamBMS ID to retrieve information from # CANBUS vars canbus_id: 'canbus1' canbus_name: 'CANBUS 1' @@ -152,7 +155,7 @@ packages: 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: '5' + canbus_link_timer: '5s' # +--------------------------------------+ # | DEBUG ( logger level must be DEBUG ) | diff --git a/one-bms_JK-B_UART.yaml b/one-bms_JK-B_UART.yaml index 4bb6170..dfc096d 100644 --- a/one-bms_JK-B_UART.yaml +++ b/one-bms_JK-B_UART.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -32,7 +32,7 @@ substitutions: # dns2: 8.8.4.4 logger: - level: WARN # DEBUG / INFO / WARN + level: INFO # DEBUG / INFO / WARN ota: platform: esphome @@ -40,7 +40,7 @@ ota: # Please use the native `api` component instead of the `mqtt` section. # If you use Home Assistant, the native API is more lightweight. # If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. -# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. api: reboot_timeout: 0s @@ -62,7 +62,11 @@ api: # +--------------------------------------+ # | Packages | # +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + packages: + device_base: !include packages/base/device_base.yaml # Board : uncomment your board device_board: !include packages/board/board_esp32-devkit-v1.yaml # device_board: !include packages/board/board_esp32-s3-devkitc-1.yaml @@ -70,15 +74,14 @@ packages: # device_board: !include packages/board/board_atom-s3-lite.yaml # device_board: !include - # file: packages/board/board_atom-s3-display.yaml + # file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml # vars: # yambms_id: 'yambms1' # canbus_id: 'canbus1' - - device_base: !include packages/base/device_base.yaml + # display_auto_next_page_interval: '5s' # shunt1: !include - # file: packages/shunt/shunt_victron_smartshunt.yaml # shunt_junctek_khf.yaml + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml # vars: # # YamBMS ID # yambms_id: 'yambms1' @@ -135,7 +138,7 @@ packages: file: packages/yambms/yambms_canbus.yaml vars: # YamBMS ID - yambms_id: 'yambms1' + yambms_id: 'yambms1' # YamBMS ID to retrieve information from # CANBUS vars canbus_id: 'canbus1' canbus_name: 'CANBUS 1' @@ -143,7 +146,7 @@ packages: 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: '5' + canbus_link_timer: '5s' # +--------------------------------------+ # | DEBUG ( logger level must be DEBUG ) | diff --git a/one-bms_JK-PB_RS485_mode2.yaml b/one-bms_JK-PB_RS485_mode2.yaml index e03a666..9e09935 100644 --- a/one-bms_JK-PB_RS485_mode2.yaml +++ b/one-bms_JK-PB_RS485_mode2.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -32,7 +32,7 @@ substitutions: # dns2: 8.8.4.4 logger: - level: WARN # DEBUG / INFO / WARN + level: INFO # DEBUG / INFO / WARN ota: platform: esphome @@ -40,7 +40,7 @@ ota: # Please use the native `api` component instead of the `mqtt` section. # If you use Home Assistant, the native API is more lightweight. # If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. -# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. api: reboot_timeout: 0s @@ -62,22 +62,25 @@ api: # +--------------------------------------+ # | Packages | # +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + packages: + device_base: !include packages/base/device_base.yaml # Board : uncomment your board # device_board: !include packages/board/board_esp32-devkit-v1.yaml # device_board: !include packages/board/board_esp32-s3-devkitc-1.yaml device_board: !include packages/board/board_atom-s3-lite.yaml # device_board: !include - # file: packages/board/board_atom-s3-display.yaml + # file: packages/board/board_atom-s3.yaml # board_atom-s3r.yaml # vars: # yambms_id: 'yambms1' # canbus_id: 'canbus1' - - device_base: !include packages/base/device_base.yaml + # display_auto_next_page_interval: '5s' # shunt1: !include - # file: packages/shunt/shunt_victron_smartshunt.yaml # shunt_junctek_khf.yaml + # file: packages/shunt/shunt_victron_smartshunt_UART.yaml # shunt_junctek_khf_UART.yaml # vars: # # YamBMS ID # yambms_id: 'yambms1' @@ -155,7 +158,7 @@ packages: file: packages/yambms/yambms_canbus.yaml vars: # YamBMS ID - yambms_id: 'yambms1' + yambms_id: 'yambms1' # YamBMS ID to retrieve information from # CANBUS vars canbus_id: 'canbus1' canbus_name: 'CANBUS 1' @@ -163,7 +166,7 @@ packages: 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: '5' + canbus_link_timer: '5s' # +--------------------------------------+ # | DEBUG ( logger level must be DEBUG ) | diff --git a/packages/base/device_base.yaml b/packages/base/device_base.yaml index c431983..92ff529 100644 --- a/packages/base/device_base.yaml +++ b/packages/base/device_base.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -18,7 +18,7 @@ # along with this program. If not, see . substitutions: - yambms_version: "1.4.5" + yambms_version: "1.5.1" esphome: name: ${name} diff --git a/packages/base/device_base_ethernet.yaml b/packages/base/device_base_ethernet.yaml index e496a78..1a5c6a0 100644 --- a/packages/base/device_base_ethernet.yaml +++ b/packages/base/device_base_ethernet.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -18,7 +18,7 @@ # along with this program. If not, see . substitutions: - yambms_version: "1.4.5" + yambms_version: "1.5.1" esphome: name: ${name} diff --git a/packages/bms/bms_FAKE.yaml b/packages/bms/bms_FAKE.yaml new file mode 100644 index 0000000..3aa4eb2 --- /dev/null +++ b/packages/bms/bms_FAKE.yaml @@ -0,0 +1,344 @@ +# Updated : 2024.11.11 +# 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 . + +substitutions: + bms_model: "Fake BMS" + bms_protocol: "DEMO" + +packages: + bms_combine: !include bms_combine.yaml + bms_temperature_sensor: !include bms_temperature_sensor_4.yaml + +sensor: + # battery_capacity + - platform: template + id: bms${bms_id}_battery_capacity + name: "${name} ${bms_name} Battery Capacity" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + unit_of_measurement: Ah + device_class: energy_storage + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${bms_battery_capacity}; + + # capacity_remaining_ah + - platform: template + id: bms${bms_id}_capacity_remaining_ah + name: "${name} ${bms_name} Capacity Remaining" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + unit_of_measurement: Ah + device_class: energy_storage + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${bms_battery_capacity_remaining}; + + # total_voltage + - platform: template + id: bms${bms_id}_total_voltage + name: "${name} ${bms_name} Total Voltage" + update_interval: ${bms_update_interval} + accuracy_decimals: 2 + unit_of_measurement: V + device_class: voltage + filters: + - or: + - throttle: 10s + - delta: 0.01 + lambda: return ${bms_voltage}; + + # current + - platform: template + id: bms${bms_id}_current + name: "${name} ${bms_name} Current" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: A + device_class: current + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: return ${bms_current}; + + # power + - platform: template + id: bms${bms_id}_power + name: "${name} ${bms_name} Power" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + unit_of_measurement: W + device_class: power + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${bms_power}; + + # state_of_charge + - platform: template + id: bms${bms_id}_state_of_charge + name: "${name} ${bms_name} SoC" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + unit_of_measurement: '%' + device_class: battery + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${bms_soc}; + + # min_voltage_cell + - platform: template + id: bms${bms_id}_min_voltage_cell + name: "${name} ${bms_name} Min Voltage Cell" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${bms_min_voltage_cell}; + + # max_voltage_cell + - platform: template + id: bms${bms_id}_max_voltage_cell + name: "${name} ${bms_name} Max Voltage Cell" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${bms_max_voltage_cell}; + + # min_cell_voltage + - platform: template + id: bms${bms_id}_min_cell_voltage + name: "${name} ${bms_name} Min Cell 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_min_cell_voltage}; + + # max_cell_voltage + - platform: template + id: bms${bms_id}_max_cell_voltage + name: "${name} ${bms_name} Max Cell 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_max_cell_voltage}; + + # temperature_sensor_1 + - platform: template + id: bms${bms_id}_temperature_sensor_1 + name: "${name} ${bms_name} Temperature Sensor 1" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: return ${bms_temperature_sensor_1}; + + # temperature_sensor_2 + - platform: template + id: bms${bms_id}_temperature_sensor_2 + name: "${name} ${bms_name} Temperature Sensor 2" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: return ${bms_temperature_sensor_2}; + + # temperature_sensor_3 + - platform: template + id: bms${bms_id}_temperature_sensor_3 + name: "${name} ${bms_name} Temperature Sensor 3" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: return ${bms_temperature_sensor_3}; + + # temperature_sensor_4 + - platform: template + id: bms${bms_id}_temperature_sensor_4 + name: "${name} ${bms_name} Temperature Sensor 4" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: return ${bms_temperature_sensor_4}; + + # 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}; + + # charging_cycles + - platform: template + id: bms${bms_id}_charging_cycles + name: "${name} ${bms_name} charging cycles" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:counter + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${bms_charging_cycles}; + +number: + # errors_bitmask (16bits) + - platform: template + id: bms${bms_id}_errors_bitmask + name: "${name} ${bms_name} errors bitmask" + step: 1 + min_value: 0 + max_value: 65535 + restore_value: true + initial_value: 0 # 0~65535 (16bits) 0=NoAlarm + icon: mdi:alert-circle-outline + optimistic: true + entity_category: config + +switch: + # online_status + - platform: template + id: bms${bms_id}_online_status + name: "${name} ${bms_name} online status" + restore_mode: RESTORE_DEFAULT_ON + optimistic: true + # bms_switch_charging + - platform: template + id: bms${bms_id}_charging_allowed + name: "${name} ${bms_name} charge switch" + restore_mode: RESTORE_DEFAULT_ON + optimistic: true + # bms_switch_discharging + - platform: template + id: bms${bms_id}_discharging_allowed + name: "${name} ${bms_name} discharge switch" + restore_mode: RESTORE_DEFAULT_ON + optimistic: true + # bms_switch_balancing + - platform: template + id: bms${bms_id}_equalizing + name: "${name} ${bms_name} balance switch" + restore_mode: RESTORE_DEFAULT_OFF + optimistic: true diff --git a/packages/bms/bms_JBD_UART_full.yaml b/packages/bms/bms_JBD_UART_full.yaml new file mode 100644 index 0000000..8688335 --- /dev/null +++ b/packages/bms/bms_JBD_UART_full.yaml @@ -0,0 +1,311 @@ +# Updated : 2024.11.11 +# 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 . + +substitutions: + bms_model: "JBD" + bms_protocol: "UART" + +packages: + bms_base: !include bms_base.yaml + bms_combine: !include bms_combine.yaml + bms_temperature_sensor: !include bms_temperature_sensor_6.yaml + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + +external_components: + - source: github://syssi/esphome-jbd-bms@main + refresh: 0s + +uart: + - id: !extend ${bms_uart_id} + baud_rate: 9600 + +jbd_bms: + - id: jbd_bms${bms_id} + uart_id: ${bms_uart_id} + update_interval: ${bms_update_interval} + rx_timeout: ${bms_rx_timeout} + +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + +button: + - platform: jbd_bms + jbd_bms_id: jbd_bms${bms_id} + retrieve_hardware_version: + name: "${name} ${bms_name} retrieve hardware version" + +binary_sensor: + - platform: jbd_bms + jbd_bms_id: jbd_bms${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 + jbd_bms_id: jbd_bms${bms_id} + charging: + name: "${name} ${bms_name} Charge switch" + discharging: + name: "${name} ${bms_name} Discharge switch" + +sensor: + - platform: jbd_bms + jbd_bms_id: jbd_bms${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: + name: "${name} ${bms_name} average cell voltage" + 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 01" + cell_voltage_2: + name: "${name} ${bms_name} cell voltage 02" + cell_voltage_3: + name: "${name} ${bms_name} cell voltage 03" + cell_voltage_4: + name: "${name} ${bms_name} cell voltage 04" + cell_voltage_5: + name: "${name} ${bms_name} cell voltage 05" + cell_voltage_6: + name: "${name} ${bms_name} cell voltage 06" + cell_voltage_7: + name: "${name} ${bms_name} cell voltage 07" + cell_voltage_8: + name: "${name} ${bms_name} cell voltage 08" + cell_voltage_9: + 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_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: + 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}; + # FAKE errors_bitmask + # JBD errors_bitmask does not match the format used by JK + # Alarm management is not supported at this time + # Internal : only specifying an id without a name will implicitly set this to true. + - platform: template + id: bms${bms_id}_errors_bitmask + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:alert-circle-outline + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return 0; + +text_sensor: + - platform: jbd_bms + jbd_bms_id: jbd_bms${bms_id} + errors: + name: "${name} ${bms_name} errors" + operation_status: + name: "${name} ${bms_name} operation status" + device_model: + name: "${name} ${bms_name} device model" diff --git a/packages/bms/bms_JK-ALL_BLE_V14_full.yaml b/packages/bms/bms_JK-ALL_BLE_V14_full.yaml index 0e04f0b..8797614 100644 --- a/packages/bms/bms_JK-ALL_BLE_V14_full.yaml +++ b/packages/bms/bms_JK-ALL_BLE_V14_full.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/syssi/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,10 +24,7 @@ substitutions: packages: bms_base: !include bms_base.yaml bms_combine: !include bms_combine.yaml - -external_components: - - source: github://syssi/esphome-jk-bms@main - refresh: 0s + bms_temperature_sensor: !include bms_temperature_sensor_2.yaml ota: on_begin: @@ -36,9 +33,13 @@ ota: - logger.log: "BLE shutdown for flashing" # +--------------------------------------+ -# | JK-BMS BLE connection | +# | Component settings | # +--------------------------------------+ +external_components: + - source: github://syssi/esphome-jk-bms@main + refresh: 0s + esp32_ble_tracker: scan_parameters: active: false @@ -57,43 +58,44 @@ esp32_ble_tracker: ble_client: - mac_address: ${bms_ble_mac_address} - id: client_bms${bms_id} + id: ble_client${bms_id} jk_bms_ble: - - ble_client_id: client_bms${bms_id} + - ble_client_id: ble_client${bms_id} protocol_version: ${bms_ble_protocol_version} throttle: ${bms_update_interval} - id: bms${bms_id} + id: jk_bms_ble${bms_id} # +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ binary_sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_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: - name: "${name} ${bms_name} Online Status" + id: bms${bms_id}_online_status + name: "${name} ${bms_name} online status" # Commits 2024.01.27 : Expose heating status/current (ALL) heating: name: "${name} ${bms_name} heating" -switch: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} charging: - id: bms${bms_id}_switch_charging name: "${name} ${bms_name} Charge switch" discharging: - id: bms${bms_id}_switch_discharging name: "${name} ${bms_name} Discharge switch" balancer: - id: bms${bms_id}_switch_balancing name: "${name} ${bms_name} Balance switch" # Commits 2024.01.20 : Add new switch entities of firmware version 14 (from V11) heating: @@ -109,14 +111,14 @@ switch: # +--------------------------------------+ - platform: ble_client - ble_client_id: client_bms${bms_id} + ble_client_id: ble_client${bms_id} id: bms${bms_id}_enable_bluetooth_connection name: "${name} ${bms_name} Enable Bluetooth connection" # +--------------------------------------+ sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} min_cell_voltage: id: bms${bms_id}_min_cell_voltage name: "${name} ${bms_name} min cell voltage" @@ -318,7 +320,7 @@ sensor: text_sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} errors: name: "${name} ${bms_name} errors" entity_category: diagnostic @@ -328,7 +330,7 @@ text_sensor: number: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} cell_count: id: bms${bms_id}_cell_count name: "${name} ${bms_name} cell count" @@ -414,7 +416,7 @@ number: button: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} retrieve_settings: name: "${name} ${bms_name} retrieve settings" entity_category: config diff --git a/packages/bms/bms_JK-ALL_BLE_full.yaml b/packages/bms/bms_JK-ALL_BLE_full.yaml index a1286e2..62ebef7 100644 --- a/packages/bms/bms_JK-ALL_BLE_full.yaml +++ b/packages/bms/bms_JK-ALL_BLE_full.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/syssi/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,10 +24,7 @@ substitutions: packages: bms_base: !include bms_base.yaml bms_combine: !include bms_combine.yaml - -external_components: - - source: github://syssi/esphome-jk-bms@main - refresh: 0s + bms_temperature_sensor: !include bms_temperature_sensor_2.yaml ota: on_begin: @@ -36,9 +33,13 @@ ota: - logger.log: "BLE shutdown for flashing" # +--------------------------------------+ -# | JK-BMS BLE connection | +# | Component settings | # +--------------------------------------+ +external_components: + - source: github://syssi/esphome-jk-bms@main + refresh: 0s + esp32_ble_tracker: scan_parameters: active: false @@ -57,51 +58,53 @@ esp32_ble_tracker: ble_client: - mac_address: ${bms_ble_mac_address} - id: client_bms${bms_id} + id: ble_client${bms_id} jk_bms_ble: - - ble_client_id: client_bms${bms_id} + - ble_client_id: ble_client${bms_id} protocol_version: ${bms_ble_protocol_version} throttle: ${bms_update_interval} - id: bms${bms_id} + id: jk_bms_ble${bms_id} # +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ binary_sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_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: - name: "${name} ${bms_name} Online Status" + id: bms${bms_id}_online_status + name: "${name} ${bms_name} online status" switch: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} charging: - id: bms${bms_id}_switch_charging name: "${name} ${bms_name} Charge switch" discharging: - id: bms${bms_id}_switch_discharging name: "${name} ${bms_name} Discharge switch" balancer: - id: bms${bms_id}_switch_balancing name: "${name} ${bms_name} Balance switch" # +--------------------------------------+ - platform: ble_client - ble_client_id: client_bms${bms_id} + ble_client_id: ble_client${bms_id} id: bms${bms_id}_enable_bluetooth_connection name: "${name} ${bms_name} Enable Bluetooth connection" # +--------------------------------------+ sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} min_cell_voltage: id: bms${bms_id}_min_cell_voltage name: "${name} ${bms_name} min cell voltage" @@ -287,7 +290,7 @@ sensor: text_sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} errors: name: "${name} ${bms_name} errors" total_runtime_formatted: @@ -296,7 +299,7 @@ text_sensor: number: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} cell_count: id: bms${bms_id}_cell_count name: "${name} ${bms_name} cell count" @@ -337,7 +340,7 @@ number: button: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} retrieve_settings: name: "${name} ${bms_name} retrieve settings" entity_category: config diff --git a/packages/bms/bms_JK-ALL_BLE_minimal.yaml b/packages/bms/bms_JK-ALL_BLE_minimal.yaml index 47ba8af..9bd9270 100644 --- a/packages/bms/bms_JK-ALL_BLE_minimal.yaml +++ b/packages/bms/bms_JK-ALL_BLE_minimal.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/syssi/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,10 +24,7 @@ substitutions: packages: bms_base: !include bms_base.yaml bms_combine: !include bms_combine.yaml - -external_components: - - source: github://syssi/esphome-jk-bms@main - refresh: 0s + bms_temperature_sensor: !include bms_temperature_sensor_2.yaml ota: on_begin: @@ -36,9 +33,13 @@ ota: - logger.log: "BLE shutdown for flashing" # +--------------------------------------+ -# | JK-BMS BLE connection | +# | Component settings | # +--------------------------------------+ +external_components: + - source: github://syssi/esphome-jk-bms@main + refresh: 0s + esp32_ble_tracker: scan_parameters: active: false @@ -57,51 +58,53 @@ esp32_ble_tracker: ble_client: - mac_address: ${bms_ble_mac_address} - id: client_bms${bms_id} + id: ble_client${bms_id} jk_bms_ble: - - ble_client_id: client_bms${bms_id} + - ble_client_id: ble_client${bms_id} protocol_version: ${bms_ble_protocol_version} throttle: ${bms_update_interval} - id: bms${bms_id} + id: jk_bms_ble${bms_id} # +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ binary_sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_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: - name: "${name} ${bms_name} Online Status" + id: bms${bms_id}_online_status + name: "${name} ${bms_name} online status" switch: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} charging: - id: bms${bms_id}_switch_charging name: "${name} ${bms_name} Charge switch" discharging: - id: bms${bms_id}_switch_discharging name: "${name} ${bms_name} Discharge switch" balancer: - id: bms${bms_id}_switch_balancing name: "${name} ${bms_name} Balance switch" # +--------------------------------------+ - platform: ble_client - ble_client_id: client_bms${bms_id} + ble_client_id: ble_client${bms_id} id: bms${bms_id}_enable_bluetooth_connection name: "${name} ${bms_name} Enable Bluetooth connection" # +--------------------------------------+ sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} min_cell_voltage: id: bms${bms_id}_min_cell_voltage name: "${name} ${bms_name} min cell voltage" @@ -165,7 +168,7 @@ sensor: text_sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} errors: name: "${name} ${bms_name} errors" entity_category: diagnostic @@ -175,7 +178,7 @@ text_sensor: number: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} cell_count: id: bms${bms_id}_cell_count name: "${name} ${bms_name} cell count" @@ -208,7 +211,7 @@ number: button: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} retrieve_settings: name: "${name} ${bms_name} retrieve settings" entity_category: config diff --git a/packages/bms/bms_JK-ALL_BLE_standard.yaml b/packages/bms/bms_JK-ALL_BLE_standard.yaml index 0989036..321a431 100644 --- a/packages/bms/bms_JK-ALL_BLE_standard.yaml +++ b/packages/bms/bms_JK-ALL_BLE_standard.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/syssi/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,10 +24,7 @@ substitutions: packages: bms_base: !include bms_base.yaml bms_combine: !include bms_combine.yaml - -external_components: - - source: github://syssi/esphome-jk-bms@main - refresh: 0s + bms_temperature_sensor: !include bms_temperature_sensor_2.yaml ota: on_begin: @@ -36,9 +33,13 @@ ota: - logger.log: "BLE shutdown for flashing" # +--------------------------------------+ -# | JK-BMS BLE connection | +# | Component settings | # +--------------------------------------+ +external_components: + - source: github://syssi/esphome-jk-bms@main + refresh: 0s + esp32_ble_tracker: scan_parameters: active: false @@ -57,51 +58,53 @@ esp32_ble_tracker: ble_client: - mac_address: ${bms_ble_mac_address} - id: client_bms${bms_id} + id: ble_client${bms_id} jk_bms_ble: - - ble_client_id: client_bms${bms_id} + - ble_client_id: ble_client${bms_id} protocol_version: ${bms_ble_protocol_version} throttle: ${bms_update_interval} - id: bms${bms_id} + id: jk_bms_ble${bms_id} # +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ binary_sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_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: - name: "${name} ${bms_name} Online Status" + id: bms${bms_id}_online_status + name: "${name} ${bms_name} online status" switch: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} charging: - id: bms${bms_id}_switch_charging name: "${name} ${bms_name} Charge switch" discharging: - id: bms${bms_id}_switch_discharging name: "${name} ${bms_name} Discharge switch" balancer: - id: bms${bms_id}_switch_balancing name: "${name} ${bms_name} Balance switch" # +--------------------------------------+ - platform: ble_client - ble_client_id: client_bms${bms_id} + ble_client_id: ble_client${bms_id} id: bms${bms_id}_enable_bluetooth_connection name: "${name} ${bms_name} Enable Bluetooth connection" # +--------------------------------------+ sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} min_cell_voltage: id: bms${bms_id}_min_cell_voltage name: "${name} ${bms_name} min cell voltage" @@ -245,7 +248,7 @@ sensor: text_sensor: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} errors: name: "${name} ${bms_name} errors" entity_category: diagnostic @@ -255,7 +258,7 @@ text_sensor: number: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} cell_count: id: bms${bms_id}_cell_count name: "${name} ${bms_name} cell count" @@ -285,10 +288,27 @@ number: balance_trigger_voltage: id: bms${bms_id}_balance_trigger_voltage name: "${name} ${bms_name} balance trigger voltage" + # Added 2024.11.11 + charge_overtemperature_protection: + name: "${name} ${bms_name} charge overtemperature protection" + charge_overtemperature_protection_recovery: + name: "${name} ${bms_name} charge overtemperature protection recovery" + discharge_overtemperature_protection: + name: "${name} ${bms_name} discharge overtemperature protection" + discharge_overtemperature_protection_recovery: + name: "${name} ${bms_name} discharge overtemperature protection recovery" + charge_undertemperature_protection: + name: "${name} ${bms_name} charge undertemperature protection" + charge_undertemperature_protection_recovery: + name: "${name} ${bms_name} charge undertemperature protection recovery" + power_tube_overtemperature_protection: + name: "${name} ${bms_name} power tube overtemperature protection" + power_tube_overtemperature_protection_recovery: + name: "${name} ${bms_name} power tube overtemperature protection recovery" button: - platform: jk_bms_ble - jk_bms_ble_id: bms${bms_id} + jk_bms_ble_id: jk_bms_ble${bms_id} retrieve_settings: name: "${name} ${bms_name} retrieve settings" entity_category: config diff --git a/packages/bms/bms_JK-B_RS485_DISPLAY_full.yaml b/packages/bms/bms_JK-B_RS485_DISPLAY_full.yaml new file mode 100644 index 0000000..6fc054d --- /dev/null +++ b/packages/bms/bms_JK-B_RS485_DISPLAY_full.yaml @@ -0,0 +1,351 @@ +# Updated : 2024.11.11 +# 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 . + +substitutions: + bms_model: "JK-B" + bms_protocol: "DISPLAY" + +packages: + bms_base: !include bms_base.yaml + bms_combine: !include bms_combine.yaml + bms_temperature_sensor: !include bms_temperature_sensor_2.yaml + +# +--------------------------------------+ +# | DISPLAY port schematic | +# +--------------------------------------+ + +# JK-B2A8S20P + +# │ JK-B2A8S20P │ +# │ │ +# │ Temp CAN GPS Display Balancer │ +# └──[oooo]──[ooo]──[oooo]──[oooooo]──[oooooooooo]──┘ +# ││││││ +# │││││└─ K- +# ││││└── K+ +# │││└─── GND ( not common with B- , isolated ? ) +# ││└──── B +# │└───── A +# └────── VCC = +/- 11.5V + +# JK-BD6A2xS10P, JK-BxA24SxxP + +# │ JK-BD6A2xS10P, JK-BxA24SxxP │ +# │ │ +# │ CAN GPS Display Heat │ +# └────[ooo]─[oooo]───[oooooo]───[ooooooo]──────────┘ +# ││││││ +# │││││└─ VCC ┌───────────────┐ ┌─────────────────┐ +# ││││└── A ────────│A+ GND│────────│GND │ +# │││└─── B ────────│B- RS485 RXD│────────│RX ESP32/ │ +# ││└──── GND │ to TTL TXD│ │TX ESP8266 GND│────── +# │└───── K+ │ module VCC│────────│5V VCC│────── +# └────── K- └───────────────┘ └─────────────────┘ + +# Power Button + +# K- o-------[ 100kΩ ]-----o / +# /---| +# K+ o---------------------o/ + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + +external_components: + - source: github://syssi/esphome-jk-bms@main + refresh: 0s + +uart: + - id: !extend ${bms_uart_id} + baud_rate: 2400 + +jk_bms_display: + - id: jk_bms_display${bms_id} + uart_id: ${bms_uart_id} + +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + +binary_sensor: + - platform: jk_bms_display + jk_bms_display_id: jk_bms_display${bms_id} + system_warning: + name: "${name} ${bms_name} system warning" + balancing_switch: + name: "${name} ${bms_name} balancing switch" + charging: + id: bms${bms_id}_charging_allowed + name: "${name} ${bms_name} charging" + discharging: + id: bms${bms_id}_discharging_allowed + name: "${name} ${bms_name} discharging" + cell_voltage_undervoltage_protection: + name: "${name} ${bms_name} cell voltage undervoltage protection" + cell_voltage_overvoltage_protection: + name: "${name} ${bms_name} cell voltage overvoltage protection" + overcurrent_protection: + name: "${name} ${bms_name} overcurrent protection" + mosfet_overtemperature_protection: + name: "${name} ${bms_name} mosfet overtemperature protection" + battery_temperature_protection: + name: "${name} ${bms_name} battery temperature protection" + short_circuit_protection: + name: "${name} ${bms_name} short circuit protection" + coprocessor_communication_error: + name: "${name} ${bms_name} coprocessor communication error" + balancer_wire_resistance_too_high: + name: "${name} ${bms_name} balancer wire resistance too high" + cell_count_mismatch: + name: "${name} ${bms_name} cell count mismatch" + + # Required sensors cannot be retrieved from BMS + # online_status + - platform: template + id: bms${bms_id}_online_status + name: "${name} ${bms_name} online status" + lambda: |- + if (id(bms${bms_id}_total_voltage).state > 0) + return true; + else + return false; + # equalizing + - platform: template + id: bms${bms_id}_equalizing + name: "${name} ${bms_name} balancing" + lambda: return false; + +sensor: + - platform: jk_bms_display + jk_bms_display_id: jk_bms_display${bms_id} + total_voltage: + id: bms${bms_id}_total_voltage + name: "${name} ${bms_name} total voltage" + 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" + 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" + state_of_charge: + id: bms${bms_id}_state_of_charge + name: "${name} ${bms_name} state of charge" + delta_cell_voltage: + name: "${name} ${bms_name} delta cell voltage" + mosfet_temperature: + id: bms${bms_id}_temperature_sensor_1 + name: "${name} ${bms_name} mosfet temperature" + battery_temperature: + id: bms${bms_id}_temperature_sensor_2 + name: "${name} ${bms_name} battery temperature" + average_cell_voltage: + name: "${name} ${bms_name} average cell voltage" + cell_voltage_1: + name: "${name} ${bms_name} cell voltage 01" + cell_voltage_2: + name: "${name} ${bms_name} cell voltage 02" + cell_voltage_3: + name: "${name} ${bms_name} cell voltage 03" + cell_voltage_4: + name: "${name} ${bms_name} cell voltage 04" + cell_voltage_5: + name: "${name} ${bms_name} cell voltage 05" + cell_voltage_6: + name: "${name} ${bms_name} cell voltage 06" + cell_voltage_7: + name: "${name} ${bms_name} cell voltage 07" + cell_voltage_8: + name: "${name} ${bms_name} cell voltage 08" + cell_voltage_9: + 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" + + # Required sensors cannot be retrieved from BMS + # battery_capacity + - platform: template + id: bms${bms_id}_battery_capacity + name: "${name} ${bms_name} Battery Capacity" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + unit_of_measurement: Ah + device_class: energy_storage + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${bms_battery_capacity}; + + # capacity_remaining_ah + - platform: template + id: bms${bms_id}_capacity_remaining_ah + name: "${name} ${bms_name} Capacity Remaining" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + unit_of_measurement: Ah + device_class: energy_storage + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return (id(bms${bms_id}_battery_capacity).state * id(bms${bms_id}_state_of_charge).state / 100); + + # 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 0.005; + + # FAKE charging_cycles + - platform: template + id: bms${bms_id}_charging_cycles + name: "${name} ${bms_name} charging cycles" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:counter + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return 0; + + # FAKE errors_bitmask + # Alarm management is not supported at this time + # Internal : only specifying an id without a name will implicitly set this to true. + - platform: template + id: bms${bms_id}_errors_bitmask + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:alert-circle-outline + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return 0; diff --git a/packages/bms/bms_JK-B_UART_full.yaml b/packages/bms/bms_JK-B_UART_full.yaml index bf12547..2c63c85 100644 --- a/packages/bms/bms_JK-B_UART_full.yaml +++ b/packages/bms/bms_JK-B_UART_full.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/syssi/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,51 +24,64 @@ substitutions: packages: bms_base: !include bms_base.yaml bms_combine: !include bms_combine.yaml + bms_temperature_sensor: !include bms_temperature_sensor_2.yaml + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ external_components: - source: github://syssi/esphome-jk-bms@main refresh: 0s -# +--------------------------------------+ -# | JK-BMS UART connection | -# +--------------------------------------+ - jk_modbus: - - id: modbus_bms${bms_id} + - id: jk_modbus${bms_id} uart_id: ${bms_uart_id} jk_bms: - - id: bms${bms_id} - jk_modbus_id: modbus_bms${bms_id} + - id: jk_bms${bms_id} + jk_modbus_id: jk_modbus${bms_id} update_interval: ${bms_update_interval} # +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ binary_sensor: - platform: jk_bms - jk_bms_id: bms${bms_id} + jk_bms_id: jk_bms${bms_id} balancing: id: bms${bms_id}_equalizing name: "${name} ${bms_name} balancing" balancing_switch: - id: bms${bms_id}_switch_balancing name: "${name} ${bms_name} balancing switch" charging: + id: bms${bms_id}_charging_allowed name: "${name} ${bms_name} charging" charging_switch: - id: bms${bms_id}_switch_charging name: "${name} ${bms_name} charging switch" discharging: + id: bms${bms_id}_discharging_allowed name: "${name} ${bms_name} discharging" discharging_switch: - id: bms${bms_id}_switch_discharging name: "${name} ${bms_name} discharging switch" dedicated_charger_switch: name: "${name} ${bms_name} dedicated charger switch" + # Required sensors cannot be retrieved from BMS + # online_status + - platform: template + id: bms${bms_id}_online_status + name: "${name} ${bms_name} online status" + lambda: |- + if (id(bms${bms_id}_total_voltage).state > 0) + return true; + else + return false; + switch: - platform: jk_bms - jk_bms_id: bms${bms_id} + jk_bms_id: jk_bms${bms_id} charging: name: "${name} ${bms_name} Charge switch" discharging: @@ -77,7 +90,7 @@ switch: sensor: - platform: jk_bms - jk_bms_id: bms${bms_id} + jk_bms_id: jk_bms${bms_id} min_cell_voltage: id: bms${bms_id}_min_cell_voltage name: "${name} ${bms_name} min cell voltage" @@ -307,7 +320,7 @@ sensor: text_sensor: - platform: jk_bms - jk_bms_id: bms${bms_id} + jk_bms_id: jk_bms${bms_id} errors: name: "${name} ${bms_name} errors" entity_category: diagnostic diff --git a/packages/bms/bms_JK-B_UART_minimal.yaml b/packages/bms/bms_JK-B_UART_minimal.yaml index ebbf99b..d9bd903 100644 --- a/packages/bms/bms_JK-B_UART_minimal.yaml +++ b/packages/bms/bms_JK-B_UART_minimal.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/syssi/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,51 +24,53 @@ substitutions: packages: bms_base: !include bms_base.yaml bms_combine: !include bms_combine.yaml + bms_temperature_sensor: !include bms_temperature_sensor_2.yaml + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ external_components: - source: github://syssi/esphome-jk-bms@main refresh: 0s -# +--------------------------------------+ -# | JK-BMS UART connection | -# +--------------------------------------+ - jk_modbus: - - id: modbus_bms${bms_id} + - id: jk_modbus${bms_id} uart_id: ${bms_uart_id} jk_bms: - - id: bms${bms_id} - jk_modbus_id: modbus_bms${bms_id} + - id: jk_bms${bms_id} + jk_modbus_id: jk_modbus${bms_id} update_interval: ${bms_update_interval} # +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ binary_sensor: - platform: jk_bms - jk_bms_id: bms${bms_id} + jk_bms_id: jk_bms${bms_id} balancing: id: bms${bms_id}_equalizing name: "${name} ${bms_name} balancing" balancing_switch: - id: bms${bms_id}_switch_balancing name: "${name} ${bms_name} balancing switch" charging: + id: bms${bms_id}_charging_allowed name: "${name} ${bms_name} charging" charging_switch: - id: bms${bms_id}_switch_charging name: "${name} ${bms_name} charging switch" discharging: + id: bms${bms_id}_discharging_allowed name: "${name} ${bms_name} discharging" discharging_switch: - id: bms${bms_id}_switch_discharging name: "${name} ${bms_name} discharging switch" dedicated_charger_switch: name: "${name} ${bms_name} dedicated charger switch" switch: - platform: jk_bms - jk_bms_id: bms${bms_id} + jk_bms_id: jk_bms${bms_id} charging: name: "${name} ${bms_name} Charge switch" discharging: @@ -77,7 +79,7 @@ switch: sensor: - platform: jk_bms - jk_bms_id: bms${bms_id} + jk_bms_id: jk_bms${bms_id} min_cell_voltage: id: bms${bms_id}_min_cell_voltage name: "${name} ${bms_name} min cell voltage" @@ -207,7 +209,7 @@ sensor: text_sensor: - platform: jk_bms - jk_bms_id: bms${bms_id} + jk_bms_id: jk_bms${bms_id} errors: name: "${name} ${bms_name} errors" entity_category: diagnostic diff --git a/packages/bms/bms_JK-PB_RS485_bms_full.yaml b/packages/bms/bms_JK-PB_RS485_bms_full.yaml index 11b7420..24400eb 100644 --- a/packages/bms/bms_JK-PB_RS485_bms_full.yaml +++ b/packages/bms/bms_JK-PB_RS485_bms_full.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.08.08 -# Version : 1.2.1 +# Updated : 2024.11.11 +# Version : 1.2.2 # GitHub : https://github.com/txubelaxu/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -20,23 +20,30 @@ packages: bms_base: !include bms_base.yaml bms_combine: !include bms_combine.yaml + bms_temperature_sensor: !include bms_temperature_sensor_5.yaml + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ jk_rs485_bms: - - id: bms${bms_id} + - id: jk_rs485_bms${bms_id} rs485_address: ${bms_rs485_address} jk_rs485_sniffer_id: ${sniffer_id} update_interval: ${bms_update_interval} +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + switch: - platform: jk_rs485_bms - jk_rs485_bms_id: bms${bms_id} + jk_rs485_bms_id: jk_rs485_bms${bms_id} precharging: name: "${name} ${bms_name} precharging" charging: - id: bms${bms_id}_switch_charging name: "${name} ${bms_name} charging" discharging: - id: bms${bms_id}_switch_discharging name: "${name} ${bms_name} discharging" balancing: id: bms${bms_id}_switch_balancing @@ -66,17 +73,20 @@ switch: binary_sensor: - platform: jk_rs485_bms - jk_rs485_bms_id: bms${bms_id} + 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" @@ -143,7 +153,7 @@ binary_sensor: sensor: - platform: jk_rs485_bms - jk_rs485_bms_id: bms${bms_id} + jk_rs485_bms_id: jk_rs485_bms${bms_id} balancing_direction: name: "${name} ${bms_name} balancing direction" cell_voltage_min: @@ -354,7 +364,7 @@ sensor: text_sensor: - platform: jk_rs485_bms - jk_rs485_bms_id: bms${bms_id} + jk_rs485_bms_id: jk_rs485_bms${bms_id} errors: name: "${name} ${bms_name} errors" operation_status: @@ -382,10 +392,9 @@ text_sensor: number: - platform: jk_rs485_bms - jk_rs485_bms_id: bms${bms_id} + 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" @@ -412,6 +421,7 @@ number: 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 @@ -421,11 +431,9 @@ number: 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" @@ -461,4 +469,4 @@ number: mos_overtemperature_protection: name: "${name} ${bms_name} mos overtemperature protection" mos_overtemperature_protection_recovery: - name: "${name} ${bms_name} mos overtemperature protection recovery" \ No newline at end of file + name: "${name} ${bms_name} mos overtemperature protection recovery" diff --git a/packages/bms/bms_JK-PB_RS485_bms_minimal.yaml b/packages/bms/bms_JK-PB_RS485_bms_minimal.yaml index 63a5069..4864a31 100644 --- a/packages/bms/bms_JK-PB_RS485_bms_minimal.yaml +++ b/packages/bms/bms_JK-PB_RS485_bms_minimal.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.08.08 -# Version : 1.2.1 +# Updated : 2024.11.11 +# Version : 1.2.2 # GitHub : https://github.com/txubelaxu/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -20,23 +20,30 @@ packages: bms_base: !include bms_base.yaml bms_combine: !include bms_combine.yaml + bms_temperature_sensor: !include bms_temperature_sensor_5.yaml + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ jk_rs485_bms: - - id: bms${bms_id} + - id: jk_rs485_bms${bms_id} rs485_address: ${bms_rs485_address} jk_rs485_sniffer_id: ${sniffer_id} update_interval: ${bms_update_interval} +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + switch: - platform: jk_rs485_bms - jk_rs485_bms_id: bms${bms_id} + jk_rs485_bms_id: jk_rs485_bms${bms_id} precharging: name: "${name} ${bms_name} precharging" charging: - id: bms${bms_id}_switch_charging name: "${name} ${bms_name} charging" discharging: - id: bms${bms_id}_switch_discharging name: "${name} ${bms_name} discharging" balancing: id: bms${bms_id}_switch_balancing @@ -66,24 +73,27 @@ switch: binary_sensor: - platform: jk_rs485_bms - jk_rs485_bms_id: bms${bms_id} + 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: bms${bms_id} + jk_rs485_bms_id: jk_rs485_bms${bms_id} balancing_direction: name: "${name} ${bms_name} balancing direction" cell_voltage_min: @@ -175,7 +185,7 @@ sensor: text_sensor: - platform: jk_rs485_bms - jk_rs485_bms_id: bms${bms_id} + jk_rs485_bms_id: jk_rs485_bms${bms_id} errors: name: "${name} ${bms_name} errors" operation_status: @@ -203,7 +213,7 @@ text_sensor: number: - platform: jk_rs485_bms - jk_rs485_bms_id: bms${bms_id} + 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: @@ -236,6 +246,7 @@ number: 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 diff --git a/packages/bms/bms_JK-PB_RS485_sniffer.yaml b/packages/bms/bms_JK-PB_RS485_sniffer.yaml index 54833ce..1c3afe7 100644 --- a/packages/bms/bms_JK-PB_RS485_sniffer.yaml +++ b/packages/bms/bms_JK-PB_RS485_sniffer.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.4 +# Updated : 2024.11.11 +# Version : 1.2.5 # GitHub : https://github.com/txubelaxu/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -21,20 +21,28 @@ substitutions: bms_model: "JK-PB" bms_protocol: "RS485" +logger: + tx_buffer_size: 1024 + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + external_components: - source: github://txubelaxu/esphome-jk-bms@main refresh: 0s components: [ jk_rs485_sniffer , jk_rs485_bms ] -logger: - tx_buffer_size: 1024 - jk_rs485_sniffer: - id: ${sniffer_id} protocol_version: ${sniffer_protocol} rx_timeout: 500ms uart_id: ${sniffer_uart_id} +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + switch: - platform: template name: ${name} JK-PB RS485 sniffer Broadcast changes to all BMS diff --git a/packages/bms/bms_JK-PB_RS485_sniffer_talk_pin.yaml b/packages/bms/bms_JK-PB_RS485_sniffer_talk_pin.yaml index af52575..3f8bbeb 100644 --- a/packages/bms/bms_JK-PB_RS485_sniffer_talk_pin.yaml +++ b/packages/bms/bms_JK-PB_RS485_sniffer_talk_pin.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.4 +# Updated : 2024.11.11 +# Version : 1.2.5 # GitHub : https://github.com/txubelaxu/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -21,14 +21,18 @@ substitutions: bms_model: "JK-PB" bms_protocol: "RS485" +logger: + tx_buffer_size: 1024 + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + external_components: - source: github://txubelaxu/esphome-jk-bms@main refresh: 0s components: [ jk_rs485_sniffer , jk_rs485_bms ] -logger: - tx_buffer_size: 1024 - jk_rs485_sniffer: - id: ${sniffer_id} protocol_version: ${sniffer_protocol} @@ -36,6 +40,10 @@ jk_rs485_sniffer: uart_id: ${sniffer_uart_id} talk_pin: ${sniffer_talk_pin} +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + switch: - platform: template name: ${name} JK-PB RS485 sniffer Broadcast changes to all BMS diff --git a/packages/bms/bms_SEPLOS_V1_V2_RS485_bms_full.yaml b/packages/bms/bms_SEPLOS_V1_V2_RS485_bms_full.yaml new file mode 100644 index 0000000..e58803c --- /dev/null +++ b/packages/bms/bms_SEPLOS_V1_V2_RS485_bms_full.yaml @@ -0,0 +1,254 @@ +# Updated : 2024.11.11 +# Version : 1.1.1 +# GitHub : https://github.com/syssi/esphome-seplos-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 . + +substitutions: + bms_model: "Seplos V1 V2" + bms_protocol: "RS485" + +packages: + bms_base: !include bms_base.yaml + bms_combine: !include bms_combine.yaml + bms_temperature_sensor: !include bms_temperature_sensor_4.yaml + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + +external_components: + - source: github://syssi/esphome-seplos-bms@main + refresh: 0s + +seplos_bms: + - id: seplos_bms${bms_id} + address: ${bms_rs485_address} + protocol_version: ${bms_protocol_version} + seplos_modbus_id: ${seplos_modbus_id} + update_interval: ${bms_update_interval} + +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + +sensor: + - platform: seplos_bms + seplos_bms_id: seplos_bms${bms_id} + 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" + delta_cell_voltage: + name: "${name} ${bms_name} delta cell voltage" + average_cell_voltage: + name: "${name} ${bms_name} average cell voltage" + cell_voltage_1: + name: "${name} ${bms_name} cell voltage 01" + cell_voltage_2: + name: "${name} ${bms_name} cell voltage 02" + cell_voltage_3: + name: "${name} ${bms_name} cell voltage 03" + cell_voltage_4: + name: "${name} ${bms_name} cell voltage 04" + cell_voltage_5: + name: "${name} ${bms_name} cell voltage 05" + cell_voltage_6: + name: "${name} ${bms_name} cell voltage 06" + cell_voltage_7: + name: "${name} ${bms_name} cell voltage 07" + cell_voltage_8: + name: "${name} ${bms_name} cell voltage 08" + cell_voltage_9: + 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" + 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: + name: "${name} ${bms_name} environment temperature" + temperature_6: + name: "${name} ${bms_name} mosfet temperature" + total_voltage: + id: bms${bms_id}_total_voltage + name: "${name} ${bms_name} total voltage" + 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" + residual_capacity: + id: bms${bms_id}_capacity_remaining_ah + name: "${name} ${bms_name} residual capacity" + battery_capacity: + id: bms${bms_id}_battery_capacity + name: "${name} ${bms_name} battery capacity" + rated_capacity: + name: "${name} ${bms_name} rated capacity" + state_of_charge: + id: bms${bms_id}_state_of_charge + name: "${name} ${bms_name} state of charge" + charging_cycles: + id: bms${bms_id}_charging_cycles + name: "${name} ${bms_name} charging cycles" + state_of_health: + name: "${name} ${bms_name} state of health" + port_voltage: + name: "${name} ${bms_name} port voltage" + # 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}; + # FAKE errors_bitmask + # Alarm management is not supported at this time + # Internal : only specifying an id without a name will implicitly set this to true. + - platform: template + id: bms${bms_id}_errors_bitmask + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:alert-circle-outline + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return 0; + +binary_sensor: + # Required sensors cannot be retrieved from BMS + # Required sensors cannot be retrieved from BMS + # online_status + - platform: template + id: bms${bms_id}_online_status + name: "${name} ${bms_name} online status" + lambda: |- + if (id(bms${bms_id}_total_voltage).state > 0) + return true; + else + return false; + # equalizing + - platform: template + id: bms${bms_id}_equalizing + name: "${name} ${bms_name} balancing" + lambda: return false; + # bms_switch_charging + - platform: template + id: bms${bms_id}_charging_allowed + name: "${name} ${bms_name} charging" + lambda: return true; + # bms_switch_discharging + - platform: template + id: bms${bms_id}_discharging_allowed + name: "${name} ${bms_name} discharging" + lambda: return true; diff --git a/packages/bms/bms_SEPLOS_V1_V2_RS485_modbus.yaml b/packages/bms/bms_SEPLOS_V1_V2_RS485_modbus.yaml new file mode 100644 index 0000000..c09eed5 --- /dev/null +++ b/packages/bms/bms_SEPLOS_V1_V2_RS485_modbus.yaml @@ -0,0 +1,39 @@ +# Updated : 2024.11.11 +# Version : 1.1.1 +# GitHub : https://github.com/syssi/esphome-seplos-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 . + +substitutions: + bms_model: "Seplos V1 V2" + bms_protocol: "RS485" + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + +external_components: + - source: github://syssi/esphome-seplos-bms@main + refresh: 0s + +uart: + - id: !extend ${seplos_modbus_uart_id} + baud_rate: ${seplos_modbus_baud_rate} + +seplos_modbus: + id: ${seplos_modbus_id} + uart_id: ${seplos_modbus_uart_id} + rx_timeout: ${seplos_modbus_rx_timeout} diff --git a/packages/bms/bms_combine.yaml b/packages/bms/bms_combine.yaml index 611219d..946aa97 100644 --- a/packages/bms/bms_combine.yaml +++ b/packages/bms/bms_combine.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.17 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # This YAML is free software: you can redistribute it and/or @@ -38,20 +38,20 @@ binary_sensor: - platform: template name: "${name} ${bms_name} Combine Availability" id: bms${bms_id}_availability - lambda: return (((id(bms${bms_id}_switch_charging).state) || (id(bms${bms_id}_switch_discharging).state)) && (id(bms${bms_id}_errors_bitmask).state == 0)); + lambda: return (id(bms${bms_id}_online_status).state && (id(bms${bms_id}_charging_allowed).state || id(bms${bms_id}_discharging_allowed).state)); # Can be combined (indicated, if the BMS can be combined) - platform: template name: "${name} ${bms_name} Can be combined" id: bms${bms_id}_can_be_combined - lambda: return ((id(bms${bms_id}_availability).state) && (id(bms${bms_id}_switch_combine).state)); + lambda: return (id(bms${bms_id}_availability).state && id(bms${bms_id}_switch_combine).state); # Combine once without conditions esphome: on_boot: then: # Shunt counter (total) - - lambda: id(${yambms_id}_bms_counter) += 1; + - lambda: id(${yambms_id}_var_bms_counter) += 1; interval: - interval: ${bms_combine_interval} @@ -63,20 +63,20 @@ interval: // Combine once only if (id(bms${bms_id}_combined_once) == false) { - id(${yambms_id}_total_installed_battery_capacity) += id(bms${bms_id}_battery_capacity).state; + id(${yambms_id}_var_total_installed_battery_capacity) += id(bms${bms_id}_battery_capacity).state; id(bms${bms_id}_combined_once) = true; } // Combine (not continuously) if (id(bms${bms_id}_combined) == false) { - // Can be combined bms counter - id(${yambms_id}_can_be_combined_bms_counter) += 1; + // To combine bms counter + id(${yambms_id}_var_to_combine_bms_counter) += 1; // TOTAL cell_count - id(${yambms_id}_total_cell_count) += id(bms${bms_id}_cell_count).state; + // id(${yambms_id}_var_total_cell_count) += id(bms${bms_id}_cell_count).state; // TOTAL battery_capacity - id(${yambms_id}_total_battery_capacity) += id(bms${bms_id}_battery_capacity).state; + id(${yambms_id}_var_total_battery_capacity) += id(bms${bms_id}_battery_capacity).state; // Combined id(bms${bms_id}_combined) = true; @@ -85,24 +85,27 @@ interval: // Uncombine (not continuously) else if (id(bms${bms_id}_combined) == true) { - // Can be combined bms counter - id(${yambms_id}_can_be_combined_bms_counter) -= 1; + // To combine bms counter + id(${yambms_id}_var_to_combine_bms_counter) -= 1; // TOTAL cell_count - id(${yambms_id}_total_cell_count) -= id(bms${bms_id}_cell_count).state; + // id(${yambms_id}_var_total_cell_count) -= id(bms${bms_id}_cell_count).state; // TOTAL battery_capacity - id(${yambms_id}_total_battery_capacity) -= id(bms${bms_id}_battery_capacity).state; + id(${yambms_id}_var_total_battery_capacity) -= id(bms${bms_id}_battery_capacity).state; // Uncombined id(bms${bms_id}_combined) = false; } // Combine continuously (all BMS) - if (id(${yambms_id}_processed_bms_counter) < id(${yambms_id}_bms_counter)) + if (id(${yambms_id}_var_to_combine_bms_number) == ${bms_id}) { - // BMS processed counter - id(${yambms_id}_processed_bms_counter) += 1; + // TOTAL charging_allowed_counter + if (id(bms${bms_id}_charging_allowed).state) id(${yambms_id}_var_charging_allowed_counter) += 1; + + // TOTAL discharging_allowed_counter + if (id(bms${bms_id}_discharging_allowed).state) id(${yambms_id}_var_discharging_allowed_counter) += 1; // +-----------------------------------------------+ // | Errors bitmask (16bit) | @@ -110,109 +113,90 @@ interval: if (id(bms${bms_id}_errors_bitmask).state > 1) { - uint16_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state; // errors_bitmask (16bit) - id(${yambms_id}_var_errors_bitmask_alarm) |= bms_errors_bitmask; // Alarm - OR bitwise - id(${yambms_id}_var_errors_bitmask_warning) |= bms_errors_bitmask; // Warning - OR bitwise - id(${yambms_id}_var_errors_bitmask_counter) += 1; // errors_bitmask_counter + uint16_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state; // errors_bitmask (16bit) + id(${yambms_id}_var_errors_bitmask) |= bms_errors_bitmask; // OR bitwise + id(${yambms_id}_var_errors_bitmask_counter) += 1; // errors_bitmask_counter } // +-----------------------------------------------+ // Combine only if the device is able to be included in combine - else if (id(bms${bms_id}_can_be_combined).state) + if (id(bms${bms_id}_can_be_combined).state) { // TOTAL total_voltage - id(${yambms_id}_bms_total_voltage) += id(bms${bms_id}_total_voltage).state; + id(${yambms_id}_var_bms_total_voltage) += id(bms${bms_id}_total_voltage).state; // TOTAL current - id(${yambms_id}_bms_total_current) += id(bms${bms_id}_current).state; + id(${yambms_id}_var_bms_total_current) += id(bms${bms_id}_current).state; // TOTAL power - id(${yambms_id}_bms_total_power) += id(bms${bms_id}_power).state; + id(${yambms_id}_var_bms_total_power) += id(bms${bms_id}_power).state; // TOTAL max_charge_current - if (id(bms${bms_id}_switch_charging).state) - id(${yambms_id}_total_max_charge_current) += id(bms${bms_id}_max_charge_current).state; + if (id(bms${bms_id}_charging_allowed).state) + id(${yambms_id}_var_total_max_charge_current) += id(bms${bms_id}_max_charge_current).state; // TOTAL max_discharge_current - if (id(bms${bms_id}_switch_discharging).state) - id(${yambms_id}_total_max_discharge_current) += id(bms${bms_id}_max_discharge_current).state; + if (id(bms${bms_id}_discharging_allowed).state) + id(${yambms_id}_var_total_max_discharge_current) += id(bms${bms_id}_max_discharge_current).state; // TOTAL capacity_remaining_ah - id(${yambms_id}_total_capacity_remaining_ah) += id(bms${bms_id}_capacity_remaining_ah).state; + id(${yambms_id}_var_total_capacity_remaining_ah) += id(bms${bms_id}_capacity_remaining_ah).state; // TOTAL soc - id(${yambms_id}_bms_total_soc) += id(bms${bms_id}_state_of_charge).state; + id(${yambms_id}_var_bms_total_soc) += id(bms${bms_id}_state_of_charge).state; // TOTAL charging_cycles - id(${yambms_id}_total_charging_cycles) += id(bms${bms_id}_charging_cycles).state; + id(${yambms_id}_var_total_charging_cycles) += id(bms${bms_id}_charging_cycles).state; // TOTAL equalizing_counter - if (id(bms${bms_id}_equalizing).state) id(${yambms_id}_equalizing_counter) += 1; - - // TOTAL bms_switch_charging_counter - if (id(bms${bms_id}_switch_charging).state) id(${yambms_id}_bms_switch_charging_counter) += 1; - - // TOTAL bms_switch_discharging_counter - if (id(bms${bms_id}_switch_discharging).state) id(${yambms_id}_bms_switch_discharging_counter) += 1; + if (id(bms${bms_id}_equalizing).state) id(${yambms_id}_var_equalizing_counter) += 1; // MIN/MAX values // MAX balance_trigger_voltage - if (id(bms${bms_id}_balance_trigger_voltage).state > id(${yambms_id}_max_balance_trigger_voltage)) - id(${yambms_id}_max_balance_trigger_voltage) = id(bms${bms_id}_balance_trigger_voltage).state; + if (id(bms${bms_id}_balance_trigger_voltage).state > id(${yambms_id}_var_max_balance_trigger_voltage)) + id(${yambms_id}_var_max_balance_trigger_voltage) = id(bms${bms_id}_balance_trigger_voltage).state; // MIN min_cell_voltage // MIN min_voltage_cell (cell number) - if (id(bms${bms_id}_min_cell_voltage).state < id(${yambms_id}_min_min_cell_voltage)) + if (id(bms${bms_id}_min_cell_voltage).state < id(${yambms_id}_var_min_cell_voltage)) { - id(${yambms_id}_min_min_cell_voltage) = id(bms${bms_id}_min_cell_voltage).state; - id(${yambms_id}_min_min_voltage_cell) = id(bms${bms_id}_min_voltage_cell).state + (${bms_id} * 100); + id(${yambms_id}_var_min_cell_voltage) = id(bms${bms_id}_min_cell_voltage).state; + id(${yambms_id}_var_min_voltage_cell) = id(bms${bms_id}_min_voltage_cell).state + (${bms_id} * 100); } // MAX max_cell_voltage // MAX max_voltage_cell (cell number) - if (id(bms${bms_id}_max_cell_voltage).state > id(${yambms_id}_max_max_cell_voltage)) + if (id(bms${bms_id}_max_cell_voltage).state > id(${yambms_id}_var_max_cell_voltage)) { - id(${yambms_id}_max_max_cell_voltage) = id(bms${bms_id}_max_cell_voltage).state; - id(${yambms_id}_max_max_voltage_cell) = id(bms${bms_id}_max_voltage_cell).state + (${bms_id} * 100); + id(${yambms_id}_var_max_cell_voltage) = id(bms${bms_id}_max_cell_voltage).state; + id(${yambms_id}_var_max_voltage_cell) = id(bms${bms_id}_max_voltage_cell).state + (${bms_id} * 100); } // MIN cell_ovp - if (id(bms${bms_id}_cell_ovp).state < id(${yambms_id}_min_cell_ovp)) - id(${yambms_id}_min_cell_ovp) = id(bms${bms_id}_cell_ovp).state; - - // MIN cell_ovpr - if (id(bms${bms_id}_cell_ovpr).state < id(${yambms_id}_min_cell_ovpr)) - id(${yambms_id}_min_cell_ovpr) = id(bms${bms_id}_cell_ovpr).state; - - // MAX cell_uvpr - if (id(bms${bms_id}_cell_uvpr).state > id(${yambms_id}_max_cell_uvpr)) - id(${yambms_id}_max_cell_uvpr) = id(bms${bms_id}_cell_uvpr).state; + if (id(bms${bms_id}_cell_ovp).state < id(${yambms_id}_var_min_cell_ovp)) + id(${yambms_id}_var_min_cell_ovp) = id(bms${bms_id}_cell_ovp).state; + + // MAX cell_uvp + if (id(bms${bms_id}_cell_uvp).state > id(${yambms_id}_var_max_cell_uvp)) + id(${yambms_id}_var_max_cell_uvp) = id(bms${bms_id}_cell_uvp).state; // MIN temperature // MIN temperature_sensor - if (id(bms${bms_id}_temperature_sensor_1).state < id(${yambms_id}_var_min_temperature)) - { - id(${yambms_id}_var_min_temperature) = id(bms${bms_id}_temperature_sensor_1).state; - id(${yambms_id}_var_min_temperature_sensor) = (1 + ${bms_id} * 100); - } - if (id(bms${bms_id}_temperature_sensor_2).state < id(${yambms_id}_var_min_temperature)) + if (id(bms${bms_id}_min_temperature).state < id(${yambms_id}_var_min_temperature)) { - id(${yambms_id}_var_min_temperature) = id(bms${bms_id}_temperature_sensor_2).state; - id(${yambms_id}_var_min_temperature_sensor) = (2 + ${bms_id} * 100); + id(${yambms_id}_var_min_temperature) = id(bms${bms_id}_min_temperature).state; + id(${yambms_id}_var_min_temperature_sensor) = id(bms${bms_id}_min_temperature_sensor).state; } // MAX temperature // MAX temperature_sensor - if (id(bms${bms_id}_temperature_sensor_1).state > id(${yambms_id}_var_max_temperature)) - { - id(${yambms_id}_var_max_temperature) = id(bms${bms_id}_temperature_sensor_1).state; - id(${yambms_id}_var_max_temperature_sensor) = (1 + ${bms_id} * 100); - } - if (id(bms${bms_id}_temperature_sensor_2).state > id(${yambms_id}_var_max_temperature)) + if (id(bms${bms_id}_max_temperature).state > id(${yambms_id}_var_max_temperature)) { - id(${yambms_id}_var_max_temperature) = id(bms${bms_id}_temperature_sensor_2).state; - id(${yambms_id}_var_max_temperature_sensor) = (2 + ${bms_id} * 100); + id(${yambms_id}_var_max_temperature) = id(bms${bms_id}_max_temperature).state; + id(${yambms_id}_var_max_temperature_sensor) = id(bms${bms_id}_max_temperature_sensor).state; } } + // To combine BMS number + id(${yambms_id}_var_to_combine_bms_number)++; } diff --git a/packages/bms/bms_temperature_sensor_2.yaml b/packages/bms/bms_temperature_sensor_2.yaml new file mode 100644 index 0000000..b5d6027 --- /dev/null +++ b/packages/bms/bms_temperature_sensor_2.yaml @@ -0,0 +1,93 @@ +# Updated : 2024.11.11 +# 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 . + + sensor: + # MIN temperature + - platform: template + id: bms${bms_id}_min_temperature + name: "${name} ${bms_name} min temperature" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: |- + // MIN temperature + // MIN temperature_sensor + float min_temperature = id(bms${bms_id}_temperature_sensor_1).state; + int min_temperature_sensor = (1 + ${bms_id} * 100); + if (id(bms${bms_id}_temperature_sensor_2).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_2).state; + min_temperature_sensor = (2 + ${bms_id} * 100); + } + id(bms${bms_id}_min_temperature_sensor).publish_state(min_temperature_sensor); + return min_temperature; + + # MIN temperature sensor + - platform: template + id: bms${bms_id}_min_temperature_sensor + name: "${name} ${bms_name} min temperature sensor" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 + + # MAX temperature + - platform: template + id: bms${bms_id}_max_temperature + name: "${name} ${bms_name} max temperature" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: |- + // MAX temperature + // MAX temperature_sensor + float max_temperature = id(bms${bms_id}_temperature_sensor_1).state; + int max_temperature_sensor = (1 + ${bms_id} * 100); + if (id(bms${bms_id}_temperature_sensor_2).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_2).state; + max_temperature_sensor = (2 + ${bms_id} * 100); + } + id(bms${bms_id}_max_temperature_sensor).publish_state(max_temperature_sensor); + return max_temperature; + + # MAX temperature sensor + - platform: template + id: bms${bms_id}_max_temperature_sensor + name: "${name} ${bms_name} max temperature sensor" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 diff --git a/packages/bms/bms_temperature_sensor_4.yaml b/packages/bms/bms_temperature_sensor_4.yaml new file mode 100644 index 0000000..f111a1c --- /dev/null +++ b/packages/bms/bms_temperature_sensor_4.yaml @@ -0,0 +1,113 @@ +# Updated : 2024.11.11 +# 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 . + + sensor: + # MIN temperature + - platform: template + id: bms${bms_id}_min_temperature + name: "${name} ${bms_name} min temperature" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: |- + // MIN temperature + // MIN temperature_sensor + float min_temperature = id(bms${bms_id}_temperature_sensor_1).state; + int min_temperature_sensor = (1 + ${bms_id} * 100); + if (id(bms${bms_id}_temperature_sensor_2).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_2).state; + min_temperature_sensor = (2 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_3).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_3).state; + min_temperature_sensor = (3 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_4).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_4).state; + min_temperature_sensor = (4 + ${bms_id} * 100); + } + id(bms${bms_id}_min_temperature_sensor).publish_state(min_temperature_sensor); + return min_temperature; + + # MIN temperature sensor + - platform: template + id: bms${bms_id}_min_temperature_sensor + name: "${name} ${bms_name} min temperature sensor" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 + + # MAX temperature + - platform: template + id: bms${bms_id}_max_temperature + name: "${name} ${bms_name} max temperature" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: |- + // MAX temperature + // MAX temperature_sensor + float max_temperature = id(bms${bms_id}_temperature_sensor_1).state; + int max_temperature_sensor = (1 + ${bms_id} * 100); + if (id(bms${bms_id}_temperature_sensor_2).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_2).state; + max_temperature_sensor = (2 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_3).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_3).state; + max_temperature_sensor = (3 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_4).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_4).state; + max_temperature_sensor = (4 + ${bms_id} * 100); + } + id(bms${bms_id}_max_temperature_sensor).publish_state(max_temperature_sensor); + return max_temperature; + + # MAX temperature sensor + - platform: template + id: bms${bms_id}_max_temperature_sensor + name: "${name} ${bms_name} max temperature sensor" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 diff --git a/packages/bms/bms_temperature_sensor_5.yaml b/packages/bms/bms_temperature_sensor_5.yaml new file mode 100644 index 0000000..c1e0769 --- /dev/null +++ b/packages/bms/bms_temperature_sensor_5.yaml @@ -0,0 +1,123 @@ +# Updated : 2024.11.11 +# 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 . + + sensor: + # MIN temperature + - platform: template + id: bms${bms_id}_min_temperature + name: "${name} ${bms_name} min temperature" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: |- + // MIN temperature + // MIN temperature_sensor + float min_temperature = id(bms${bms_id}_temperature_sensor_1).state; + int min_temperature_sensor = (1 + ${bms_id} * 100); + if (id(bms${bms_id}_temperature_sensor_2).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_2).state; + min_temperature_sensor = (2 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_3).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_3).state; + min_temperature_sensor = (3 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_4).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_4).state; + min_temperature_sensor = (4 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_5).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_5).state; + min_temperature_sensor = (5 + ${bms_id} * 100); + } + id(bms${bms_id}_min_temperature_sensor).publish_state(min_temperature_sensor); + return min_temperature; + + # MIN temperature sensor + - platform: template + id: bms${bms_id}_min_temperature_sensor + name: "${name} ${bms_name} min temperature sensor" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 + + # MAX temperature + - platform: template + id: bms${bms_id}_max_temperature + name: "${name} ${bms_name} max temperature" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: |- + // MAX temperature + // MAX temperature_sensor + float max_temperature = id(bms${bms_id}_temperature_sensor_1).state; + int max_temperature_sensor = (1 + ${bms_id} * 100); + if (id(bms${bms_id}_temperature_sensor_2).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_2).state; + max_temperature_sensor = (2 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_3).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_3).state; + max_temperature_sensor = (3 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_4).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_4).state; + max_temperature_sensor = (4 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_5).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_5).state; + max_temperature_sensor = (5 + ${bms_id} * 100); + } + id(bms${bms_id}_max_temperature_sensor).publish_state(max_temperature_sensor); + return max_temperature; + + # MAX temperature sensor + - platform: template + id: bms${bms_id}_max_temperature_sensor + name: "${name} ${bms_name} max temperature sensor" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 diff --git a/packages/bms/bms_temperature_sensor_6.yaml b/packages/bms/bms_temperature_sensor_6.yaml new file mode 100644 index 0000000..0bb2e0e --- /dev/null +++ b/packages/bms/bms_temperature_sensor_6.yaml @@ -0,0 +1,133 @@ +# Updated : 2024.11.11 +# 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 . + + sensor: + # MIN temperature + - platform: template + id: bms${bms_id}_min_temperature + name: "${name} ${bms_name} min temperature" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: |- + // MIN temperature + // MIN temperature_sensor + float min_temperature = id(bms${bms_id}_temperature_sensor_1).state; + int min_temperature_sensor = (1 + ${bms_id} * 100); + if (id(bms${bms_id}_temperature_sensor_2).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_2).state; + min_temperature_sensor = (2 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_3).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_3).state; + min_temperature_sensor = (3 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_4).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_4).state; + min_temperature_sensor = (4 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_5).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_5).state; + min_temperature_sensor = (5 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_6).state < min_temperature) + { + min_temperature = id(bms${bms_id}_temperature_sensor_6).state; + min_temperature_sensor = (6 + ${bms_id} * 100); + } + id(bms${bms_id}_min_temperature_sensor).publish_state(min_temperature_sensor); + return min_temperature; + + # MIN temperature sensor + - platform: template + id: bms${bms_id}_min_temperature_sensor + name: "${name} ${bms_name} min temperature sensor" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 + + # MAX temperature + - platform: template + id: bms${bms_id}_max_temperature + name: "${name} ${bms_name} max temperature" + update_interval: ${bms_update_interval} + accuracy_decimals: 1 + unit_of_measurement: °C + device_class: temperature + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: |- + // MAX temperature + // MAX temperature_sensor + float max_temperature = id(bms${bms_id}_temperature_sensor_1).state; + int max_temperature_sensor = (1 + ${bms_id} * 100); + if (id(bms${bms_id}_temperature_sensor_2).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_2).state; + max_temperature_sensor = (2 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_3).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_3).state; + max_temperature_sensor = (3 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_4).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_4).state; + max_temperature_sensor = (4 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_5).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_5).state; + max_temperature_sensor = (5 + ${bms_id} * 100); + } + if (id(bms${bms_id}_temperature_sensor_6).state > max_temperature) + { + max_temperature = id(bms${bms_id}_temperature_sensor_6).state; + max_temperature_sensor = (6 + ${bms_id} * 100); + } + id(bms${bms_id}_max_temperature_sensor).publish_state(max_temperature_sensor); + return max_temperature; + + # MAX temperature sensor + - platform: template + id: bms${bms_id}_max_temperature_sensor + name: "${name} ${bms_name} max temperature sensor" + update_interval: ${bms_update_interval} + accuracy_decimals: 0 + icon: mdi:numeric + filters: + - or: + - throttle: 10s + - delta: 1 diff --git a/packages/board/board_atom-lite.yaml b/packages/board/board_atom-lite.yaml index dd69950..63f19a0 100644 --- a/packages/board/board_atom-lite.yaml +++ b/packages/board/board_atom-lite.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -68,13 +68,13 @@ canbus: light: # https://esphome.io/components/light/esp32_rmt_led_strip + # ESP Light used to see the inverter heartbeat + # Internal : only specifying an id without a name will implicitly set this to true. - platform: esp32_rmt_led_strip id: esp_light - name: ${name} ESP Light rgb_order: GRB pin: 27 num_leds: 1 rmt_channel: 0 chipset: ws2812 entity_category: config - internal: true diff --git a/packages/board/board_atom-matrix.yaml b/packages/board/board_atom-matrix.yaml index 83ece8e..cf25209 100644 --- a/packages/board/board_atom-matrix.yaml +++ b/packages/board/board_atom-matrix.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -68,13 +68,13 @@ canbus: light: # https://esphome.io/components/light/esp32_rmt_led_strip + # ESP Light used to see the inverter heartbeat + # Internal : only specifying an id without a name will implicitly set this to true. - platform: esp32_rmt_led_strip id: esp_light - name: ${name} ESP Light rgb_order: GRB pin: 27 num_leds: 1 rmt_channel: 0 chipset: ws2812 entity_category: config - internal: true diff --git a/packages/board/board_atom-s3-lite.yaml b/packages/board/board_atom-s3-lite.yaml index d68960e..8933e85 100644 --- a/packages/board/board_atom-s3-lite.yaml +++ b/packages/board/board_atom-s3-lite.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -87,13 +87,13 @@ canbus: light: # https://esphome.io/components/light/esp32_rmt_led_strip + # ESP Light used to see the inverter heartbeat + # Internal : only specifying an id without a name will implicitly set this to true. - platform: esp32_rmt_led_strip id: esp_light - name: ${name} ESP Light rgb_order: GRB pin: 35 num_leds: 1 rmt_channel: 0 chipset: ws2812 entity_category: config - internal: true diff --git a/packages/board/board_atom-s3.yaml b/packages/board/board_atom-s3.yaml new file mode 100644 index 0000000..635610b --- /dev/null +++ b/packages/board/board_atom-s3.yaml @@ -0,0 +1,283 @@ +# Updated : 2024.11.11 +# Version : 1.2.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 . + +substitutions: + board_chip: "ESP32-S3" + board_name: "Atom S3" + # web_server_sorting_group: '666' + +# From platform-espressif32 6.1.0 + # https://github.com/espressif/esp-idf/releases + # https://github.com/platformio/platform-espressif32/releases +# esp32: + # board: m5stack-atoms3 + # variant: esp32s3 + +# Atom S3 - SKU:C123 +# https://docs.m5stack.com/en/core/AtomS3 +esp32: + board: esp32-s3-devkitc-1 + variant: esp32s3 + framework: + type: esp-idf + +esphome: + platformio_options: + board_build.flash_mode: dio # Standard uses a single line for data, Dual IO uses 2 lines for data (prevent reboot loop) + +wifi: + id: my_network + ssid: !secret wifi_ssid + password: !secret wifi_password + domain: !secret domain + ap: + ssid: "YamBMS Fallback Hotspot" + password: "Y4mBM$85" + +captive_portal: + +logger: + hardware_uart: USB_SERIAL_JTAG + +uart: + # UART 1 + - id: uart_esp_1 + tx_pin: 2 + rx_pin: 1 + baud_rate: 115200 + rx_buffer_size: 512 + # UART 2 + # - id: uart_esp_2 + # tx_pin: 8 + # rx_pin: 7 + # baud_rate: 115200 + # rx_buffer_size: 512 + +canbus: + # CANBUS NODE 1 + - platform: esp32_can + id: canbus_node1 + tx_pin: 5 + rx_pin: 6 + 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 + +# +--------------------------------------+ +# | Atom S3 related configuration | +# +--------------------------------------+ + # LCD 0.85" + # GPIO15 CS + # GPIO16 BL + # GPIO17 SCK + # GPIO21 MOSI + # GPIO33 RS + # GPIO34 LCD-RST + # GPIO4 IR + # GPIO41 BUTTON + +packages: + display: !include board_display_128x128.yaml + +spi: + - id: atom_spi_bus + clk_pin: GPIO17 + mosi_pin: GPIO21 + +fan: + # Backlight Control Platform + - platform: speed + id: backlight + output: backlight_out + name: "${name} ${board_name} Backlight control" + # web_server: + # sorting_weight: ${web_server_sorting_group}00 + # sorting_group_id: group_${web_server_sorting_group} + restore_mode: RESTORE_DEFAULT_ON + icon: mdi:brightness-6 + +output: + # Backlight Output Hardware + - platform: ledc + id: backlight_out + pin: + number: GPIO16 + # allow_other_uses: true + # inverted: true + frequency: 120Hz + channel: 1 + max_power: 1.00 + min_power: 0.10 + zero_means_zero: true + # Inverter Heartbeat 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 + +binary_sensor: + # Atom S3 Button + - platform: gpio + id: atom_button + pin: + number: GPIO41 + inverted: true + mode: + input: true + pullup: true + filters: + - delayed_off: 10ms + on_press: + then: + - lambda: ESP_LOGI("Atom S3 Button", "Pressed"); + - lambda: |- + // On press -> make sure set==ON & bri==100% + if ((id(backlight).speed != 100) || (id(backlight).state != true)) + { + auto call = id(backlight).turn_on(); + call.set_speed(100); + call.perform(); + } + // if autodim enabled, execute script + if (id(backlight_autodim_time).state > 0) + { + id(backlight_autodim).execute(); + } + - display.page.show_next: my_display + #- display.page.show_previous: my_display + +display: + # Atom S3 display see https://esphome.io/components/display/ili9xxx.html + - platform: ili9xxx + id: my_display + spi_id: atom_spi_bus + model: M5STACK # M5STACK / ST7789V + cs_pin: GPIO15 + dc_pin: GPIO33 + reset_pin: GPIO34 + dimensions: + height: 128 + width: 128 + offset_height: 1 + offset_width: 2 + invert_colors: true + # rotation: 180 # use transform instead! https://esphome.io/components/display/ili9xxx.html + +number: + # Backlight max Level + - platform: template + id: backlight_max_power + name: "${name} ${board_name} Backlight max Level" + # web_server: + # sorting_weight: ${web_server_sorting_group}05 + # sorting_group_id: group_${web_server_sorting_group} + icon: mdi:brightness-7 + optimistic: true + min_value: 0 + max_value: 100 + step: 1 + initial_value: 75 + restore_value: true + mode: box + unit_of_measurement: "%" + on_value: + then: + - lambda: |- + int speed = id(backlight).speed; // get actual level + id(backlight_out).set_max_power(x / 100); // set max_power + auto call = id(backlight).turn_on(); // reset level + call.set_speed(speed); + call.perform(); + update_interval: 10s + + # Backlight Auto-Dim time + - platform: template + id: backlight_autodim_time + name: "${name} ${board_name} Backlight Auto-Dim Time in min." + # web_server: + # sorting_weight: ${web_server_sorting_group}20 + # sorting_group_id: group_${web_server_sorting_group} + icon: mdi:brightness-auto + optimistic: true + min_value: 0 + max_value: 10 + step: 0.1 + initial_value: 0.2 + restore_value: true + mode: box + unit_of_measurement: "min" + update_interval: never #5s + + # Backlight Auto-Dim Level + - platform: template + id: backlight_autodim_level + name: "${name} ${board_name} Backlight Auto-Dim Level" + # web_server: + # sorting_weight: ${web_server_sorting_group}15 + # sorting_group_id: group_${web_server_sorting_group} + icon: mdi:brightness-4 + optimistic: true + min_value: 0 + max_value: 100 + step: 1 + initial_value: 25 + restore_value: true + mode: box + unit_of_measurement: "%" + update_interval: never #5s + +script: + # Backlight Auto-Dimming Script + - id: backlight_autodim + mode: restart + then: + - delay: !lambda return id(backlight_autodim_time).state * 60 * 1000; // delay (x min * 60s * 1000ms) + - lambda: |- # Handle Dimlevel + int speed = id(backlight_autodim_level).state; // get desired dimlevel + if (speed == 0) // if dimmlevel = 0 + { + auto call = id(backlight).turn_off(); // turn off backlight + call.perform(); + } + else + { + auto call = id(backlight).turn_on(); // set dimlevel + call.set_speed(speed); + call.perform(); + } + +# web_server v3 needs to be added and sorting_groups must be defined to use grouping +# web_server: + # version: 3 + # sorting_groups: + # - id: group_666 + # name: "${board_name} Backlight Control" + # sorting_weight: -10000 diff --git a/packages/board/board_atom-s3r.yaml b/packages/board/board_atom-s3r.yaml new file mode 100644 index 0000000..c224fb5 --- /dev/null +++ b/packages/board/board_atom-s3r.yaml @@ -0,0 +1,183 @@ +# Updated : 2024.11.11 +# Version : 1.2.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 . + +substitutions: + board_chip: "ESP32-S3" + board_name: "Atom S3R" + +esp32: + board: esp32-s3-devkitc-1 + variant: esp32s3 + flash_size: 8MB # ajust according to your ESP32-S3 version + framework: + type: esp-idf + +esphome: + platformio_options: + board_build.flash_mode: dio # Standard uses a single line for data, Dual IO uses 2 lines for data (prevent reboot loop) + board_upload.maximum_ram_size: 524288 # Total Size of the internal RAM in bits. It's the same for all ESP32-S3 ( 512KB ) + on_boot: + then: + - output.turn_on: + id: white + +# PSRAM activation and settings +psram: + mode: octal + speed: 80MHz + +<<: !include board_psram_settings.yaml + +external_components: + # Backlight + - source: + type: git + url: https://github.com/ssieb/esphome + ref: lp5562 + components: [ lp5562 ] + refresh: 1min + +wifi: + id: my_network + ssid: !secret wifi_ssid + password: !secret wifi_password + domain: !secret domain + ap: + ssid: "YamBMS Fallback Hotspot" + password: "Y4mBM$85" + +captive_portal: + +logger: + hardware_uart: USB_SERIAL_JTAG + +uart: + # UART 0 : USB UART port used for ESP32 flashing and logs, can be released if necessary (tx_pin: 43, rx_pin: 44) + # UART 1 + - id: uart_esp_1 + tx_pin: 2 + rx_pin: 1 + baud_rate: 115200 + rx_buffer_size: 512 + # UART 2 + # - id: uart_esp_2 + # tx_pin: 8 + # rx_pin: 7 + # baud_rate: 115200 + # rx_buffer_size: 512 + +canbus: + # CANBUS NODE 1 + - platform: esp32_can + id: canbus_node1 + tx_pin: 5 + rx_pin: 6 + 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 + +# +--------------------------------------+ +# | Atom S3R related configuration | +# +--------------------------------------+ + +packages: + display: !include board_display_128x128.yaml + +spi: + - id: atom_spi_bus + clk_pin: 15 + mosi_pin: 21 + +i2c: + - id: atom_i2c_bus + sda: 45 + scl: 0 + scan: true + +lp5562: + - i2c_id: atom_i2c_bus + +output: + # Backlight Output + - platform: lp5562 + id: red + channel: 0 + - platform: lp5562 + id: green + channel: 1 + - platform: lp5562 + id: blue + channel: 2 + - platform: lp5562 + id: white + channel: 3 + # Inverter Heartbeat 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 + +binary_sensor: + # Atom S3R Button + - platform: gpio + id: atom_button + pin: + number: 41 + inverted: true + mode: + input: true + pullup: true + filters: + - delayed_off: 10ms + on_press: + then: + - logger.log: Button Pressed + - display.page.show_next: my_display + #- display.page.show_previous: my_display + +display: + # Atom S3R display + # https://esphome.io/components/display/st7789v.html + - platform: st7789v + spi_id: atom_spi_bus + id: my_display + model: Custom + cs_pin: 14 + dc_pin: 42 + reset_pin: 48 + height: 128 + width: 128 + offset_height: 2 + offset_width: 1 + eightbitcolor: true + update_interval: 1s + data_rate: 40Mhz + # rotation: 180 # use transform instead! https://esphome.io/components/display/ili9xxx.html diff --git a/packages/board/board_atom-s3-display.yaml b/packages/board/board_display_128x128.yaml similarity index 61% rename from packages/board/board_atom-s3-display.yaml rename to packages/board/board_display_128x128.yaml index cb1d0cc..98f0a6d 100644 --- a/packages/board/board_atom-s3-display.yaml +++ b/packages/board/board_display_128x128.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,106 +17,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -substitutions: - board_chip: "ESP32-S3" - board_name: "Atom S3" - -# From platform-espressif32 6.1.0 -# https://github.com/espressif/esp-idf/releases -# https://github.com/platformio/platform-espressif32/releases -# esp32: -# board: m5stack-atoms3 -# variant: esp32s3 - -# Atom S3 - SKU:C123 -# https://docs.m5stack.com/en/core/AtomS3 -esp32: - board: esp32-s3-devkitc-1 - variant: esp32s3 - framework: - type: esp-idf - -esphome: - platformio_options: - board_build.flash_mode: dio # Standard uses a single line for data, Dual IO uses 2 lines for data (prevent reboot loop) - on_boot: - then: - - lambda: |- - id(disp).enable(); - id(disp).transfer_byte(0x11); - id(disp).disable(); - -wifi: - id: my_network - ssid: !secret wifi_ssid - password: !secret wifi_password - domain: !secret domain - ap: - ssid: "YamBMS Fallback Hotspot" - password: "Y4mBM$85" - -captive_portal: - -logger: - hardware_uart: USB_SERIAL_JTAG - -uart: - # UART 1 - - id: uart_esp_1 - tx_pin: 2 - rx_pin: 1 - baud_rate: 115200 - rx_buffer_size: 512 - # UART 2 - # - id: uart_esp_2 - # tx_pin: 8 - # rx_pin: 7 - # baud_rate: 115200 - # rx_buffer_size: 512 - -canbus: - # CANBUS NODE 1 - - platform: esp32_can - id: canbus_node1 - tx_pin: 5 - rx_pin: 6 - can_id: 1 - bit_rate: 500kbps - -output: - # ESP LED - - platform: gpio - pin: 4 - id: esp_led - inverted: true - -light: - # ESP Light - - platform: binary - output: esp_led - id: esp_light - name: "${name} On board light" - internal: true - # +--------------------------------------+ -# | Display settings | +# | Display Related | # +--------------------------------------+ -# LCD 0.85" -# GPIO15 CS -# GPIO16 BL -# GPIO17 SCK -# GPIO21 MOSI -# GPIO33 RS -# GPIO34 LCD-RST -# GPIO4 IR -# GPIO41 BUTTON - -spi: - clk_pin: GPIO17 - mosi_pin: GPIO21 - color: + - id: my_black + hex: "000000" - id: my_red red: 100% green: 0% @@ -137,6 +44,12 @@ color: red: 50% green: 50% blue: 50% + - id: my_white + red: 100% + green: 100% + blue: 100% + - id: my_pink + hex: ff00ff font: - file: "gfonts://Roboto" @@ -152,59 +65,20 @@ font: id: roboto_18 size: 18 -binary_sensor: - - platform: gpio - name: Atom S3 Button - pin: - number: GPIO41 - inverted: true - mode: - input: true - pullup: true - filters: - - delayed_off: 10ms - on_press: - then: - - logger.log: Button Pressed - - display.page.show_next: disp - #- display.page.show_previous: disp +# Auto next page interval +interval: + - interval: ${display_auto_next_page_interval} + startup_delay: 5s + then: + - display.page.show_next: my_display + - component.update: my_display # +--------------------------------------+ # | Display Handling | # +--------------------------------------+ display: - # https://esphome.io/components/display/st7789v.html - - platform: st7789v - id: disp - model: Custom - backlight_pin: GPIO16 - cs_pin: GPIO15 - dc_pin: GPIO33 - reset_pin: GPIO34 - height: 128 - width: 128 - offset_height: 2 - offset_width: 1 - eightbitcolor: true - update_interval: 2s - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height(), id(my_blue)); - it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue)); // header bar - - if (id(esp32_online_status).state) { - it.print(115, 5, id(roboto_12), id(my_green), TextAlign::TOP_RIGHT, "ESP OK"); - } - else { - it.print(115, 5, id(roboto_12), id(my_red), TextAlign::TOP_RIGHT, "ESP KO"); - } - - if (id(${canbus_id}_status).state) { - it.print(0, 5, id(roboto_12), id(my_green), TextAlign::TOP_LEFT, "CAN OK"); - } - else { - it.print(0, 5, id(roboto_12), id(my_red), TextAlign::TOP_LEFT, "CAN KO"); - } - + # Atom S3 display see https://esphome.io/components/display/ili9xxx.html + - id: !extend my_display pages: - id: page1 lambda: |- @@ -265,6 +139,5 @@ display: else { it.print(0, 5, id(roboto_12), id(my_red), TextAlign::TOP_LEFT, "CAN KO"); } - it.print((128 / 2), (128 / 3) * 1 + 5, id(roboto_24), id(my_gray), TextAlign::CENTER,"Voltage V"); - it.printf((128 / 2), (128 / 3) * 2 - 5, id(roboto_32), id(my_gray), TextAlign::CENTER, "%.1f", id(${yambms_id}_total_voltage).state); - \ No newline at end of file + it.print((128 / 2), (128 / 3) * 1, id(roboto_24), id(my_gray), TextAlign::CENTER,"Voltage V"); + it.printf((128 / 2), (128 / 3) * 2 - 5, id(roboto_32), id(my_gray), TextAlign::CENTER, "%.1f", id(${yambms_id}_total_voltage).state); \ No newline at end of file diff --git a/packages/board/board_esp32-c3-devkitm-1.yaml b/packages/board/board_esp32-c3-devkitm-1.yaml index 2ea5ecd..c53ee8e 100644 --- a/packages/board/board_esp32-c3-devkitm-1.yaml +++ b/packages/board/board_esp32-c3-devkitm-1.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -23,6 +23,7 @@ substitutions: esp32: board: esp32-c3-devkitm-1 + flash_size: 4MB # ajust according to your ESP32-C3 version framework: type: esp-idf @@ -77,13 +78,13 @@ canbus: light: # https://esphome.io/components/light/esp32_rmt_led_strip + # ESP Light used to see the inverter heartbeat + # Internal : only specifying an id without a name will implicitly set this to true. - platform: esp32_rmt_led_strip id: esp_light - name: ${name} ESP Light rgb_order: GRB pin: 8 num_leds: 1 rmt_channel: 0 chipset: ws2812 entity_category: config - internal: true diff --git a/packages/board/board_esp32-c3-eth01-evo.yaml b/packages/board/board_esp32-c3-eth01-evo.yaml index c8a409e..9da8b23 100644 --- a/packages/board/board_esp32-c3-eth01-evo.yaml +++ b/packages/board/board_esp32-c3-eth01-evo.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,6 +24,7 @@ substitutions: esp32: board: esp32-c3-devkitm-1 variant: esp32c3 + flash_size: 2MB framework: type: esp-idf version: latest @@ -33,8 +34,16 @@ esphome: platformio_options: board_build.flash_mode: dio # Standard uses a single line for data, Dual IO uses 2 lines for data (prevent reboot loop) +# external_components: +# - source: github://pr#6861 +# components: +# - ethernet + external_components: - - source: github://pr#6861 + - source: + type: git + url: https://github.com/esphome/esphome + ref: d5bdf2575c151abfad39b6c24c3856395a7d0901 components: - ethernet @@ -69,17 +78,22 @@ canbus: can_id: 1 bit_rate: 500kbps -output: - # ESP LED - - platform: gpio - pin: 0 - id: esp_led - inverted: true +# +--------------------------------------+ +# | Inverter Heartbeat Light | +# +--------------------------------------+ light: - # ESP 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 - name: "${name} On board light" - internal: true + 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 diff --git a/packages/board/board_esp32-devkit-v1.yaml b/packages/board/board_esp32-devkit-v1.yaml index aabd942..74b7360 100644 --- a/packages/board/board_esp32-devkit-v1.yaml +++ b/packages/board/board_esp32-devkit-v1.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -65,17 +65,20 @@ canbus: can_id: 1 bit_rate: 500kbps -output: - # ESP LED - - platform: gpio - pin: 2 - id: esp_led - inverted: true +# +--------------------------------------+ +# | Inverter Heartbeat Light | +# +--------------------------------------+ light: - # ESP 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 - name: "${name} On board light" - internal: true + +output: + # ESP LED + - platform: gpio + pin: 2 + id: esp_led + inverted: true \ No newline at end of file diff --git a/packages/board/board_esp32-s3-devkitc-1.yaml b/packages/board/board_esp32-s3-devkitc-1.yaml index 2198038..131ddb4 100644 --- a/packages/board/board_esp32-s3-devkitc-1.yaml +++ b/packages/board/board_esp32-s3-devkitc-1.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -87,13 +87,13 @@ canbus: light: # https://esphome.io/components/light/esp32_rmt_led_strip + # ESP Light used to see the inverter heartbeat + # Internal : only specifying an id without a name will implicitly set this to true. - platform: esp32_rmt_led_strip id: esp_light - name: ${name} ESP Light rgb_order: GRB pin: 48 num_leds: 1 rmt_channel: 0 chipset: ws2812 entity_category: config - internal: true \ No newline at end of file diff --git a/packages/board/board_esp32-s3-devkitc-1_mcp2515.yaml b/packages/board/board_esp32-s3-devkitc-1_mcp2515.yaml index 48c2dac..9239558 100644 --- a/packages/board/board_esp32-s3-devkitc-1_mcp2515.yaml +++ b/packages/board/board_esp32-s3-devkitc-1_mcp2515.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.2.3 +# Updated : 2024.11.11 +# Version : 1.2.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -94,13 +94,13 @@ canbus: light: # https://esphome.io/components/light/esp32_rmt_led_strip + # ESP Light used to see the inverter heartbeat + # Internal : only specifying an id without a name will implicitly set this to true. - platform: esp32_rmt_led_strip id: esp_light - name: ${name} ESP Light rgb_order: GRB pin: 48 num_leds: 1 rmt_channel: 0 chipset: ws2812 entity_category: config - internal: true diff --git a/packages/shunt/shunt_combine.yaml b/packages/shunt/shunt_combine.yaml index 0391aae..fc71684 100644 --- a/packages/shunt/shunt_combine.yaml +++ b/packages/shunt/shunt_combine.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.17 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # This YAML is free software: you can redistribute it and/or @@ -47,7 +47,7 @@ esphome: on_boot: then: # Shunt counter (total) - - lambda: id(${yambms_id}_shunt_counter) += 1; + - lambda: id(${yambms_id}_var_shunt_counter) += 1; interval: - interval: ${shunt_combine_interval} @@ -58,11 +58,11 @@ interval: { if (id(shunt${shunt_id}_combined_once) == false) { - // Can be combined shunt counter - id(${yambms_id}_can_be_combined_shunt_counter) += 1; + // To combine shunt counter + id(${yambms_id}_var_to_combine_shunt_counter) += 1; // Shunt use (replace BMS infos) - id(${yambms_id}_shunt_use) = true; + id(${yambms_id}_var_shunt_use) = true; // Combined id(shunt${shunt_id}_combined_once) = true; @@ -71,32 +71,31 @@ interval: // Uncombine once else if (id(shunt${shunt_id}_combined_once) == true) { - // Can be combined shunt counter - id(${yambms_id}_can_be_combined_shunt_counter) -= 1; + // To combine shunt counter + id(${yambms_id}_var_to_combine_shunt_counter) -= 1; // Shunt use (replace BMS infos) - if (id(${yambms_id}_can_be_combined_shunt_counter) == 0) id(${yambms_id}_shunt_use) = false; + if (id(${yambms_id}_var_to_combine_shunt_counter) == 0) id(${yambms_id}_var_shunt_use) = false; // Uncombined id(shunt${shunt_id}_combined_once) = false; } // Combine continuously (all Shunt) - if (id(${yambms_id}_processed_shunt_counter) < id(${yambms_id}_shunt_counter)) + if (id(${yambms_id}_var_to_combine_shunt_number) == ${shunt_id}) { - // Shunt processed counter - id(${yambms_id}_processed_shunt_counter) += 1; - // Combine only if the device is able to be included in combine if (id(shunt${shunt_id}_can_be_combined).state) { // TOTAL voltage - id(${yambms_id}_shunt_total_voltage) += id(shunt${shunt_id}_voltage).state; + id(${yambms_id}_var_shunt_total_voltage) += id(shunt${shunt_id}_voltage).state; // TOTAL current - id(${yambms_id}_shunt_total_current) += id(shunt${shunt_id}_current).state; + id(${yambms_id}_var_shunt_total_current) += id(shunt${shunt_id}_current).state; // TOTAL power - id(${yambms_id}_shunt_total_power) += id(shunt${shunt_id}_power).state; + id(${yambms_id}_var_shunt_total_power) += id(shunt${shunt_id}_power).state; // TOTAL soc - id(${yambms_id}_shunt_total_soc) += id(shunt${shunt_id}_soc).state; + id(${yambms_id}_var_shunt_total_soc) += id(shunt${shunt_id}_soc).state; } + // To combine shunt number + id(${yambms_id}_var_to_combine_shunt_number)++; } diff --git a/packages/shunt/shunt_example.yaml b/packages/shunt/shunt_fake.yaml similarity index 89% rename from packages/shunt/shunt_example.yaml rename to packages/shunt/shunt_fake.yaml index 9011d5d..7d89f77 100644 --- a/packages/shunt/shunt_example.yaml +++ b/packages/shunt/shunt_fake.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.08.08 -# Version : 1.1.1 +# Updated : 2024.11.11 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -22,7 +22,7 @@ packages: shunt_combine: !include shunt_combine.yaml sensor: - # total_voltage MEAN + # total_voltage - platform: template id: shunt${shunt_id}_voltage name: "${name} ${shunt_name} Voltage" @@ -34,9 +34,9 @@ sensor: - or: - throttle: 10s - delta: 0.01 - lambda: return 54.32; + lambda: return ${shunt_voltage}; - # current SUM + # current - platform: template id: shunt${shunt_id}_current name: "${name} ${shunt_name} Current" @@ -48,9 +48,9 @@ sensor: - or: - throttle: 10s - delta: 0.1 - lambda: return 12.3; + lambda: return ${shunt_current}; - # power SUM + # power - platform: template id: shunt${shunt_id}_power name: "${name} ${shunt_name} Power" @@ -62,9 +62,9 @@ sensor: - or: - throttle: 10s - delta: 1 - lambda: return 668; + lambda: return ${shunt_power}; - # state_of_charge MEAN + # state_of_charge - platform: template id: shunt${shunt_id}_soc name: "${name} ${shunt_name} SoC" @@ -76,4 +76,4 @@ sensor: - or: - throttle: 10s - delta: 1 - lambda: return 96; + lambda: return ${shunt_soc}; diff --git a/packages/shunt/shunt_junctek_khf.yaml b/packages/shunt/shunt_junctek_khf_UART.yaml similarity index 90% rename from packages/shunt/shunt_junctek_khf.yaml rename to packages/shunt/shunt_junctek_khf_UART.yaml index e753ac5..985d978 100644 --- a/packages/shunt/shunt_junctek_khf.yaml +++ b/packages/shunt/shunt_junctek_khf_UART.yaml @@ -21,6 +21,10 @@ packages: shunt_base: !include shunt_base.yaml shunt_combine: !include shunt_combine.yaml +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + external_components: - source: github://Sleeper85/esphome-junctek_khf@main refresh: 0s @@ -28,10 +32,11 @@ external_components: # type: local # path: components -# uart: -# - id: !extend ${shunt_uart_id} -# baud_rate: 115200 -# rx_buffer_size: 384 +# UART baud_rate : 115200 + +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ # Platform : # junctek_khf : version with the screen connected (UART and RS485) diff --git a/packages/shunt/shunt_victron_smartshunt_BLE.yaml b/packages/shunt/shunt_victron_smartshunt_BLE.yaml new file mode 100644 index 0000000..980e82f --- /dev/null +++ b/packages/shunt/shunt_victron_smartshunt_BLE.yaml @@ -0,0 +1,106 @@ +# Updated : 2024.11.11 +# Version : 1.1.1 +# GitHub : https://github.com/Fabian-Schmidt/esphome-victron_ble + +# 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 . + +packages: + shunt_base: !include shunt_base.yaml + shunt_combine: !include shunt_combine.yaml + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + +external_components: + - source: github://Fabian-Schmidt/esphome-victron_ble + refresh: 0s + +esp32_ble_tracker: + +victron_ble: + - id: victron_ble${shunt_id} + mac_address: ${shunt_mac_address} + bindkey: ${shunt_encryption_key} + +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + +# A SmartShunt is a Battery monitor. Therefore the following sensor values are available: + +# BATTERY_VOLTAGE in V +# BATTERY_CURRENT in A +# BATTERY_POWER in W +# STATE_OF_CHARGE in % +# CONSUMED_AH in Ah +# AUX_VOLTAGE in V (*) +# MID_VOLTAGE in V (*) +# TEMPERATURE in °C (*) +# TIME_TO_GO in minutes + +# (*) Available if device aux port is configured. + +# The amount of charged and discharged energy is in the field CONSUMED_AH. +# The battery SOC is in the field STATE_OF_CHARGE. + +# These are all available fields transmitted by the Victron Battery Shunt. I cannot add additional fields. + +sensor: + - platform: victron_ble + victron_ble_id: victron_ble${shunt_id} + name: "${name} ${shunt_name} Time remaining" + type: TIME_TO_GO + - platform: victron_ble + victron_ble_id: victron_ble${shunt_id} + id: shunt${shunt_id}_voltage + name: "${name} ${shunt_name} Voltage" + type: BATTERY_VOLTAGE + - platform: victron_ble + victron_ble_id: victron_ble${shunt_id} + id: shunt${shunt_id}_current + name: "${name} ${shunt_name} Current" + type: BATTERY_CURRENT + - platform: victron_ble + victron_ble_id: victron_ble${shunt_id} + id: shunt${shunt_id}_power + name: "${name} ${shunt_name} Power" + type: BATTERY_POWER + - platform: victron_ble + victron_ble_id: victron_ble${shunt_id} + id: shunt${shunt_id}_soc + name: "${name} ${shunt_name} State of Charge" + type: STATE_OF_CHARGE + - platform: victron_ble + victron_ble_id: victron_ble${shunt_id} + name: "${name} ${shunt_name} Consumed Ah" + type: CONSUMED_AH + # - platform: victron_ble + # victron_ble_id: victron_ble${shunt_id} + # name: "${name} ${shunt_name} Starter Battery" # BAUX_VOLTAGE or MID_VOLTAGE or TEMPERATURE, depending on configuration of SmartShunt. + # type: AUX_VOLTAGE + +binary_sensor: + - platform: victron_ble + victron_ble_id: victron_ble${shunt_id} + name: "${name} ${shunt_name} Battery has Alarm" + type: ALARM + +text_sensor: + - platform: victron_ble + victron_ble_id: victron_ble${shunt_id} + name: "${name} ${shunt_name} Battery Alarm reason" + type: ALARM_REASON diff --git a/packages/shunt/shunt_victron_smartshunt_BLE_connect.yaml b/packages/shunt/shunt_victron_smartshunt_BLE_connect.yaml new file mode 100644 index 0000000..b035a0d --- /dev/null +++ b/packages/shunt/shunt_victron_smartshunt_BLE_connect.yaml @@ -0,0 +1,76 @@ +# Updated : 2024.11.11 +# Version : 1.1.1 +# GitHub : https://github.com/Fabian-Schmidt/esphome-victron_ble + +# 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 . + +packages: + shunt_base: !include shunt_base.yaml + shunt_combine: !include shunt_combine.yaml + +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + +external_components: + - source: github://Fabian-Schmidt/esphome-victron_ble + refresh: 0s + +esp32_ble: + io_capability: keyboard_only + +esp32_ble_tracker: + +ble_client: + - mac_address: ${shunt_mac_address} + id: ble_client${shunt_id} + on_passkey_request: + then: + - logger.log: "Authenticating with passkey" + - ble_client.passkey_reply: + id: ble_client${shunt_id} + passkey: ${shunt_ble_passkey} + +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + +sensor: + - platform: victron_ble_connect + ble_client_id: ble_client${shunt_id} + # Notify supports max 7 sensors + notify: true + # If notify is active then on every update_interval sensors are updated. + # If notify is disabled then on every update_interval a new connection to victron is made. + update_interval: ${shunt_update_interval} # 20s + state_of_charge: + id: shunt${shunt_id}_soc + name: "${name} ${shunt_name} State of Charge" + voltage: + id: shunt${shunt_id}_voltage + name: "${name} ${shunt_name} Voltage" + current: + id: shunt${shunt_id}_current + name: "${name} ${shunt_name} Current" + power: + id: shunt${shunt_id}_power + name: "${name} ${shunt_name} Power" + ah: + name: "${name} ${shunt_name} Consumed Ah" + starter_battery_voltage: + name: "${name} ${shunt_name} Starter Battery Voltage" + remaining_time: + name: "${name} ${shunt_name} Remaining Time" diff --git a/packages/shunt/shunt_victron_smartshunt.yaml b/packages/shunt/shunt_victron_smartshunt_UART.yaml similarity index 93% rename from packages/shunt/shunt_victron_smartshunt.yaml rename to packages/shunt/shunt_victron_smartshunt_UART.yaml index 48c382c..23d8ec0 100644 --- a/packages/shunt/shunt_victron_smartshunt.yaml +++ b/packages/shunt/shunt_victron_smartshunt_UART.yaml @@ -21,10 +21,16 @@ packages: shunt_base: !include shunt_base.yaml shunt_combine: !include shunt_combine.yaml +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + external_components: - source: github://KinDR007/VictronMPPT-ESPHOME@main refresh: 0s +# UART baud_rate: 19200 +# UART rx_buffer_size: 256 uart: - id: !extend ${shunt_uart_id} baud_rate: 19200 @@ -35,6 +41,10 @@ victron: id: victron${shunt_id} throttle: ${shunt_update_interval} +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + sensor: - platform: victron victron_id: victron${shunt_id} diff --git a/packages/shunt/shunt_victron_smartshunt_pvbrain2.yaml b/packages/shunt/shunt_victron_smartshunt_UART_pvbrain2.yaml similarity index 93% rename from packages/shunt/shunt_victron_smartshunt_pvbrain2.yaml rename to packages/shunt/shunt_victron_smartshunt_UART_pvbrain2.yaml index cb6fd11..9f3144f 100644 --- a/packages/shunt/shunt_victron_smartshunt_pvbrain2.yaml +++ b/packages/shunt/shunt_victron_smartshunt_UART_pvbrain2.yaml @@ -21,15 +21,26 @@ packages: shunt_base: !include shunt_base.yaml shunt_combine: !include shunt_combine.yaml +# +--------------------------------------+ +# | Component settings | +# +--------------------------------------+ + external_components: - source: github://KinDR007/VictronMPPT-ESPHOME@main refresh: 0s +# UART baud_rate: 19200 +# UART rx_buffer_size: 256 + victron: - uart_id: ${shunt_uart_id} id: victron${shunt_id} throttle: ${shunt_update_interval} +# +--------------------------------------+ +# | Component entities | +# +--------------------------------------+ + sensor: - platform: victron victron_id: victron${shunt_id} diff --git a/packages/yambms/yambms.yaml b/packages/yambms/yambms.yaml index cfcb72f..9b90fee 100644 --- a/packages/yambms/yambms.yaml +++ b/packages/yambms/yambms.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -31,21 +31,6 @@ packages: # Custom user config # yambms_custom: !include yambms_custom.yaml -substitutions: - # +----------------------------------------------------------------+ - # Information from the EVE LF280K v2 cell datasheet - # LFP Recommended Operating Temperature Range : 10~45°C - # Number of cycles at 25°C : 6000 - # Number of cycles at 45°C : 2500 - # >= 60°C : Never charging or discharging - # <= 0°C : Never charging - # <= -30°C : Never discharging - # +----------------------------------------------------------------+ - # Over Temp Protection, Temp > OTP = Stop Charging and Discharging - yambms_otp: "45.0" - # Under Temp Protection, Temp < UTP = Stop Charging - yambms_utp: "1.0" - # Execute once esphome: on_boot: @@ -57,34 +42,37 @@ esphome: if (${yambms_battery_chemistry} == 1) // LFP { // LFP - id(${yambms_id}_mominal_v) = 3.20; - id(${yambms_id}_min_charge_v) = 3.37; // Fully charged at rest - id(${yambms_id}_max_charge_v) = 3.65; + id(${yambms_id}_cell_mominal_v) = 3.20; + id(${yambms_id}_cell_min_charge_v) = 3.37; // Fully charged at rest + id(${yambms_id}_cell_max_charge_v) = 3.65; + id(${yambms_id}_cell_max_discharge_v) = 3.00; // Not used } else if (${yambms_battery_chemistry} == 2) // Li-ion { // Li-ion - id(${yambms_id}_mominal_v) = 3.60; - id(${yambms_id}_min_charge_v) = 3.90; - id(${yambms_id}_max_charge_v) = 4.20; + id(${yambms_id}_cell_mominal_v) = 3.60; + id(${yambms_id}_cell_min_charge_v) = 3.90; + id(${yambms_id}_cell_max_charge_v) = 4.20; + id(${yambms_id}_cell_max_discharge_v) = 3.20; // Not used } else if (${yambms_battery_chemistry} == 3) // LTO { // LTO - id(${yambms_id}_mominal_v) = 2.40; - id(${yambms_id}_min_charge_v) = 2.55; // Fully charged at rest - id(${yambms_id}_max_charge_v) = 2.85; + id(${yambms_id}_cell_mominal_v) = 2.40; + id(${yambms_id}_cell_min_charge_v) = 2.55; // Fully charged at rest + id(${yambms_id}_cell_max_charge_v) = 2.85; + id(${yambms_id}_cell_max_discharge_v) = 2.00; // Not used } int cell_count = ${yambms_cell_count}; // Bulk V. - id(${yambms_id}_bulk_voltage).traits.set_min_value(round(cell_count * id(${yambms_id}_min_charge_v) * 10) / 10); - id(${yambms_id}_bulk_voltage).traits.set_max_value(round(cell_count * id(${yambms_id}_max_charge_v) * 10) / 10); + id(${yambms_id}_bulk_voltage).traits.set_min_value(round(cell_count * id(${yambms_id}_cell_min_charge_v) * 10) / 10); + id(${yambms_id}_bulk_voltage).traits.set_max_value(round(cell_count * id(${yambms_id}_cell_max_charge_v) * 10) / 10); // Float V. - id(${yambms_id}_float_voltage).traits.set_min_value(round(cell_count * (id(${yambms_id}_min_charge_v) - 0.1) * 10) / 10); - id(${yambms_id}_float_voltage).traits.set_max_value(round(cell_count * (id(${yambms_id}_min_charge_v) + 0.1) * 10) / 10); + id(${yambms_id}_float_voltage).traits.set_min_value(round(cell_count * (id(${yambms_id}_cell_min_charge_v) - 0.1) * 10) / 10); + id(${yambms_id}_float_voltage).traits.set_max_value(round(cell_count * (id(${yambms_id}_cell_min_charge_v) + 0.1) * 10) / 10); // Rebulk V. - id(${yambms_id}_rebulk_voltage).traits.set_min_value(round(cell_count * id(${yambms_id}_mominal_v) * 10) / 10); - id(${yambms_id}_rebulk_voltage).traits.set_max_value(round(cell_count * id(${yambms_id}_min_charge_v) * 10) / 10); + id(${yambms_id}_rebulk_voltage).traits.set_min_value(round(cell_count * id(${yambms_id}_cell_mominal_v) * 10) / 10); + id(${yambms_id}_rebulk_voltage).traits.set_max_value(round(cell_count * id(${yambms_id}_cell_min_charge_v) * 10) / 10); globals: - id: ${yambms_id}_service @@ -101,15 +89,19 @@ globals: - id: ${yambms_id}_canbus_protocol type: std::string restore_value: no - - id: ${yambms_id}_mominal_v + - id: ${yambms_id}_cell_mominal_v + type: float + restore_value: no + initial_value: '0.0' + - id: ${yambms_id}_cell_min_charge_v type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_min_charge_v + - id: ${yambms_id}_cell_max_charge_v type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_max_charge_v + - id: ${yambms_id}_cell_max_discharge_v type: float restore_value: no initial_value: '0.0' @@ -410,24 +402,30 @@ sensor: - throttle: 10s - delta: 0.1 lambda: |- + if (id(${yambms_id}_bms_combined).state == 0) // no BMS combined + return 0; // Bulk - if (id(${yambms_id}_charging_instruction).state == "Bulk"){ - if(id(${yambms_id}_auto_cvl) == -1.0) return (id(${yambms_id}_bulk_voltage).state + id(${yambms_id}_inverter_offset_v).state); // Auto CVL not used - else return (id(${yambms_id}_auto_cvl) + id(${yambms_id}_inverter_offset_v).state); + 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); } // Float - else if (id(${yambms_id}_charging_instruction).state == "Float") return (id(${yambms_id}_float_voltage).state + id(${yambms_id}_inverter_offset_v).state); + else if (id(${yambms_id}_charging_instruction).state == "Float") + return (id(${yambms_id}_float_voltage).state + id(${yambms_id}_inverter_offset_v).state); // Stop Charging else return (id(${yambms_id}_rebulk_voltage).state + id(${yambms_id}_inverter_offset_v).state); # +--------------------------------------+ - # | Requested Charge Current (CCL) | + # | Requested Discharge Voltage (DVL) | # +--------------------------------------+ - platform: template - name: ${name} ${yambms_name} Requested Charge Current - id: ${yambms_id}_requested_charge_current - unit_of_measurement: A - icon: mdi:current-dc + name: ${name} ${yambms_name} Requested Discharge Voltage + id: ${yambms_id}_requested_discharge_voltage + unit_of_measurement: V + device_class: voltage update_interval: ${yambms_update_interval} accuracy_decimals: 1 filters: @@ -435,29 +433,36 @@ sensor: - throttle: 10s - delta: 0.1 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) return id(${yambms_id}_max_charge_current).state; // Auto CCL not used - else return id(${yambms_id}_auto_ccl); - } - // Charging Not Allowed - else return 0; + if (id(${yambms_id}_bms_combined).state == 0) // no BMS combined + return 0; + else + return ((id(${yambms_id}_cell_uvp).state + 0.2) * id(${yambms_id}_cell_count).state); # +--------------------------------------+ - # | Requested Discharge Voltage (DVL) | + # | Requested Charge Current (CCL) | # +--------------------------------------+ - platform: template - name: ${name} ${yambms_name} Requested Discharge Voltage - id: ${yambms_id}_requested_discharge_voltage - unit_of_measurement: V - device_class: voltage + name: ${name} ${yambms_name} Requested Charge Current + id: ${yambms_id}_requested_charge_current + unit_of_measurement: A + icon: mdi:current-dc update_interval: ${yambms_update_interval} accuracy_decimals: 1 filters: - or: - throttle: 10s - delta: 0.1 - lambda: return (id(${yambms_id}_cell_uvpr).state * id(${yambms_id}_cell_count).state); + 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); + } + // Charging Not Allowed + else return 0; # +--------------------------------------+ # | Requested Discharge Current (DCL) | @@ -475,11 +480,14 @@ sensor: - delta: 0.1 lambda: |- // Discharging Allowed - if (id(${yambms_id}_discharging_instruction).state == true){ - if(id(${yambms_id}_auto_dcl) == -1.0) return id(${yambms_id}_max_discharge_current).state; // Auto DCL not used - else return id(${yambms_id}_auto_dcl); + 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); } - // Stop Discharging + // Discharging Not Allowed else return 0; # +--------------------------------------+ @@ -499,8 +507,9 @@ sensor: lambda: |- float soc = id(${yambms_id}_state_of_charge).state; float min_cell_v = id(${yambms_id}_min_cell_voltage).state; - float cell_uvpr = id(${yambms_id}_cell_uvpr).state; - if (min_cell_v <= cell_uvpr) return 0; // Real 0% Sending 0% + float cell_low_v = (id(${yambms_id}_cell_uvp).state + 0.2); + if (id(${yambms_id}_bms_combined).state == 0) return 0; // no BMS combined + else if (min_cell_v <= cell_low_v) return 0; // Real 0% Sending 0% else if (soc < 1) return 2; // False 0% sending 2% else if (soc < 99) return soc; // SOC < 99% => Sending BMS SOC // Useful for some inverters, will not send 100% until charging is complete @@ -521,7 +530,9 @@ sensor: - or: - throttle: 10s - delta: 1 - lambda: return round(((id(${yambms_id}_charging_cycles).state/${yambms_max_cycles})-1)*-100); + lambda: |- + if (id(${yambms_id}_bms_combined).state == 0) return 0; // no BMS combined + else return round(((id(${yambms_id}_charging_cycles).state/${yambms_max_cycles})-1)*-100); # +--------------------------------------+ # | Cell Count | @@ -563,29 +574,17 @@ text_sensor: // Warning : information from JK BMS is not available immediately after boot - // YamBMS Alarm ? - if ((id(${yambms_id}_alarm).state != "NoAlarm") & (id(${yambms_id}_alarm).state != "Warning")) id(${yambms_id}_charge_status) = "Alarm"; - // YamBMS Alarm ended ? - else if ((id(${yambms_id}_charge_status) == "Alarm") & ((id(${yambms_id}_alarm).state == "NoAlarm") | (id(${yambms_id}_alarm).state == "Warning"))) - { - if (id(${yambms_id}_eoc) == true) - { - if (id(${yambms_id}_switch_float).state) id(${yambms_id}_charge_status) = "Float"; - else id(${yambms_id}_charge_status) = "EOC"; - } - else id(${yambms_id}_charge_status) = "Wait"; - } // EOC => Float - else if ((id(${yambms_id}_charge_status) == "EOC") & (id(${yambms_id}_switch_float).state)) id(${yambms_id}_charge_status) = "Float"; + if ((id(${yambms_id}_charge_status) == "EOC") & (id(${yambms_id}_switch_float).state)) id(${yambms_id}_charge_status) = "Float"; // No Float => EOC else if ((id(${yambms_id}_charge_status) == "Float") & (!id(${yambms_id}_switch_float).state)) id(${yambms_id}_charge_status) = "EOC"; // No Force Bulk => Wait else if ((id(${yambms_id}_charge_status) == "Force Bulk") & (!id(${yambms_id}_switch_force_bulk).state)) id(${yambms_id}_charge_status) = "Wait"; // +-----------------------------------------------+ - // | Charge ON : BMS and ESP charging switch is ON | + // | Charging allowed (BMS and YamBMS) | // +-----------------------------------------------+ - else if ((id(${yambms_id}_bms_switch_charging).state) & (id(${yambms_id}_switch_charging).state)) { + else if ((id(${yambms_id}_charging_allowed).state) & (id(${yambms_id}_switch_charging).state)) { // Variables float cell_bulk_v = (id(${yambms_id}_bulk_voltage).state / id(${yambms_id}_cell_count).state); @@ -623,8 +622,8 @@ text_sensor: // +-----------------------------------------------+ if (id(${yambms_id}_current).state >= 0) { - float cv_min = id(${yambms_id}_min_charge_v); - float cv_max = id(${yambms_id}_max_charge_v); + float cv_min = id(${yambms_id}_cell_min_charge_v); + float cv_max = id(${yambms_id}_cell_max_charge_v); float cutoff_current = (id(${yambms_id}_battery_capacity).state * 0.05 * (cell_bulk_v - cv_min) / (cv_max - cv_min)); float cutoff_voltage = (cv_min + (cv_max - cv_min)/(0.05 + cutoff_offset_v) * (id(${yambms_id}_current).state / id(${yambms_id}_battery_capacity).state)); @@ -675,7 +674,7 @@ text_sensor: } } } - // Charge OFF + // Charging allowed (BMS or YamBMS) else id(${yambms_id}_charge_status) = "Wait"; ESP_LOGI("yambms", "Charge Status : %s", id(${yambms_id}_charge_status).c_str()); @@ -690,15 +689,10 @@ text_sensor: update_interval: ${yambms_update_interval} icon: mdi:battery-plus lambda: |- - // Alarm > Stop Charging - if ((id(${yambms_id}_alarm).state == "Alarm") | (id(${yambms_id}_alarm).state == "OVP") | (id(${yambms_id}_alarm).state == "UTP") | (id(${yambms_id}_alarm).state == "COCP") | (id(${yambms_id}_alarm).state == "OTP") | (id(${yambms_id}_alarm).state == "BMS")) - { - return {"Stop"}; - } // Bulk Charge - else if ((id(${yambms_id}_charge_status) != "EOC") && (id(${yambms_id}_charge_status) != "Float") && (id(${yambms_id}_charge_status) != "Wait")) + if ((id(${yambms_id}_charge_status) != "EOC") && (id(${yambms_id}_charge_status) != "Float") && (id(${yambms_id}_charge_status) != "Wait")) { - id(${yambms_id}_eoc) = false; // SOC 100% can't be sent + id(${yambms_id}_eoc) = false; // SoC 100% can't be sent return {"Bulk"}; } // Float Charge @@ -712,10 +706,11 @@ text_sensor: return {"Stop"}; } // Wait + // Charging not allowed, alarms or charging switch OFF else return {"Stop"}; # +--------------------------------------+ - # | YamBMS Alarm and Warning | + # | YamBMS Alarm and Warning | # +--------------------------------------+ # | Errors Bitmask (16bit) | # +--------------------------------------+ @@ -755,8 +750,11 @@ text_sensor: // Error Bitmask ? uint16_t errors_bitmask = id(${yambms_id}_errors_bitmask_alarm).state; int eb_counter = id(${yambms_id}_errors_bitmask_counter).state; + + // At least one BMS in alarm + if ((eb_counter > 0) & (eb_counter < id(${yambms_id}_var_bms_counter))) return {"Warning"}; // All BMS are in alarm - if (errors_bitmask > 1) { + else if (errors_bitmask > 1) { if ((errors_bitmask & 0x04) | (errors_bitmask & 0x80) | (errors_bitmask & 0x400)) { // Cell Over Voltage bit 2,7,10 return {"OVP"}; @@ -784,8 +782,6 @@ text_sensor: } else return {"Alarm"}; } - // At least one BMS in alarm - else if ((eb_counter > 0) & (eb_counter < id(${yambms_id}_bms_counter))) return {"Warning"}; // No Alarm else return {"NoAlarm"}; @@ -796,20 +792,7 @@ text_sensor: update_interval: ${yambms_update_interval} entity_category: diagnostic icon: mdi:battery-alert - lambda: |- - - // Preventive Warning ? - if (id(${yambms_id}_bms_combined).state > 0){ - // Over Temp Protection - if (id(${yambms_id}_max_temperature).state > ${yambms_otp}) { - return {"OTP"}; - } - // Under Temp Protection - else if (id(${yambms_id}_min_temperature).state < ${yambms_utp}) { - return {"UTP"}; - } - } - + lambda: |- // Error Bitmask ? uint16_t errors_bitmask = id(${yambms_id}_errors_bitmask_warning).state; if (errors_bitmask > 1) { @@ -852,13 +835,11 @@ binary_sensor: id: ${yambms_id}_discharging_instruction icon: mdi:battery-minus lambda: |- - // Alarm > Stop Discharging - if ((id(${yambms_id}_alarm).state == "Alarm") | (id(${yambms_id}_alarm).state == "UVP") | (id(${yambms_id}_alarm).state == "DOCP") | (id(${yambms_id}_alarm).state == "OTP") | (id(${yambms_id}_alarm).state == "BMS")) return false; - // BMS or ESP32 switch is OFF > Stop Discharging - else if ((!id(${yambms_id}_bms_switch_discharging).state) | (!id(${yambms_id}_switch_discharging).state)) return false; + // Discharging not allowed (all BMS or YamBMS) + if ((!id(${yambms_id}_discharging_allowed).state) | (!id(${yambms_id}_switch_discharging).state)) return false; // Battery voltage is low > Stop Discharging else if (id(${yambms_id}_total_voltage).state <= id(${yambms_id}_requested_discharge_voltage).state) return false; - // Discharging Allowed + // Discharging allowed else return true; # +--------------------------------------+ @@ -877,4 +858,3 @@ binary_sensor: else return false; } else return false; - \ No newline at end of file diff --git a/packages/yambms/yambms_auto_ccl.yaml b/packages/yambms/yambms_auto_ccl.yaml index fedbc56..2bc3ed7 100644 --- a/packages/yambms/yambms_auto_ccl.yaml +++ b/packages/yambms/yambms_auto_ccl.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.08.08 -# Version : 1.2.1 +# Updated : 2024.11.15 +# Version : 1.2.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -53,10 +53,12 @@ sensor: filters: - lambda: !lambda |- // Variables + 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 > id(${yambms_id}_cell_ovpr).state) return 0.0; - else return max(0.0,(- pow(${charge_a_factor_curve_end}, pow( max(0.0, ((x - cell_float_v) / (id(${yambms_id}_cell_ovpr).state - cell_float_v))),${charge_a_factor_curve_shape}))+2) * id(${yambms_id}_max_charge_current).state); + 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); # 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 diff --git a/packages/yambms/yambms_auto_dcl.yaml b/packages/yambms/yambms_auto_dcl.yaml index 4d883f9..5566207 100644 --- a/packages/yambms/yambms_auto_dcl.yaml +++ b/packages/yambms/yambms_auto_dcl.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.08.08 -# Version : 1.2.1 +# Updated : 2024.11.15 +# Version : 1.2.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -54,9 +54,11 @@ sensor: internal: true filters: - lambda: !lambda |- + // Variables + double cell_low_v = id(${yambms_id}_cell_uvp).state + 0.2; // Auto Discharge Current function - if (id(${yambms_id}_min_cell_voltage).state < id(${yambms_id}_cell_uvpr).state) return 0.0; - else return max(0.0,(- pow(${discharge_a_factor_curve_end}, pow( max(0.0, ((x - ${discharge_knee_v}) / (id(${yambms_id}_cell_uvpr).state - ${discharge_knee_v}))),${discharge_a_factor_curve_shape}))+2) * id(${yambms_id}_max_discharge_current).state); + 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); # 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 @@ -84,4 +86,4 @@ sensor: - 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); \ No newline at end of file + return (round(min(id(auto_dcl_moving_average).state, x) * 10) / 10); diff --git a/packages/yambms/yambms_canbus.yaml b/packages/yambms/yambms_canbus.yaml index 6a00538..f4361e5 100644 --- a/packages/yambms/yambms_canbus.yaml +++ b/packages/yambms/yambms_canbus.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.09.09 -# Version : 2.3.6 +# Updated : 2024.11.11 +# Version : 2.3.7 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -112,7 +112,7 @@ script: - id: ${canbus_id}_script_canbus_link_timer mode: restart then: - - delay: ${canbus_link_timer}s + - delay: ${canbus_link_timer} - lambda: |- id(${canbus_id}_send_canbus_data) = false; // Stop sending CANBUS datas id(${canbus_id}_status).publish_state(false); // Set CANBUS Status to OFF @@ -154,7 +154,7 @@ interval: id(${yambms_id}_canbus_name) = id(${canbus_id}_bms_name).state.c_str(); id(${yambms_id}_canbus_protocol) = id(${canbus_id}_protocol).state.c_str(); - - interval: 120s + - interval: 60s then: - lambda: |- // Test inverter 0x305 ACK @@ -610,6 +610,8 @@ interval: uint8_t can_mesg[] = {0, 0, 0, 0, 0, 0, 0, 0}; can_mesg[0] = id(${yambms_id}_bms_combined).state; + can_mesg[2] = id(${yambms_id}_bms_blocking_charge).state; + can_mesg[4] = id(${yambms_id}_bms_blocking_discharge).state; can_mesg[6] = (id(${yambms_id}_bms_count).state - id(${yambms_id}_bms_combined).state); ESP_LOGI("canbus", "send can_id: 0x372 hex: %x %x %x %x %x %x %x %x", can_mesg[0], can_mesg[1], can_mesg[2], can_mesg[3], can_mesg[4], can_mesg[5], can_mesg[6], can_mesg[7]); diff --git a/packages/yambms/yambms_combine.yaml b/packages/yambms/yambms_combine.yaml index 0dec9b3..accebad 100644 --- a/packages/yambms/yambms_combine.yaml +++ b/packages/yambms/yambms_combine.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.10.03 -# Version : 1.4.5 +# Updated : 2024.11.11 +# Version : 1.5.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -19,15 +19,15 @@ globals: # BMS - - id: ${yambms_id}_bms_counter + - id: ${yambms_id}_var_bms_counter type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_can_be_combined_bms_counter + - id: ${yambms_id}_var_to_combine_bms_number type: int restore_value: no - initial_value: '0' - - id: ${yambms_id}_processed_bms_counter + initial_value: '1' + - id: ${yambms_id}_var_to_combine_bms_counter type: int restore_value: no initial_value: '0' @@ -35,83 +35,75 @@ globals: type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_var_errors_bitmask_alarm - type: int - restore_value: no - initial_value: '0' - - id: ${yambms_id}_var_errors_bitmask_warning + - id: ${yambms_id}_var_errors_bitmask type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_equalizing_counter + - id: ${yambms_id}_var_equalizing_counter type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_bms_switch_charging_counter + - id: ${yambms_id}_var_charging_allowed_counter type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_bms_switch_discharging_counter + - id: ${yambms_id}_var_discharging_allowed_counter type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_total_cell_count + - id: ${yambms_id}_var_total_cell_count type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_min_min_voltage_cell + - id: ${yambms_id}_var_min_voltage_cell type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_max_max_voltage_cell + - id: ${yambms_id}_var_max_voltage_cell type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_min_min_cell_voltage + - id: ${yambms_id}_var_min_cell_voltage type: float restore_value: no initial_value: '5.0' - - id: ${yambms_id}_max_max_cell_voltage + - id: ${yambms_id}_var_max_cell_voltage type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_total_max_charge_current + - id: ${yambms_id}_var_total_max_charge_current type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_total_max_discharge_current + - id: ${yambms_id}_var_total_max_discharge_current type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_total_installed_battery_capacity + - id: ${yambms_id}_var_total_installed_battery_capacity type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_total_battery_capacity + - id: ${yambms_id}_var_total_battery_capacity type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_total_capacity_remaining_ah + - id: ${yambms_id}_var_total_capacity_remaining_ah type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_total_charging_cycles + - id: ${yambms_id}_var_total_charging_cycles type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_min_cell_ovp + - id: ${yambms_id}_var_min_cell_ovp type: float restore_value: no initial_value: '5.0' - - id: ${yambms_id}_min_cell_ovpr - type: float - restore_value: no - initial_value: '5.0' - - id: ${yambms_id}_max_cell_uvpr + - id: ${yambms_id}_var_max_cell_uvp type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_max_balance_trigger_voltage + - id: ${yambms_id}_var_max_balance_trigger_voltage type: float restore_value: no initial_value: '0.0' @@ -131,52 +123,52 @@ globals: type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_bms_total_voltage + - id: ${yambms_id}_var_bms_total_voltage type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_bms_total_current + - id: ${yambms_id}_var_bms_total_current type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_bms_total_power + - id: ${yambms_id}_var_bms_total_power type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_bms_total_soc + - id: ${yambms_id}_var_bms_total_soc type: float restore_value: no initial_value: '0.0' # Shunt - - id: ${yambms_id}_shunt_use + - id: ${yambms_id}_var_shunt_use type: bool restore_value: no initial_value: "false" - - id: ${yambms_id}_shunt_counter + - id: ${yambms_id}_var_shunt_counter type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_can_be_combined_shunt_counter + - id: ${yambms_id}_var_to_combine_shunt_number type: int restore_value: no - initial_value: '0' - - id: ${yambms_id}_processed_shunt_counter + initial_value: '1' + - id: ${yambms_id}_var_to_combine_shunt_counter type: int restore_value: no initial_value: '0' - - id: ${yambms_id}_shunt_total_voltage + - id: ${yambms_id}_var_shunt_total_voltage type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_shunt_total_current + - id: ${yambms_id}_var_shunt_total_current type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_shunt_total_power + - id: ${yambms_id}_var_shunt_total_power type: float restore_value: no initial_value: '0.0' - - id: ${yambms_id}_shunt_total_soc + - id: ${yambms_id}_var_shunt_total_soc type: float restore_value: no initial_value: '0.0' @@ -187,189 +179,196 @@ interval: then: - lambda: |- // If all device have communicated their informations - int device_counter = (id(${yambms_id}_bms_counter) + id(${yambms_id}_shunt_counter)); - int processed_device_counter = (id(${yambms_id}_processed_bms_counter) + id(${yambms_id}_processed_shunt_counter)); - if (device_counter == processed_device_counter) + int device_counter = (id(${yambms_id}_var_bms_counter) + id(${yambms_id}_var_shunt_counter)); + int processed_device_counter = (id(${yambms_id}_var_to_combine_bms_number) + id(${yambms_id}_var_to_combine_shunt_number)); + if ((device_counter + 2) == processed_device_counter) { // +-----------------------------------------------+ - // | Errors bitmask (16bit) | + // | Errors bitmask (JK 16bit) | // +-----------------------------------------------+ - // Alarm - OR bitwise - if (id(${yambms_id}_var_errors_bitmask_counter) == id(${yambms_id}_bms_counter)) { - id(${yambms_id}_errors_bitmask_alarm).publish_state(id(${yambms_id}_var_errors_bitmask_alarm)); - id(${yambms_id}_var_errors_bitmask_alarm) = 0; // global var reset + // Alarm - all BMS are in alarm ? + if (id(${yambms_id}_var_errors_bitmask_counter) == id(${yambms_id}_var_bms_counter)) + { + id(${yambms_id}_errors_bitmask_alarm).publish_state(id(${yambms_id}_var_errors_bitmask)); } + // At least one BMS is not in alarm else id(${yambms_id}_errors_bitmask_alarm).publish_state(0); - // Warning - OR bitwise - id(${yambms_id}_errors_bitmask_warning).publish_state(id(${yambms_id}_var_errors_bitmask_warning)); - id(${yambms_id}_var_errors_bitmask_warning) = 0; // global var reset - // errors_bitmask_counter + // Warning + id(${yambms_id}_errors_bitmask_warning).publish_state(id(${yambms_id}_var_errors_bitmask)); + // errors_bitmask_counter ( number of BMS in alarms) id(${yambms_id}_errors_bitmask_counter).publish_state(id(${yambms_id}_var_errors_bitmask_counter)); - id(${yambms_id}_var_errors_bitmask_counter) = 0; // global var reset // +-----------------------------------------------+ - // MEAN total_voltage + // Vars init float total_voltage = 0.0; - // Shunt - if (id(${yambms_id}_shunt_use) == true) - total_voltage = (id(${yambms_id}_shunt_total_voltage) / id(${yambms_id}_can_be_combined_shunt_counter)); - // BMS - else if (id(${yambms_id}_can_be_combined_bms_counter) > 0) - total_voltage = (id(${yambms_id}_bms_total_voltage) / id(${yambms_id}_can_be_combined_bms_counter)); - // Publish sensor and global var reset - id(${yambms_id}_total_voltage).publish_state(total_voltage); - id(${yambms_id}_bms_total_voltage) = 0.0; - id(${yambms_id}_shunt_total_voltage) = 0.0; - - // TOTAL current - // Shunt - if (id(${yambms_id}_shunt_use) == true) - id(${yambms_id}_current).publish_state(id(${yambms_id}_shunt_total_current)); - // BMS - else - id(${yambms_id}_current).publish_state(id(${yambms_id}_bms_total_current)); - // Global var reset - id(${yambms_id}_bms_total_current) = 0.0; - id(${yambms_id}_shunt_total_current) = 0.0; - - // TOTAL power - // Shunt - if (id(${yambms_id}_shunt_use) == true) - id(${yambms_id}_power).publish_state(id(${yambms_id}_shunt_total_power)); - // BMS - else - id(${yambms_id}_power).publish_state(id(${yambms_id}_bms_total_power)); - // Global var reset - id(${yambms_id}_bms_total_power) = 0.0; - id(${yambms_id}_shunt_total_power) = 0.0; - - // MEAN state_of_charge + float current = 0.0; + float power = 0.0; float soc = 0.0; - // Shunt - if (id(${yambms_id}_shunt_use) == true) - soc = (id(${yambms_id}_shunt_total_soc) / id(${yambms_id}_can_be_combined_shunt_counter)); - // BMS - else if (id(${yambms_id}_can_be_combined_bms_counter) > 0) - soc = (id(${yambms_id}_bms_total_soc) / id(${yambms_id}_can_be_combined_bms_counter)); - // Publish sensor and global var reset + float charging_cycles = 0.0; + + // At least one BMS can be combined + if (id(${yambms_id}_var_to_combine_bms_counter) > 0) + { + // MEAN total_voltage (Shunt/BMS) + if (id(${yambms_id}_var_shunt_use) == true) + total_voltage = (id(${yambms_id}_var_shunt_total_voltage) / id(${yambms_id}_var_to_combine_shunt_counter)); + else + total_voltage = (id(${yambms_id}_var_bms_total_voltage) / id(${yambms_id}_var_to_combine_bms_counter)); + + // TOTAL current (Shunt/BMS) + if (id(${yambms_id}_var_shunt_use) == true) + current = id(${yambms_id}_var_shunt_total_current); + else + current = id(${yambms_id}_var_bms_total_current); + + // TOTAL power (Shunt/BMS) + if (id(${yambms_id}_var_shunt_use) == true) + power = id(${yambms_id}_var_shunt_total_power); + else + power = id(${yambms_id}_var_bms_total_power); + + // MEAN state_of_charge (Shunt/BMS) + if (id(${yambms_id}_var_shunt_use) == true) + soc = (id(${yambms_id}_var_shunt_total_soc) / id(${yambms_id}_var_to_combine_shunt_counter)); + else + soc = (id(${yambms_id}_var_bms_total_soc) / id(${yambms_id}_var_to_combine_bms_counter)); + + // MEAN charging_cycles + charging_cycles = (id(${yambms_id}_var_total_charging_cycles) / id(${yambms_id}_var_to_combine_bms_counter)); + } + + // Publishing sensors + id(${yambms_id}_total_voltage).publish_state(total_voltage); + id(${yambms_id}_current).publish_state(current); + id(${yambms_id}_power).publish_state(power); id(${yambms_id}_state_of_charge).publish_state(soc); - id(${yambms_id}_bms_total_soc) = 0.0; - id(${yambms_id}_shunt_total_soc) = 0.0; + id(${yambms_id}_charging_cycles).publish_state(charging_cycles); // TOTAL capacity_remaining_ah - id(${yambms_id}_capacity_remaining_ah).publish_state(id(${yambms_id}_total_capacity_remaining_ah)); - id(${yambms_id}_total_capacity_remaining_ah) = 0.0; // global var reset + id(${yambms_id}_capacity_remaining_ah).publish_state(id(${yambms_id}_var_total_capacity_remaining_ah)); // TOTAL max_charge_current - id(${yambms_id}_max_charge_current).publish_state(id(${yambms_id}_total_max_charge_current) * (id(${yambms_id}_max_charge_current_pct).state / 100)); - id(${yambms_id}_total_max_charge_current) = 0.0; // global var reset + id(${yambms_id}_max_charge_current).publish_state(id(${yambms_id}_var_total_max_charge_current) * (id(${yambms_id}_max_charge_current_pct).state / 100)); // TOTAL max_discharge_current - id(${yambms_id}_max_discharge_current).publish_state(id(${yambms_id}_total_max_discharge_current) * (id(${yambms_id}_max_discharge_current_pct).state / 100)); - id(${yambms_id}_total_max_discharge_current) = 0.0; // global var reset - - // MEAN charging_cycles - float charging_cycles = 0.0; - if (id(${yambms_id}_can_be_combined_bms_counter) > 0) - charging_cycles = (id(${yambms_id}_total_charging_cycles) / id(${yambms_id}_can_be_combined_bms_counter)); - id(${yambms_id}_charging_cycles).publish_state(charging_cycles); - id(${yambms_id}_total_charging_cycles) = 0.0; // global var reset - - // equalizing_counter - if (id(${yambms_id}_equalizing_counter) > 0) id(${yambms_id}_equalizing).publish_state(true); - else id(${yambms_id}_equalizing).publish_state(false); - id(${yambms_id}_equalizing_counter) = 0; // global var reset - - // bms_switch_charging_counter - if (id(${yambms_id}_bms_switch_charging_counter) > 0) id(${yambms_id}_bms_switch_charging).publish_state(true); - else id(${yambms_id}_bms_switch_charging).publish_state(false); - id(${yambms_id}_bms_switch_charging_counter) = 0; // global var reset - - // bms_switch_discharging_counter - if (id(${yambms_id}_bms_switch_discharging_counter) > 0) id(${yambms_id}_bms_switch_discharging).publish_state(true); - else id(${yambms_id}_bms_switch_discharging).publish_state(false); - id(${yambms_id}_bms_switch_discharging_counter) = 0; // global var reset + id(${yambms_id}_max_discharge_current).publish_state(id(${yambms_id}_var_total_max_discharge_current) * (id(${yambms_id}_max_discharge_current_pct).state / 100)); // MIN/MAX values // MAX balance_trigger_voltage - id(${yambms_id}_balance_trigger_voltage).publish_state(id(${yambms_id}_max_balance_trigger_voltage)); - id(${yambms_id}_max_balance_trigger_voltage) = 0.0; // global var reset + id(${yambms_id}_balance_trigger_voltage).publish_state(id(${yambms_id}_var_max_balance_trigger_voltage)); // MIN min_cell_voltage // MIN min_voltage_cell (cell number) - id(${yambms_id}_min_cell_voltage).publish_state(id(${yambms_id}_min_min_cell_voltage)); - id(${yambms_id}_min_voltage_cell).publish_state(id(${yambms_id}_min_min_voltage_cell)); - id(${yambms_id}_min_min_cell_voltage) = 5.0; // global var reset - id(${yambms_id}_min_min_voltage_cell) = 0; // global var reset + id(${yambms_id}_min_cell_voltage).publish_state(id(${yambms_id}_var_min_cell_voltage)); + id(${yambms_id}_min_voltage_cell).publish_state(id(${yambms_id}_var_min_voltage_cell)); // MAX max_cell_voltage // MAX max_voltage_cell (cell number) - id(${yambms_id}_max_cell_voltage).publish_state(id(${yambms_id}_max_max_cell_voltage)); - id(${yambms_id}_max_voltage_cell).publish_state(id(${yambms_id}_max_max_voltage_cell)); - id(${yambms_id}_max_max_cell_voltage) = 0.0; // global var reset - id(${yambms_id}_max_max_voltage_cell) = 0; // global var reset + id(${yambms_id}_max_cell_voltage).publish_state(id(${yambms_id}_var_max_cell_voltage)); + id(${yambms_id}_max_voltage_cell).publish_state(id(${yambms_id}_var_max_voltage_cell)); // MIN cell_ovp - id(${yambms_id}_cell_ovp).publish_state(id(${yambms_id}_min_cell_ovp)); - id(${yambms_id}_min_cell_ovp) = 5.0; // global var reset - - // MIN cell_ovpr - id(${yambms_id}_cell_ovpr).publish_state(id(${yambms_id}_min_cell_ovpr)); - id(${yambms_id}_min_cell_ovpr) = 5.0; // global var reset + id(${yambms_id}_cell_ovp).publish_state(id(${yambms_id}_var_min_cell_ovp)); - // MAX cell_uvpr - id(${yambms_id}_cell_uvpr).publish_state(id(${yambms_id}_max_cell_uvpr)); - id(${yambms_id}_max_cell_uvpr) = 0.0; // global var reset + // MAX cell_uvp + id(${yambms_id}_cell_uvp).publish_state(id(${yambms_id}_var_max_cell_uvp)); // MIN temperature // MIN temperature_sensor id(${yambms_id}_min_temperature).publish_state(id(${yambms_id}_var_min_temperature)); id(${yambms_id}_min_temperature_sensor).publish_state(id(${yambms_id}_var_min_temperature_sensor)); - id(${yambms_id}_var_min_temperature) = 100.0; // global var reset - id(${yambms_id}_var_min_temperature_sensor) = 0; // global var reset // MAX temperature // MAX temperature_sensor id(${yambms_id}_max_temperature).publish_state(id(${yambms_id}_var_max_temperature)); id(${yambms_id}_max_temperature_sensor).publish_state(id(${yambms_id}_var_max_temperature_sensor)); - id(${yambms_id}_var_max_temperature) = -100.0; // global var reset - id(${yambms_id}_var_max_temperature_sensor) = 0; // global var reset - // Reset processed device counter (new cycle) - // The device are once again authorized to communicate their informations - id(${yambms_id}_processed_bms_counter) = 0; - id(${yambms_id}_processed_shunt_counter) = 0; + // BMS equalizing state + if (id(${yambms_id}_var_equalizing_counter) > 0) + id(${yambms_id}_equalizing).publish_state(true); + else + id(${yambms_id}_equalizing).publish_state(false); + + // BMS charging allowed + if (id(${yambms_id}_var_to_combine_bms_counter) && id(${yambms_id}_var_charging_allowed_counter) > 0) + id(${yambms_id}_charging_allowed).publish_state(true); + else + id(${yambms_id}_charging_allowed).publish_state(false); + // bms_blocking_charge + id(${yambms_id}_bms_blocking_charge).publish_state(id(${yambms_id}_var_bms_counter) - id(${yambms_id}_var_charging_allowed_counter)); + + // BMS discharging allowed + if (id(${yambms_id}_var_to_combine_bms_counter) && id(${yambms_id}_var_discharging_allowed_counter) > 0) + id(${yambms_id}_discharging_allowed).publish_state(true); + else + id(${yambms_id}_discharging_allowed).publish_state(false); + // bms_blocking_discharge + id(${yambms_id}_bms_blocking_discharge).publish_state(id(${yambms_id}_var_bms_counter) - id(${yambms_id}_var_discharging_allowed_counter)); + + // Global vars reset + id(${yambms_id}_var_errors_bitmask) = 0; + id(${yambms_id}_var_errors_bitmask_counter) = 0; + id(${yambms_id}_var_bms_total_voltage) = 0.0; + id(${yambms_id}_var_shunt_total_voltage) = 0.0; + id(${yambms_id}_var_bms_total_current) = 0.0; + id(${yambms_id}_var_shunt_total_current) = 0.0; + id(${yambms_id}_var_bms_total_power) = 0.0; + id(${yambms_id}_var_shunt_total_power) = 0.0; + id(${yambms_id}_var_bms_total_soc) = 0.0; + id(${yambms_id}_var_shunt_total_soc) = 0.0; + id(${yambms_id}_var_total_capacity_remaining_ah) = 0.0; + id(${yambms_id}_var_total_max_charge_current) = 0.0; + id(${yambms_id}_var_total_max_discharge_current) = 0.0; + id(${yambms_id}_var_total_charging_cycles) = 0.0; + id(${yambms_id}_var_max_balance_trigger_voltage) = 0.0; + id(${yambms_id}_var_min_cell_voltage) = 5.0; + id(${yambms_id}_var_min_voltage_cell) = 0; + id(${yambms_id}_var_max_cell_voltage) = 0.0; + id(${yambms_id}_var_max_voltage_cell) = 0; + id(${yambms_id}_var_min_cell_ovp) = 5.0; + id(${yambms_id}_var_max_cell_uvp) = 0.0; + id(${yambms_id}_var_min_temperature) = 100.0; + id(${yambms_id}_var_min_temperature_sensor) = 0; + id(${yambms_id}_var_max_temperature) = -100.0; + id(${yambms_id}_var_max_temperature_sensor) = 0; + id(${yambms_id}_var_equalizing_counter) = 0; + id(${yambms_id}_var_charging_allowed_counter) = 0; + id(${yambms_id}_var_discharging_allowed_counter) = 0; + + // The devices are once again authorized to communicate their informations + id(${yambms_id}_var_to_combine_bms_number) = 1; + id(${yambms_id}_var_to_combine_shunt_number) = 1; } binary_sensor: # equalizing - platform: template - name: "${name} ${yambms_name} Equalizing state" id: ${yambms_id}_equalizing - # bms_switch_charging + name: "${name} ${yambms_name} BMS equalizing state" + # charging_allowed - platform: template - name: "${name} ${yambms_name} BMS Charge switch state" - id: ${yambms_id}_bms_switch_charging - # bms_switch_discharging + id: ${yambms_id}_charging_allowed + name: "${name} ${yambms_name} BMS charging allowed" + # discharging_allowed - platform: template - name: "${name} ${yambms_name} BMS Discharge switch state" - id: ${yambms_id}_bms_switch_discharging + id: ${yambms_id}_discharging_allowed + name: "${name} ${yambms_name} BMS discharging allowed" sensor: - # cell_count SUM - - platform: template - id: ${yambms_id}_cell_count_total - name: "${name} ${yambms_name} Cell Count (Σ)" - update_interval: ${yambms_update_interval} - accuracy_decimals: 0 - icon: mdi:counter - filters: - - or: - - throttle: 10s - - delta: 1 - lambda: return id(${yambms_id}_total_cell_count); + # # cell_count SUM + # - platform: template + # id: ${yambms_id}_cell_count_total + # name: "${name} ${yambms_name} Cell Count (Σ)" + # update_interval: ${yambms_update_interval} + # accuracy_decimals: 0 + # icon: mdi:counter + # filters: + # - or: + # - throttle: 10s + # - delta: 1 + # lambda: return id(${yambms_id}_var_total_cell_count); # max_charge_current SUM - platform: template @@ -526,7 +525,7 @@ sensor: - or: - throttle: 10s - delta: 1 - lambda: return id(${yambms_id}_total_installed_battery_capacity); + lambda: return id(${yambms_id}_var_total_installed_battery_capacity); # battery_capacity SUM - platform: template @@ -540,7 +539,7 @@ sensor: - or: - throttle: 10s - delta: 1 - lambda: return id(${yambms_id}_total_battery_capacity); + lambda: return id(${yambms_id}_var_total_battery_capacity); # capacity_remaining_ah SUM - platform: template @@ -555,7 +554,7 @@ sensor: - throttle: 10s - delta: 1 - # cell_ovp MIN + # cell_ovp MIN (Auto CCL) - platform: template id: ${yambms_id}_cell_ovp name: "${name} ${yambms_name} Cell OVP (MIN)" @@ -568,23 +567,10 @@ sensor: - throttle: 10s - delta: 0.001 - # cell_ovpr MIN - - platform: template - id: ${yambms_id}_cell_ovpr - name: "${name} ${yambms_name} Cell OVPR (MIN)" - update_interval: ${yambms_update_interval} - accuracy_decimals: 3 - unit_of_measurement: V - device_class: voltage - filters: - - or: - - throttle: 10s - - delta: 0.001 - - # cell_uvpr MAX + # cell_uvp MAX (Auto DCL and MAX Discharge Voltage) - platform: template - id: ${yambms_id}_cell_uvpr - name: "${name} ${yambms_name} Cell UVPR (MAX)" + id: ${yambms_id}_cell_uvp + name: "${name} ${yambms_name} Cell UVP (MAX)" update_interval: ${yambms_update_interval} accuracy_decimals: 3 unit_of_measurement: V @@ -716,7 +702,7 @@ sensor: - or: - throttle: 10s - delta: 1 - lambda: return id(${yambms_id}_bms_counter); + lambda: return id(${yambms_id}_var_bms_counter); # BMS combined - platform: template @@ -729,7 +715,31 @@ sensor: - or: - throttle: 10s - delta: 1 - lambda: return id(${yambms_id}_can_be_combined_bms_counter); + lambda: return id(${yambms_id}_var_to_combine_bms_counter); + + # BMS blocking charge + - platform: template + name: ${name} ${yambms_name} BMS blocking charge + id: ${yambms_id}_bms_blocking_charge + update_interval: ${yambms_update_interval} + accuracy_decimals: 0 + icon: mdi:counter + filters: + - or: + - throttle: 10s + - delta: 1 + + # BMS blocking discharge + - platform: template + name: ${name} ${yambms_name} BMS blocking discharge + id: ${yambms_id}_bms_blocking_discharge + update_interval: ${yambms_update_interval} + accuracy_decimals: 0 + icon: mdi:counter + filters: + - or: + - throttle: 10s + - delta: 1 # Shunt count - platform: template @@ -742,7 +752,7 @@ sensor: - or: - throttle: 10s - delta: 1 - lambda: return id(${yambms_id}_shunt_counter); + lambda: return id(${yambms_id}_var_shunt_counter); # Shunt combined - platform: template @@ -755,7 +765,7 @@ sensor: - or: - throttle: 10s - delta: 1 - lambda: return id(${yambms_id}_can_be_combined_shunt_counter); + lambda: return id(${yambms_id}_var_to_combine_shunt_counter); # power_tube_temperature MIN_MAX # - platform: template