Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions apps/predbat/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,14 +1122,14 @@ 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 {}kWh to {}% ({}kWh), with slots {}, ready by {}".format(
car_n,
Comment on lines 1126 to 1128

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed - collapsed to a single SoC → limit expression with explicit units (kWh, plus recomputed %), slot list and ready-by time kept as-is. Pushed in d7e3d9c.

self.car_charging_soc[car_n],
limit_percent,
self.car_charging_limit[car_n],
self.low_rates,
self.car_charging_soc[car_n],
self.car_charging_limit[car_n],
self.car_charging_plan_time[car_n],
)
)
Expand Down Expand Up @@ -1286,7 +1286,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):
"""
Expand Down Expand Up @@ -1979,8 +1980,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,
Expand All @@ -1990,6 +1992,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,
Expand Down
Loading