Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebuk1 authored Oct 29, 2024
2 parents c7bba66 + e3889bf commit 6e0ccf5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apps/pv_opt/pvpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ def optimised_force(self, initial_soc, static_flows, contract: Contract, **kwarg
for slot in window:
if log:
self.log(f"Slot time = {slot.tz_localize(None)}")

if pd.Timestamp.utcnow().tz_localize(None) > slot.tz_localize(None):
#if log:
# self.log("Partial slot detected")
Expand All @@ -1093,10 +1094,6 @@ def optimised_force(self, initial_soc, static_flows, contract: Contract, **kwarg
# self.log("Factors =")
# self.log(factors)

# The reduction of the current slot reduces the power so the .flows algorithm calculates the correct charge added to the battery in the partial slot.
# However, this same value should not then be used to program the inverter. The inverter should stick at the power assigned at the start of the slot.
# We should factor this reduced power back up again just prior to inverter programming.

if round(cost_at_min_price, 1) < round(max_import_cost, 1):

#if log:
Expand All @@ -1110,7 +1107,7 @@ def optimised_force(self, initial_soc, static_flows, contract: Contract, **kwarg
# However, this filling is being done by power.

# However, once the future slots reach maximum power, the current slot will only be at 1/3 or 2/3s power.
# This what we need to ensure that the energy flow to battery is correct.
# This what we need to ensure that the energy flow to battery is correct (because 10 or 20 minutes in flows updates "chg" to be equal to battery SOC)
# THere is however nothing in place to then stop that slot filling up (to max charger power) with more high cost swaps?
# Once partway through a slot, the starting battery charge (chg) take accounts of the slot already gone, so it shouldnt be allowed to fill.
# So, we then need a limit on the partial slot power based on how far through the slot we are, and declare the slot "full" at that point.
Expand Down

0 comments on commit 6e0ccf5

Please sign in to comment.