From 2ee02ca8b25f81846104d47ceb910a269cd0e03e Mon Sep 17 00:00:00 2001 From: salewis38 <46199139+salewis38@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:43:57 +0100 Subject: [PATCH] Corrected sign in overmorrow calc --- palm_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/palm_utils.py b/palm_utils.py index c92a2f2..fbca95c 100644 --- a/palm_utils.py +++ b/palm_utils.py @@ -478,10 +478,11 @@ def compute_tgt_soc(self, gen_fcast, weight: int, commit: bool) -> str: # We now have the four values of max & min charge for tomorrow & overmorrow # Check if overmorrow is better than tomorrow and there is opportunity to reduce target - # to avoid residual charge at the end of the day in anticipation of a sunny day + # to avoid residual charge at the end of the day in anticipation of a sunny day. + # Reduce the target by implying that there will be more than forecast generation if max_charge_pcnt[1] > 100 and max_charge_pcnt[0] < 100: logger.info("Overmorrow correction enabled") - max_charge_pc -= int((max_charge_pcnt[1] - 100) / 2) + max_charge_pc += int((max_charge_pcnt[1] - 100) / 2) else: logger.info("Overmorrow correction not needed/enabled")