Fix battery charging: limit max_charging_current to PV surplus
When PV can charge battery without grid (Battery First mode),
limit battery_max_charging_current = (PV - Load) / V_bat to prevent
battery from pulling excess power from grid.

Without this fix, battery charged at max 100A even when PV surplus
was only ~55A, resulting in ~500W grid import for battery charging.

Formula: max(5, min(100, (pv_w - load_w) / bat_voltage_v))
Applied in both g12w_wlacz_ladowanie_dzienne and g12w_pv_charging_optimization.
On grid-charge path: restore battery_max_charging_current to 100A.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fe3d310 commit f9b4f56d44d9e567a9742fdbee7143283f9a86f0
Wojciech Konieczny authored on 4 Mar
Showing 1 changed file
View
ha-configs/151/automations.yaml