diff --git a/packages/control/algorithm/surplus_controlled.py b/packages/control/algorithm/surplus_controlled.py index cca250528d..1db1d6f996 100644 --- a/packages/control/algorithm/surplus_controlled.py +++ b/packages/control/algorithm/surplus_controlled.py @@ -134,7 +134,7 @@ def phase_switch_necessary() -> bool: if cp.chargemode_changed or cp.submode_changed: if (control_parameter.state in CHARGING_STATES): if cp.data.set.charging_ev_data.ev_template.data.prevent_charge_stop is False: - threshold = evu_counter.calc_switch_off_threshold(cp)[0] + threshold = evu_counter.calc_switch_off_threshold(cp) if evu_counter.calc_raw_surplus() - cp.data.set.required_power < threshold: control_parameter.required_currents = [0]*3 control_parameter.state = ChargepointState.NO_CHARGING_ALLOWED diff --git a/packages/control/counter.py b/packages/control/counter.py index b00b0f79a1..9725f8f6d5 100644 --- a/packages/control/counter.py +++ b/packages/control/counter.py @@ -386,25 +386,24 @@ def switch_off_check_timer(self, chargepoint: Chargepoint) -> None: except Exception: log.exception("Fehler im allgemeinen PV-Modul") - def calc_switch_off_threshold(self, chargepoint: Chargepoint) -> Tuple[float, float]: + def calc_switch_off_threshold(self, chargepoint: Chargepoint) -> float: pv_config = data.data.general_data.data.chargemode_config.pv_charging control_parameter = chargepoint.data.control_parameter if chargepoint.data.set.charge_template.data.chargemode.pv_charging.feed_in_limit: # Der EVU-Überschuss muss ggf um die Einspeisegrenze bereinigt werden. # Wnn die Leistung nicht Einspeisegrenze + Einschaltschwelle erreicht, darf die Ladung nicht pulsieren. # Abschaltschwelle um Einschaltschwelle reduzieren. - feed_in_yield = (-data.data.general_data.data.chargemode_config.pv_charging.feed_in_yield - + pv_config.switch_on_threshold*control_parameter.phases) + threshold = (-data.data.general_data.data.chargemode_config.pv_charging.feed_in_yield + + pv_config.switch_on_threshold*control_parameter.phases) else: - feed_in_yield = 0 - threshold = pv_config.switch_off_threshold + feed_in_yield - return threshold, feed_in_yield + threshold = pv_config.switch_off_threshold + return threshold def calc_switch_off(self, chargepoint: Chargepoint) -> Tuple[float, float]: switch_off_power = self.calc_surplus() - self.data.set.released_surplus - threshold, feed_in_yield = self.calc_switch_off_threshold(chargepoint) + threshold = self.calc_switch_off_threshold(chargepoint) log.debug(f'LP{chargepoint.num} Switch-Off-Threshold prüfen: {switch_off_power}W, Schwelle: {threshold}W, ' - f'freigegebener Überschuss {self.data.set.released_surplus}W, Einspeisegrenze {feed_in_yield}W') + f'freigegebener Überschuss {self.data.set.released_surplus}W') return switch_off_power, threshold def switch_off_check_threshold(self, chargepoint: Chargepoint) -> bool: