From b3e1476d5933a8c69a455ae68da2ac0b2061ff0d Mon Sep 17 00:00:00 2001 From: Trefor Southwell <48591903+springfall2008@users.noreply.github.com> Date: Wed, 3 Jan 2024 19:54:29 +0000 Subject: [PATCH 1/2] Fix crash with calculate soc only --- apps/predbat/predbat.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index 4c4fa6f5a..04115ebd3 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -7891,8 +7891,7 @@ def optimise_all_windows(self, load_minutes_step, load_minutes_step10, pv_foreca # Log set of charge and discharge windows if self.calculate_best_charge: self.log( - "Best charge windows in price group {} best_metric {} best_cost {} metric_keep {} windows {}".format( - price, + "Best charge windows best_metric {} best_cost {} metric_keep {} windows {}".format( self.dp2(best_metric), self.dp2(best_cost), self.dp2(best_keep), @@ -7902,8 +7901,7 @@ def optimise_all_windows(self, load_minutes_step, load_minutes_step10, pv_foreca if self.calculate_best_discharge: self.log( - "Best discharge windows in price group {} best_metric {} best_cost {} metric_keep {} windows {}".format( - price, + "Best discharge windows best_metric {} best_cost {} metric_keep {} windows {}".format( self.dp2(best_metric), self.dp2(best_cost), self.dp2(best_keep), @@ -10612,4 +10610,4 @@ def run_time_loop_balance(self, cb_args): except Exception as e: self.log("ERROR: Exception raised {}".format(e)) self.record_status("ERROR: Exception raised {}".format(e)) - raise e + raise e \ No newline at end of file From a767a9a3cd61a9e3a14357eeddd41dfcf56d920e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 19:55:53 +0000 Subject: [PATCH 2/2] [pre-commit.ci lite] apply automatic fixes --- apps/predbat/predbat.py | 2 +- docs/apps-yaml.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index 04115ebd3..7c53cb7d6 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -10610,4 +10610,4 @@ def run_time_loop_balance(self, cb_args): except Exception as e: self.log("ERROR: Exception raised {}".format(e)) self.record_status("ERROR: Exception raised {}".format(e)) - raise e \ No newline at end of file + raise e diff --git a/docs/apps-yaml.md b/docs/apps-yaml.md index 4e72f05c9..8933ab5b7 100644 --- a/docs/apps-yaml.md +++ b/docs/apps-yaml.md @@ -324,9 +324,9 @@ To make planned car charging more accurate, configure the following items in `ap Multiple cars can be planned with Predbat, in which case you should set **num_cars** in `apps.yaml` to the number of cars you want to plan - **car_charging_limit**, **car_charging_planned**, **car_charging_battery_size** and **car_charging_soc** must then be a list of values (i.e. 2 entries for 2 cars) - + - If you have Intelligent Octopus then Car 0 will be managed by the Octopus Energy integration, if its enabled - + - Each car will have it's own Home Assistant slot sensor created e.g. **binary_sensor.predbat_car_charging_slot_1**, SOC planning sensor e.g **predbat.car_soc_1** and **predbat.car_soc_best_1** for car 1