From 72d8cd0f83a553d3cce62e5fdc9e6c0752305073 Mon Sep 17 00:00:00 2001 From: Rik Allen Date: Sun, 2 Aug 2026 16:28:06 +0100 Subject: [PATCH 1/2] fix(car-charging): car charging limit logs showed a kWh value labelled as % car_charging_limit and car_charging_soc are converted from the user's configured percent into kWh internally, but three debug log lines still labelled the (by-then kWh) limit value with a "%" suffix - a cosmetic mislabel, not a functional bug (spotted while investigating #4416). Now logs the limit as both a percent (recomputed from the kWh value and battery size, matching how users actually think about a charge target) and the underlying kWh figure, e.g. "limit 80% (61.6kWh)". Related to #4416 --- apps/predbat/fetch.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/predbat/fetch.py b/apps/predbat/fetch.py index a82260378..d77685318 100644 --- a/apps/predbat/fetch.py +++ b/apps/predbat/fetch.py @@ -1122,13 +1122,15 @@ def fetch_sensor_data_car_planning(self): else: self.log("Car {} on Octopus Intelligent, no active plan".format(car_n)) elif self.car_charging_planned[car_n] or self.car_charging_now[car_n]: + limit_percent = dp1(self.car_charging_limit[car_n] / self.car_charging_battery_size[car_n] * 100) if self.car_charging_battery_size[car_n] else 0 self.log( - "Car {} plan charging from {} to {}, with slots {} from SoC {}% to {}%, ready by {}".format( + "Car {} plan charging from {} to {}, with slots {} from SoC {}kWh to {}% ({}kWh), ready by {}".format( car_n, self.car_charging_soc[car_n], self.car_charging_limit[car_n], self.low_rates, self.car_charging_soc[car_n], + limit_percent, self.car_charging_limit[car_n], self.car_charging_plan_time[car_n], ) @@ -1286,7 +1288,8 @@ def fetch_sensor_data_cars(self): # Log final car SoC (initialised before the IOG loop, updated per-car after Octopus battery_size is read) if self.num_cars: - self.log("Cars: SoC: {}kWh, Charge limit {}%, plan time {}, battery size {}kWh".format(self.car_charging_soc, self.car_charging_limit, self.car_charging_plan_time, self.car_charging_battery_size)) + car_charging_limit_percent = [dp1(limit / size * 100) if size else 0 for limit, size in zip(self.car_charging_limit, self.car_charging_battery_size)] + self.log("Cars: SoC: {}kWh, Charge limit {}% ({}kWh), plan time {}, battery size {}kWh".format(self.car_charging_soc, car_charging_limit_percent, self.car_charging_limit, self.car_charging_plan_time, self.car_charging_battery_size)) def fetch_pv_forecast(self): """ @@ -1979,8 +1982,9 @@ def get_car_charging_planned(self): self.car_charging_exclusive[car_n] = self.get_arg("car_charging_exclusive", False, index=car_n) if self.num_cars > 0: + car_charging_limit_percent = [dp1(limit / size * 100) if size else 0 for limit, size in zip(self.car_charging_limit, self.car_charging_battery_size)] self.log( - "Cars {} charging from battery {} planned {}, charging_now {} smart {}, max_price {}{}, plan_time {}, battery size {}kWh, limit {}%, rate {}kW, exclusive {}".format( + "Cars {} charging from battery {} planned {}, charging_now {} smart {}, max_price {}{}, plan_time {}, battery size {}kWh, limit {}% ({}kWh), rate {}kW, exclusive {}".format( self.num_cars, self.car_charging_from_battery, self.car_charging_planned, @@ -1990,6 +1994,7 @@ def get_car_charging_planned(self): self.currency_symbols[1], self.car_charging_plan_time, self.car_charging_battery_size, + car_charging_limit_percent, self.car_charging_limit, self.car_charging_rate, self.car_charging_exclusive, From d7e3d9c629ab82c0335aaf059275c3cba53142e4 Mon Sep 17 00:00:00 2001 From: Rik Allen Date: Sun, 2 Aug 2026 20:42:13 +0100 Subject: [PATCH 2/2] fix(car-charging): drop redundant unitless SoC/limit prefix from car plan log Per Copilot review on #4420: the log repeated SoC/limit twice - once with no units (ambiguous, could read as times or percentages) and once with units. Collapsed to a single SoC -> limit expression with explicit units. --- apps/predbat/fetch.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/predbat/fetch.py b/apps/predbat/fetch.py index d77685318..3576d3c5b 100644 --- a/apps/predbat/fetch.py +++ b/apps/predbat/fetch.py @@ -1124,14 +1124,12 @@ def fetch_sensor_data_car_planning(self): elif self.car_charging_planned[car_n] or self.car_charging_now[car_n]: limit_percent = dp1(self.car_charging_limit[car_n] / self.car_charging_battery_size[car_n] * 100) if self.car_charging_battery_size[car_n] else 0 self.log( - "Car {} plan charging from {} to {}, with slots {} from SoC {}kWh to {}% ({}kWh), ready by {}".format( + "Car {} plan charging from {}kWh to {}% ({}kWh), with slots {}, ready by {}".format( car_n, self.car_charging_soc[car_n], - self.car_charging_limit[car_n], - self.low_rates, - self.car_charging_soc[car_n], limit_percent, self.car_charging_limit[car_n], + self.low_rates, self.car_charging_plan_time[car_n], ) )