From a509745922c858909ab536946aeca7f440536943 Mon Sep 17 00:00:00 2001 From: Trefor Southwell <48591903+springfall2008@users.noreply.github.com> Date: Tue, 30 Jan 2024 08:46:31 +0000 Subject: [PATCH] Issue with reserve max causing flip/flop charging at 100% (#668) * Issue with reserve max causing flip/flop charging at 100% https://github.com/springfall2008/batpred/issues/667 --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- apps/predbat/predbat.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index febff66c..e1f72ca8 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -9216,7 +9216,13 @@ def execute_plan(self): status = "Freeze charging" status_extra = " target {}%".format(inverter.soc_percent) else: - if self.set_soc_enable and self.set_reserve_enable and self.set_reserve_hold and ((inverter.soc_percent + 1) >= self.charge_limit_percent_best[0]): + if ( + self.set_soc_enable + and self.set_reserve_enable + and self.set_reserve_hold + and ((inverter.soc_percent + 1) >= self.charge_limit_percent_best[0]) + and (inverter.reserve_max >= inverter.soc_percent) + ): status = "Hold charging" inverter.disable_charge_window() disabled_charge_window = True