diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_DEMO.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_DEMO.yaml index e07fcea..3116ffa 100644 --- a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_DEMO.yaml +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_DEMO.yaml @@ -345,6 +345,8 @@ views: name: Rebulk SoC - entity: number.yambms_demo_yambms_1_rebulk_v name: Rebulk V. + - entity: number.yambms_demo_yambms_1_rebulk_days + name: Rebulk Days - entity: switch.yambms_demo_yambms_1_force_bulk_top_bal name: Force Bulk (top bal) title: YamBMS - ReBulk diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_RS485_3xBMS.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_RS485_3xBMS.yaml index d6d55a6..1c91bcf 100644 --- a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_RS485_3xBMS.yaml +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_RS485_3xBMS.yaml @@ -307,6 +307,8 @@ views: name: Rebulk SoC - entity: number.yambms_yambms_1_rebulk_v name: Rebulk V. + - entity: number.yambms_yambms_1_rebulk_days + name: Rebulk Days - entity: switch.yambms_yambms_1_force_bulk_top_bal name: Force Bulk (top bal) title: YamBMS - ReBulk diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_RS485_7xBMS.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_RS485_7xBMS.yaml index 1a1860b..7d244b3 100644 --- a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_RS485_7xBMS.yaml +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_RS485_7xBMS.yaml @@ -307,6 +307,8 @@ views: name: Rebulk SoC - entity: number.yambms_yambms_1_rebulk_v name: Rebulk V. + - entity: number.yambms_yambms_1_rebulk_days + name: Rebulk Days - entity: switch.yambms_yambms_1_force_bulk_top_bal name: Force Bulk (top bal) title: YamBMS - ReBulk diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_UART-GPS_BLE_3xBMS.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_UART-GPS_BLE_3xBMS.yaml index ed8621b..dfc1b9c 100644 --- a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_UART-GPS_BLE_3xBMS.yaml +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_JK_UART-GPS_BLE_3xBMS.yaml @@ -307,6 +307,8 @@ views: name: Rebulk SoC - entity: number.yambms_yambms_1_rebulk_v name: Rebulk V. + - entity: number.yambms_yambms_1_rebulk_days + name: Rebulk Days - entity: switch.yambms_yambms_1_force_bulk_top_bal name: Force Bulk (top bal) title: YamBMS - ReBulk diff --git a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_without_BMS.yaml b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_without_BMS.yaml index 2e108b7..c938576 100644 --- a/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_without_BMS.yaml +++ b/HomeAssistant_Dashboards/YamBMS_HA_Dashboard_without_BMS.yaml @@ -307,6 +307,8 @@ views: name: Rebulk SoC - entity: number.yambms_yambms_1_rebulk_v name: Rebulk V. + - entity: number.yambms_yambms_1_rebulk_days + name: Rebulk Days - entity: switch.yambms_yambms_1_force_bulk_top_bal name: Force Bulk (top bal) title: YamBMS - ReBulk diff --git a/documents/README/YamBMS_functions.md b/documents/README/YamBMS_functions.md index 608a4af..ca9c4d3 100644 --- a/documents/README/YamBMS_functions.md +++ b/documents/README/YamBMS_functions.md @@ -79,7 +79,8 @@ The `Requested Discharge Voltage` is the `UVP + 0.2` value of your BMS multiplie ![Image](../../images/YamBMS_ReBulk.png "YamBMS_ReBulk") -There are two parameters to start a new `Bulk` phase. You can set a `Rebulk SoC` or a `Rebulk V.` value, only one of these conditions must be met. +There are three parameters to start a new `Bulk` phase. You can set a `Rebulk SoC`, a `Rebulk V.` value or the `Rebulk Days` (since last full charge), only one of these conditions must be met. +`Rebulk Days` can be disabled by setting them to `0`. If needed you can also force a `Bulk` charge with the `Force Bulk (top bal)` switch. The switch will automatically deactivate when your cells enter the `Balancing` phase. @@ -215,7 +216,8 @@ There are some configuration options to adjust the behaviour: The text sensor `Auto SoC Limit Status` will show the current status of the function: - `Stop: Disabled`: Function is disabled. -- `Stop: Force Bulk active`: The `Force Bulk` switch is enabled. +- `Stop: Force Bulk active`: The `Force Bulk` switch is enabled, this function will not be enabled +- `Stop: Rebulk Days active`: `Rebulk Days` is `> 0` and last full charge was longer ago than the specified number of days, this function will not be enabled. - `Stop: Not in Bulk/Float`: Charging status is not `Bulk` or `Float`, this function will not be enabled during `Cut-Off` or `Balancing`. - `Stop: SoC limit reached`: The configured `SoC` limit was reached. - `Wait: Reactivating at xx%`: The configured `SoC` limit was reached, now it waits until the SoC goes down to `Auto SoC Limit` - `Auto SoC Hysteresis`. diff --git a/images/YamBMS_ReBulk.png b/images/YamBMS_ReBulk.png index 22af571..f40f118 100644 Binary files a/images/YamBMS_ReBulk.png and b/images/YamBMS_ReBulk.png differ diff --git a/packages/yambms/yambms_auto_soc_limit.yaml b/packages/yambms/yambms_auto_soc_limit.yaml index 115f764..42c7735 100644 --- a/packages/yambms/yambms_auto_soc_limit.yaml +++ b/packages/yambms/yambms_auto_soc_limit.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.03.12 -# Version : 1.1.2 +# Updated : 2026.03.14 +# Version : 1.1.3 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -161,6 +161,16 @@ interval: return; } + // Check if Rebulk Days is active + if (id(${yambms_id}_var_rebulk_days_active)) { + // If Rebulk Days is active, we should not limit charge current or switch to Float + id(${yambms_id}_var_auto_soc_limit) = 0; + id(${yambms_id}_auto_soc_limit_status).publish_state("Stop: Rebulk Days active"); + id(${yambms_id}_var_auto_soc_target_reached) = false; + id(${yambms_id}_var_charge_current_step)++; + return; + } + // Update in 60s intervals only static uint32_t last_execution_ms = 0; uint32_t current_ms = millis(); diff --git a/packages/yambms/yambms_core.yaml b/packages/yambms/yambms_core.yaml index 936eebb..6137a4d 100644 --- a/packages/yambms/yambms_core.yaml +++ b/packages/yambms/yambms_core.yaml @@ -1,4 +1,4 @@ -# Updated : 2026.03.11 +# Updated : 2026.03.14 # Version : 1.7.0 # GitHub : https://github.com/Sleeper85/esphome-yambms @@ -302,6 +302,10 @@ globals: type: time_t restore_value: true initial_value: '' + - id: ${yambms_id}_var_rebulk_days_active + type: bool + restore_value: no + initial_value: 'false' # Execute once esphome: @@ -708,6 +712,36 @@ interval: float cell_rebulk_v = (id(${yambms_id}_rebulk_voltage).state / id(${yambms_id}_cell_count).state); float max_cell_v = id(${yambms_id}_max_cell_voltage).state; + // +-----------------------------------------------+ + // | Rebulk after N days since last full charge | + // +-----------------------------------------------+ + int rebulk_days = (int)id(${yambms_id}_rebulk_days).state; + if (rebulk_days == 0) // Function disabled + { + id(${yambms_id}_var_rebulk_days_active) = false; + } + else if (!id(${yambms_id}_var_rebulk_days_active)) // Function enabled + { + if (rebulk_days > 0) + { + time_t last_eoc = id(${yambms_id}_var_eoc_timestamp); + if (last_eoc > 0) + { + // Round down to 00:00:00 so rebulk gets enabled early in the day + struct tm *eoc_tm = localtime(&last_eoc); + eoc_tm->tm_hour = 0; eoc_tm->tm_min = 0; eoc_tm->tm_sec = 0; + time_t last_eoc_day = mktime(eoc_tm); + time_t now = id(my_time).utcnow().timestamp; + float days_since_eoc = (float)(now - last_eoc_day) / 86400.0f; + if (days_since_eoc >= rebulk_days) + { + id(${yambms_id}_var_rebulk_days_active) = true; + ESP_LOGD("yambms_debug", "Rebulk after %d days since last full charge: activating rebulk logic", rebulk_days); + } + } + } + } + // +-----------------------------------------------+ // | Force Bulk Logic | // +-----------------------------------------------+ @@ -732,6 +766,9 @@ interval: // SoC <= 85% (default value) else if (id(${yambms_id}_battery_soc).state <= id(${yambms_id}_rebulk_soc).state) id(${yambms_id}_var_charge_status) = "Bulk"; + // Rebulk Days >= 14 (default value) + else if (id(${yambms_id}_var_rebulk_days_active) == true) + id(${yambms_id}_var_charge_status) = "Bulk"; // Force Charge requested else if (id(${yambms_id}_requested_force_charge).state) id(${yambms_id}_var_charge_status) = "Bulk"; @@ -1037,6 +1074,8 @@ script: else id(${yambms_id}_var_charge_status) = "EOC"; id(${yambms_id}_var_eoc) = true; // SOC 100% can be sent id(${yambms_id}_var_eoc_timestamp) = id(my_time).utcnow().timestamp; // Store charge completion timestamp + id(${yambms_id}_var_rebulk_days_active) = false; // Rebulk after N days logic reset + @@ -1188,6 +1227,22 @@ number: icon: mdi:battery-medium optimistic: true entity_category: config + - platform: template + name: "${name} ${yambms_name} Rebulk Days" + id: "${yambms_id}_rebulk_days" + step: 1 + min_value: 0 + max_value: 30 + restore_value: true + mode: "${yambms_input_number_mode}" + initial_value: 14 + unit_of_measurement: days + icon: mdi:calendar-refresh + optimistic: true + entity_category: config + on_value: + then: + - lambda: id(${yambms_id}_var_rebulk_days_active) = false; - platform: template name: "${name} ${yambms_name} Inverter Offset V." id: "${yambms_id}_inverter_offset_v"