diff --git a/apps/predbat/config.py b/apps/predbat/config.py index f19583c6..ec088cb8 100644 --- a/apps/predbat/config.py +++ b/apps/predbat/config.py @@ -895,7 +895,7 @@ "friendly_name": "iBoost max energy", "type": "input_number", "min": 0, - "max": 20, + "max": 30, "step": 0.1, "unit": "kWh", "enable": "iboost_enable", @@ -906,7 +906,7 @@ "friendly_name": "iBoost today", "type": "input_number", "min": 0, - "max": 5, + "max": 30, "step": 0.1, "unit": "kWh", "enable": "iboost_enable", diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index a95a63d4..708fe802 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -4481,9 +4481,12 @@ def publish_html_plan(self, pv_forecast_minute_step, pv_forecast_minute_step10, ) else: iboost_change = max(iboost_amount_end - iboost_amount, 0.0) - iboost_amount_str = str(self.dp2(iboost_change)) if iboost_change > 0: iboost_color = "#FFFF00" + iboost_amount_str = str(self.dp2(iboost_amount)) + " (+" + str(self.dp2(iboost_change)) + ")" + else: + if iboost_amount > 0: + iboost_amount_str = str(self.dp2(iboost_amount)) if self.carbon_enable: # Work out carbon intensity and carbon use @@ -5286,6 +5289,7 @@ def reset(self): if os.path.exists(root): self.config_root = root break + self.config_root_p = self.config_root self.log("Config root is {}".format(self.config_root)) def optimise_charge_limit_price_threads( @@ -5416,11 +5420,20 @@ def optimise_charge_limit_price_threads( try_discharge[window_n] = 100 if window_n in all_d: - hit_charge = self.hit_charge_window(self.charge_window_best, discharge_window[window_n]["start"], discharge_window[window_n]["end"]) - if not self.calculate_discharge_oncharge and hit_charge >= 0 and try_charge_limit[hit_charge] > 0.0: - continue + if not self.calculate_discharge_oncharge: + hit_charge = self.hit_charge_window(self.charge_window_best, discharge_window[window_n]["start"], discharge_window[window_n]["end"]) + if hit_charge >= 0 and try_charge_limit[hit_charge] > 0.0: + continue if not self.car_charging_from_battery and self.hit_car_window(discharge_window[window_n]["start"], discharge_window[window_n]["end"]): continue + if ( + not self.iboost_on_discharge + and self.iboost_enable + and self.iboost_plan + and (self.hit_charge_window(self.iboost_plan, discharge_window[window_n]["start"], discharge_window[window_n]["end"]) >= 0) + ): + continue + if window_prices_discharge[window_n] < lowest_price_discharge: lowest_price_discharge = window_prices_discharge[window_n] try_discharge[window_n] = 0 @@ -6612,8 +6625,16 @@ def tweak_plan(self, end_record, best_metric, metric_keep): hit_charge = self.hit_charge_window(self.charge_window_best, self.discharge_window_best[window_n]["start"], self.discharge_window_best[window_n]["end"]) if hit_charge >= 0 and self.charge_limit_best[hit_charge] > 0.0: continue - if not self.car_charging_from_battery and self.hit_car_window(self.discharge_window_best[window_n]["start"], self.discharge_window_best[window_n]["end"]): - continue + if ( + not self.iboost_on_discharge + and self.iboost_enable + and self.iboost_plan + and (self.hit_charge_window(self.iboost_plan, self.discharge_window_best[window_n]["start"], self.discharge_window_best[window_n]["end"]) >= 0) + ): + continue + if not self.car_charging_from_battery and self.hit_car_window(self.discharge_window_best[window_n]["start"], self.discharge_window_best[window_n]["end"]): + continue + best_soc, best_start, best_metric, best_cost, soc_min, soc_min_minute, best_keep, best_cycle, best_carbon, best_import = self.optimise_discharge( window_n, record_discharge_windows, @@ -6880,6 +6901,13 @@ def optimise_all_windows(self, best_metric, metric_keep): self.discharge_window_best[window_n]["start"], self.discharge_window_best[window_n]["end"] ): continue + if ( + not self.iboost_on_discharge + and self.iboost_enable + and self.iboost_plan + and (self.hit_charge_window(self.iboost_plan, self.discharge_window_best[window_n]["start"], self.discharge_window_best[window_n]["end"]) >= 0) + ): + continue average = self.discharge_window_best[window_n]["average"] if price < lowest_price_charge: @@ -7002,6 +7030,13 @@ def optimise_all_windows(self, best_metric, metric_keep): continue if not self.car_charging_from_battery and self.hit_car_window(self.discharge_window_best[window_n]["start"], self.discharge_window_best[window_n]["end"]): continue + if ( + not self.iboost_on_discharge + and self.iboost_enable + and self.iboost_plan + and (self.hit_charge_window(self.iboost_plan, self.discharge_window_best[window_n]["start"], self.discharge_window_best[window_n]["end"]) >= 0) + ): + continue average = self.discharge_window_best[window_n]["average"] best_soc, best_start, best_metric, best_cost, soc_min, soc_min_minute, best_keep, best_cycle, best_carbon, best_import = self.optimise_discharge(