Repository navigation
Feature Request "Mindest-SoC: Automatik-Option für Phasenwahl ergänzen" #4068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a17a22d
cb2beb0
27defb8
5cfed67
d028080
84b6202
f14fb2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -321,8 +321,8 @@ def auto_phase_switch(self, | |
| delay = surplus_config.vehicle.phase_switch_delay * 60 | ||
| if phases_in_use == 1: | ||
| direction_str = f"Umschaltung von 1 auf {max_phases}" | ||
| required_reserved_power = (control_parameter.min_current * max_phases * 230 - | ||
| self.ev_template.data.max_current_single_phase * 230) | ||
| required_reserved_power = max(0, control_parameter.min_current * max_phases * 230 - | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High · Use surplus above minimum The change adds automatic phase switching, but does not make available PV surplus raise the charging current above the minimum-SoC current. Thus the requested lower-bound behavior—and the choice between that behavior and a fixed minimum-SoC current—is still missing. Prompt for AI agentsIn `packages/control/ev/ev.py` at line 324:
**Use surplus above minimum**
The change adds automatic phase switching, but does not make available PV surplus raise the charging current above the minimum-SoC current. Thus the requested lower-bound behavior—and the choice between that behavior and a fixed minimum-SoC current—is still missing.From #4005: Use available PV surplus during minimum-SoC charging while keeping the configured minimum-SoC current as a lower bound, with a choice to keep it fixed. |
||
| self.ev_template.data.max_current_single_phase * 230) | ||
|
Comment on lines
+324
to
+325
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High · Minimum current is not preserved The change enables automatic phase selection, but it still bases switching power on Prompt for AI agentsIn `packages/control/ev/ev.py` at lines 324-325:
**Minimum current is not preserved**
The change enables automatic phase selection, but it still bases switching power on `control_parameter.min_current`, which is the vehicle's general minimum current rather than the configured AC/DC minimum-SoC current. Consequently, minimum-SoC charging does not get the requested lower-bound behavior, and a phase switch can use a current below that configured minimum; there is also no choice between fixed-current and lower-bound behavior.From #4005: Make minimum-SoC charging optionally treat its configured current as a lower bound and use available PV surplus in addition to it.
Comment on lines
+324
to
+325
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High · Minimum-SoC current floor is lost When minimum-SoC charging uses automatic phase selection and its configured current exceeds the vehicle’s general minimum, Use the configured minimum-SoC current for the automatic switch threshold and target during minimum-SoC charging. Also at Prompt for AI agentsIn `packages/control/ev/ev.py` at lines 324-325:
**Minimum-SoC current floor is lost**
When minimum-SoC charging uses automatic phase selection and its configured current exceeds the vehicle’s general minimum, `set_control_parameter()` puts the vehicle’s general minimum in `min_current`, which `auto_phase_switch()` uses for the switch threshold and target current. The switch can therefore charge below the configured minimum-SoC current.
Use the configured minimum-SoC current for the automatic switch threshold and target during minimum-SoC charging.
Also at `packages/modules/web_themes/koala/source/src/components/ChargePointPvSettings.vue:120`, `packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue:1039`, `packages/modules/web_themes/colors/source/src/components/chargePointList/cpConfig/ConfigPv.vue:82`, `packages/modules/web_themes/standard_legacy/web/index.html:959-960`. |
||
|
|
||
| new_phase = max_phases | ||
| new_current = control_parameter.min_current | ||
|
|
@@ -336,9 +336,9 @@ def auto_phase_switch(self, | |
| waiting_time = surplus_config.vehicle.switch_off_delay | ||
| all_surplus = data.data.counter_all_data.get_evu_counter().get_usable_surplus() | ||
| if control_parameter.state == ChargepointState.PHASE_SWITCH_DELAY: | ||
| # eigene reservierte Leistung addieren, wenn die Verzögerung für die Umschaltung läuft, | ||
| # da diese Leistung bereits für die Umschaltung reserviert ist. | ||
| surplus = all_surplus + max(0, required_reserved_power) | ||
| # mit der tatsächlich reservierten Leistung rechnen, nicht mit einer frisch berechneten - sonst | ||
| # können Reservieren und Zurücknehmen auseinanderlaufen, wenn sich zB max_phases währenddessen ändert | ||
| surplus = all_surplus + control_parameter.reserved_power | ||
| else: | ||
| surplus = all_surplus | ||
|
|
||
|
|
@@ -358,8 +358,9 @@ def auto_phase_switch(self, | |
| if condition: | ||
| # Wenn nach der Umschaltung weniger Leistung benötigt wird, soll während der Verzögerung keine | ||
| # neuen eingeschaltet werden. | ||
| control_parameter.reserved_power = required_reserved_power | ||
| data.data.counter_all_data.get_evu_counter( | ||
| ).data.set.reserved_surplus += max(0, required_reserved_power) | ||
| ).data.set.reserved_surplus += control_parameter.reserved_power | ||
| message = self.PHASE_SWITCH_DELAY_TEXT.format( | ||
| direction_str, | ||
| self._remaining_phase_switch_time(control_parameter, | ||
|
|
@@ -384,14 +385,16 @@ def auto_phase_switch(self, | |
| message = self.PHASE_SWITCH_DELAY_TEXT.format(direction_str, remaining_time) | ||
| else: | ||
| data.data.counter_all_data.get_evu_counter( | ||
| ).data.set.reserved_surplus -= max(0, required_reserved_power) | ||
| ).data.set.reserved_surplus -= control_parameter.reserved_power | ||
| control_parameter.reserved_power = 0 | ||
|
Comment on lines
+388
to
+389
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Restored reservations are not released When a restart or upgrade restores a pending phase-switch delay created before Provide a compatibility fallback or migration that restores the prior reservation amount before the timeout and reset paths release it. Also at Prompt for AI agentsIn `packages/control/ev/ev.py` at lines 388-389:
**Restored reservations are not released**
When a restart or upgrade restores a pending phase-switch delay created before `reserved_power` existed, `reserved_power` defaults to zero, so the timeout and reset paths subtract zero instead of the existing reservation from `reserved_surplus`. Usable surplus remains understated after the delay ends or is cancelled.
Provide a compatibility fallback or migration that restores the prior reservation amount before the timeout and reset paths release it.
Also at `packages/control/ev/ev.py:447-449`, `packages/control/chargepoint/control_parameter.py:24`. |
||
| phases_to_use = new_phase | ||
| current = new_current | ||
| log.debug("Phasenumschaltung kann nun durchgeführt werden.") | ||
| control_parameter.state = ChargepointState.PHASE_SWITCH_AWAITED | ||
| else: | ||
| data.data.counter_all_data.get_evu_counter( | ||
| ).data.set.reserved_surplus -= max(0, required_reserved_power) | ||
| ).data.set.reserved_surplus -= control_parameter.reserved_power | ||
| control_parameter.reserved_power = 0 | ||
| message = f"Verzögerung für die {direction_str} Phasen abgebrochen{condition_msg}" | ||
| control_parameter.state = ChargepointState.CHARGING_ALLOWED | ||
| control_parameter.timestamp_phase_switch_buffer_start = None | ||
|
|
@@ -429,7 +432,7 @@ def _remaining_phase_switch_time(self, control_parameter: ControlParameter, | |
| control_parameter.timestamp_phase_switch_buffer_start = None | ||
| return True, None | ||
|
|
||
| def reset_phase_switch_delay(self, control_parameter: ControlParameter, max_phases: int): | ||
| def reset_phase_switch_delay(self, control_parameter: ControlParameter): | ||
| """ Zurücksetzen der Zeitstempel und reservierten Leistung. | ||
|
|
||
| Die Phasenumschaltung kann nicht abgebrochen werden! | ||
|
|
@@ -441,8 +444,8 @@ def reset_phase_switch_delay(self, control_parameter: ControlParameter, max_phas | |
| # Wenn der Timer läuft, ist den Control-Parametern die alte Phasenzahl hinterlegt. | ||
| # bei der Umschaltung 3p1p wird keine Leistung reserviert | ||
| evu_counter = data.data.counter_all_data.get_evu_counter() | ||
| reserved = max(0, control_parameter.min_current * max_phases * 230 - | ||
| self.ev_template.data.max_current_single_phase * 230) | ||
| reserved = control_parameter.reserved_power | ||
| control_parameter.reserved_power = 0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Reserved surplus remains unavailable When a 1-to-3-phase delay has reserved power and the phase count changes from 1 before Release Also at Prompt for AI agentsIn `packages/control/ev/ev.py` at line 448:
**Reserved surplus remains unavailable**
When a 1-to-3-phase delay has reserved power and the phase count changes from 1 before `reset_phase_switch_delay()` runs, `reset_phase_switch_delay()` releases and clears the reservation only when `control_parameter.phases == 1`, even though the charge-point update changes phases first. The reservation remains in `reserved_surplus`, reducing the surplus available to other charge points.
Release `reserved_power` and clear the delay reservation regardless of the current phase count.
Also at `packages/control/chargepoint/chargepoint.py:191`, `packages/control/chargepoint/chargepoint.py:667`, `packages/control/ev/ev.py:449`, `packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue:1039`, `packages/modules/web_themes/colors/source/src/components/chargePointList/cpConfig/ConfigPv.vue:82`, `packages/modules/web_themes/koala/source/src/components/ChargePointPvSettings.vue:120`, `packages/modules/web_themes/standard_legacy/web/index.html:960`. |
||
| evu_counter.data.set.reserved_surplus -= reserved | ||
| log.debug(f"Zurücksetzen von {reserved}W reservierter Leistung für die Phasenumschaltung. " | ||
| f"reservierte Leistung: {evu_counter.data.set.reserved_surplus} W") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1016,6 +1016,28 @@ export default { | |
| > | ||
| Maximum | ||
| </i-button> | ||
| <i-button | ||
| :color=" | ||
| mqttStore.getChargePointConnectedVehiclePvChargingMinSocPhases( | ||
| modalChargePointId, | ||
| ) == 0 | ||
| ? 'primary' | ||
| : '' | ||
| " | ||
| :active=" | ||
| mqttStore.getChargePointConnectedVehiclePvChargingMinSocPhases( | ||
| modalChargePointId, | ||
| ) == 0 | ||
| " | ||
| @click=" | ||
| setChargePointConnectedVehiclePvChargingMinSocPhases( | ||
| modalChargePointId, | ||
| 0, | ||
| ) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Automatik selection is ignored When a user selects Automatik in the Cards theme, the Change the guard to accept Prompt for AI agentsIn `packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue` at line 1036:
**Automatik selection is ignored**
When a user selects Automatik in the Cards theme, the `selected_phases &&` guard rejects the selected value `0`, so `setChargePointConnectedVehiclePvChargingMinSocPhases()` does not update the saved phase selection.
Change the guard to accept `0` as a valid selection. |
||
| " | ||
| > | ||
| Automatik | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High · Automatic option is absent in served themes When the PR is deployed using the checked-in web assets without a separate frontend build, the deployed pages load the prebuilt files under Rebuild and include the generated web assets for each theme whose source changes in this PR. Also at Prompt for AI agentsIn `packages/modules/display_themes/cards/source/src/views/ChargePointsView.vue` at line 1039:
**Automatic option is absent in served themes**
When the PR is deployed using the checked-in web assets without a separate frontend build, the deployed pages load the prebuilt files under `web/`, not these edited source components, so without rebuilding and including those files the new buttons do not appear to users.
Rebuild and include the generated web assets for each theme whose source changes in this PR.
Also at `packages/modules/web_themes/colors/source/src/components/chargePointList/cpConfig/ConfigPv.vue:82`, `packages/modules/web_themes/koala/source/src/components/ChargePointPvSettings.vue:120`. |
||
| </i-button> | ||
| </i-button-group> | ||
| </i-form-group> | ||
| </i-form> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium · Disabled automation strands phase delay
When the automatic minimum-SoC phase option is changed to a fixed phase while an automatic phase-switch delay is active,
_check_auto_phase_switch_delay()stops servicing the delay oncetemplate_phasesis no longer 0, whileChargepoint.update()callsreset_phase_switch_delay()only when the chargemode or submode changes. Changing the minimum-SoC phase selection from automatic to a fixed option during a delay therefore leaves the charge point inPHASE_SWITCH_DELAYwith its surplus reservation held; the requested phase switch never completes.Cancel and release an active automatic phase-switch delay when the selected phase mode changes away from automatic.
Prompt for AI agents