Skip to content

Commit

Permalink
Fix issue where fast plan mode was the wrong way around (#453)
Browse files Browse the repository at this point in the history
* Fast mode was the wrong way around
  • Loading branch information
springfall2008 authored Dec 12, 2023
1 parent 1e509e2 commit 18c2206
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/predbat/predbat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5138,7 +5138,7 @@ def set_rate_thresholds(self):
self.rate_import_cost_threshold = self.dp2(self.rate_average * self.rate_low_threshold)
else:
# In automatic mode select the only rate or everything but the most expensive
if self.rate_max == self.rate_min:
if (self.rate_max == self.rate_min) or (self.rate_export_max > self.rate_max):
self.rate_import_cost_threshold = self.rate_max
else:
self.rate_import_cost_threshold = self.rate_max - 0.5
Expand All @@ -5148,7 +5148,7 @@ def set_rate_thresholds(self):
self.rate_export_cost_threshold = self.dp2(self.rate_export_average * self.rate_high_threshold)
else:
# In automatic mode select the only rate or everything but the most cheapest
if self.rate_export_max == self.rate_export_min:
if (self.rate_export_max == self.rate_export_min) or (self.rate_export_min > self.rate_min):
self.rate_export_cost_threshold = self.rate_export_min
else:
self.rate_export_cost_threshold = self.rate_export_min + 0.5
Expand Down Expand Up @@ -8896,9 +8896,9 @@ def fetch_config_options(self):
self.calculate_fast_plan = self.get_arg("calculate_fast_plan")

if self.calculate_fast_plan:
self.calculate_max_windows = max(int(forecast_hours * 2), 24)
else:
self.calculate_max_windows = max(int(forecast_hours), 12)
else:
self.calculate_max_windows = max(int(forecast_hours * 2), 24)

self.num_cars = self.get_arg("num_cars", 1)
self.inverter_type = self.get_arg("inverter_type", "GE", indirect=False)
Expand Down

0 comments on commit 18c2206

Please sign in to comment.