Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/helpermodules/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.SE.value):
count_duo += 1
else:
count_series_socket += 1
Expand Down
1 change: 1 addition & 0 deletions packages/modules/chargepoints/internal_openwb/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class InternalChargepointMode(Enum):
PRO_PLUS = "pro_plus"
SERIES = "series"
SOCKET = "socket"
SE = "se"


class InternalOpenWBConfiguration:
Expand Down
7 changes: 6 additions & 1 deletion packages/modules/common/evse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.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.")
self.cp1_client_handler = client_factory(1, fault_state_info_cp1, self.cp0_client_handler)
Expand Down