Skip to content

Commit

Permalink
Fix surplus controlled (#2245)
Browse files Browse the repository at this point in the history
* fix pv charging with min current

* ChargepointState WAIT_FOR_USING_PHASES after switch on delay
  • Loading branch information
LKuemmel authored Mar 7, 2025
1 parent d633246 commit f10dc16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/control/algorithm/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ def update_raw_data(preferenced_chargepoints: List[Chargepoint],

if diff_to_zero is False:
if chargepoint.data.control_parameter.min_current < max_target_set_current:
diffs = [chargepoint.data.control_parameter.min_current -
max_target_set_current if required_currents[i] != 0 else 0 for i in range(3)]
if surplus:
diffs = [chargepoint.data.set.target_current -
max_target_set_current if required_currents[i] != 0 else 0 for i in range(3)]
else:
diffs = [chargepoint.data.control_parameter.min_current -
max_target_set_current if required_currents[i] != 0 else 0 for i in range(3)]
else:
continue
else:
Expand Down
2 changes: 1 addition & 1 deletion packages/control/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def switch_on_timer_expired(self, chargepoint: Chargepoint) -> None:
control_parameter.timestamp_switch_on_off = None
self.data.set.reserved_surplus -= pv_config.switch_on_threshold*control_parameter.phases
msg = self.SWITCH_ON_EXPIRED.format(pv_config.switch_on_threshold)
control_parameter.state = ChargepointState.CHARGING_ALLOWED
control_parameter.state = ChargepointState.WAIT_FOR_USING_PHASES

if chargepoint.data.set.charging_ev_data.charge_template.data.chargemode.pv_charging.feed_in_limit:
feed_in_yield = pv_config.feed_in_yield
Expand Down

0 comments on commit f10dc16

Please sign in to comment.