From 662a3c2e4f7a99e7d188a02d09481977f7a4e0bb Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Wed, 7 Jan 2026 16:30:27 +0100 Subject: [PATCH 1/2] draft --- packages/helpermodules/command.py | 4 +++- packages/modules/chargepoints/internal_openwb/config.py | 1 + packages/modules/common/evse.py | 7 ++++++- .../internal_chargepoint_handler/chargepoint_module.py | 2 +- .../internal_chargepoint_handler.py | 3 ++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/helpermodules/command.py b/packages/helpermodules/command.py index 3fdde21e15..53e3d32063 100644 --- a/packages/helpermodules/command.py +++ b/packages/helpermodules/command.py @@ -323,7 +323,9 @@ def _check_max_num_of_internal_chargepoints(self, config: Dict) -> Optional[str] for cp in SubData.cp_data.values(): if isinstance(cp.chargepoint.chargepoint_module, ChargepointModule): if (cp.chargepoint.chargepoint_module.config.configuration.mode == - InternalChargepointMode.DUO.value): + InternalChargepointMode.DUO.value or + cp.chargepoint.chargepoint_module.config.configuration.mode == + InternalChargepointMode.ECO.value): count_duo += 1 else: count_series_socket += 1 diff --git a/packages/modules/chargepoints/internal_openwb/config.py b/packages/modules/chargepoints/internal_openwb/config.py index 435d157937..5c83cefbad 100644 --- a/packages/modules/chargepoints/internal_openwb/config.py +++ b/packages/modules/chargepoints/internal_openwb/config.py @@ -8,6 +8,7 @@ class InternalChargepointMode(Enum): PRO_PLUS = "pro_plus" SERIES = "series" SOCKET = "socket" + ECO = "eco" class InternalOpenWBConfiguration: diff --git a/packages/modules/common/evse.py b/packages/modules/common/evse.py index 86b855639b..86d0d6efcd 100644 --- a/packages/modules/common/evse.py +++ b/packages/modules/common/evse.py @@ -109,8 +109,13 @@ def deactivate_precise_current(self) -> None: else: return - def set_current(self, current: int) -> None: + def set_current(self, current: int, phases_in_use: Optional[int] = None) -> None: time.sleep(0.1) formatted_current = round(current*100) if self._precise_current else round(current) + if self.max_current == 20 and phases_in_use is not None and phases_in_use != 0: + # Bei 20A EVSE und bekannter Phasenzahl auf 16A begrenzen, sonst erstmal Ladung mit Minimalstrom starten, + # um Phasenzahl zu ermitteln + if formatted_current > 16 and phases_in_use > 1: + formatted_current = 16 if self.evse_current != formatted_current: self.client.write_registers(1000, formatted_current, unit=self.id) diff --git a/packages/modules/internal_chargepoint_handler/chargepoint_module.py b/packages/modules/internal_chargepoint_handler/chargepoint_module.py index 8f5204b0c9..80e3178dda 100644 --- a/packages/modules/internal_chargepoint_handler/chargepoint_module.py +++ b/packages/modules/internal_chargepoint_handler/chargepoint_module.py @@ -73,7 +73,7 @@ def on_message(client, userdata, message): def set_current(self, current: float) -> None: with SingleComponentUpdateContext(self.fault_state, update_always=False): - self._client.evse_client.set_current(current) + self._client.evse_client.set_current(current, phases_in_use=self.old_phases_in_use) def get_values(self, phase_switch_cp_active: bool, last_tag: str) -> ChargepointState: def store_state(chargepoint_state: ChargepointState) -> None: diff --git a/packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py b/packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py index 990bd699b4..9579dbc6bc 100644 --- a/packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py +++ b/packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py @@ -116,7 +116,8 @@ def __init__(self, self.cp0_client_handler = None self.cp0 = None try: - if mode == InternalChargepointMode.DUO.value: + if ((mode == InternalChargepointMode.DUO.value or mode == InternalChargepointMode.ECO.value) and + hierarchy_id_cp0 is not None): with SingleComponentUpdateContext(fault_state_info_cp1, reraise=True): log.debug("Zweiter Ladepunkt für Duo konfiguriert.") self.cp1_client_handler = client_factory(1, fault_state_info_cp1, self.cp0_client_handler) From 0be3020ace06169fa236b42bc7b1c67f71208058 Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Thu, 8 Jan 2026 10:36:30 +0100 Subject: [PATCH 2/2] rename to SE --- packages/helpermodules/command.py | 2 +- packages/modules/chargepoints/internal_openwb/config.py | 2 +- .../internal_chargepoint_handler.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/helpermodules/command.py b/packages/helpermodules/command.py index 53e3d32063..80cb6feff0 100644 --- a/packages/helpermodules/command.py +++ b/packages/helpermodules/command.py @@ -325,7 +325,7 @@ def _check_max_num_of_internal_chargepoints(self, config: Dict) -> Optional[str] if (cp.chargepoint.chargepoint_module.config.configuration.mode == InternalChargepointMode.DUO.value or cp.chargepoint.chargepoint_module.config.configuration.mode == - InternalChargepointMode.ECO.value): + InternalChargepointMode.SE.value): count_duo += 1 else: count_series_socket += 1 diff --git a/packages/modules/chargepoints/internal_openwb/config.py b/packages/modules/chargepoints/internal_openwb/config.py index 5c83cefbad..3861a0ebe6 100644 --- a/packages/modules/chargepoints/internal_openwb/config.py +++ b/packages/modules/chargepoints/internal_openwb/config.py @@ -8,7 +8,7 @@ class InternalChargepointMode(Enum): PRO_PLUS = "pro_plus" SERIES = "series" SOCKET = "socket" - ECO = "eco" + SE = "se" class InternalOpenWBConfiguration: diff --git a/packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py b/packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py index 9579dbc6bc..e94a7e643e 100644 --- a/packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py +++ b/packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py @@ -116,7 +116,7 @@ def __init__(self, self.cp0_client_handler = None self.cp0 = None try: - if ((mode == InternalChargepointMode.DUO.value or mode == InternalChargepointMode.ECO.value) and + if ((mode == InternalChargepointMode.DUO.value or mode == InternalChargepointMode.SE.value) and hierarchy_id_cp0 is not None): with SingleComponentUpdateContext(fault_state_info_cp1, reraise=True): log.debug("Zweiter Ladepunkt für Duo konfiguriert.")