Repository navigation
Consider solar export value when scheduling EV charging #5384
Description
Activity
🤖 Automated first-pass triage — a maintainer will review this before any action is taken.
Classification: enhancement (feature request, so no priority label).
Verified against current main (v9.3.4-2-gde3fea81) — the gap this describes is real:
- With
car_charging_plan_smarton (Predbat-led charging),plan_car_charging()(apps/predbat/plan.py:5906) selects car slots by sorting the low-rate windows cheapest-first and filling until the car target is met. The only price check iscar_charging_plan_max_price, which is an import price cap (plan.py:5954) — the value of solar a slot would divert away from export is never weighed. - The window data this planner already receives carries both rates: each
low_rateswindow holds the import average and the export average (built at fetch.py:1303 viarate_scan_window(..., alt_rates=self.rate_export)), but the car plan reads only the import average (plan.py:5940). The export average is actively used by the iBoost planner (plan.py:5819, 5861), just never by the car planner. - The PV forecast enters only as a light/dark boundary that splits charge windows around dawn (fetch.py:2017, from Low power charge toggle does nothing #4557) — it shapes window boundaries, it plays no part in slot economics.
- Once slots are placed, the household plan's metric does see the car load and its effect on export, so the reported plan cost is honest; the slot selection is the blind part.
Concretely with your numbers: a 1 kWh car slot sitting on PV surplus really costs 12p of forgone export (the surplus would have been exported), while a slot outside daylight costs 7.62p of import. The plan ranks both by 7.62p-import price alone, so a cheap import band that overlaps daylight gets chosen even when exporting that solar and charging later is worth 4.38p/kWh more. The placement is only correct today when PV-hour slots are more expensive to import than the export rate — then diverting solar is genuinely the cheaper option, and the current price sort happens to agree.
Related work — same trade-off, different mechanism (not duplicates):
- PR Charge the car on forecast solar surplus #5195 (open) adds an opt-in sun-following mode (
car_charging_solar): car slots placed on forecast PV surplus first, gated by export rate ≤car_charging_rate_threshold_export. That leans the opposite way (divert solar to the car), and its export-rate threshold is the manual version of the comparison this issue asks to make automatic — with the threshold set below your 12p export, its solar pass would skip PV-hour slots and fall back to the import-price pass, which happens to produce the outcome you want in your case. - PR Add opportunistic solar (sun-following) car charging model #4125 (open) models opportunistic solar charging where an external charger (EVCC, Ohme Solar Boost) stays in control — modelling only, no slot ranking.
- Using up excess solar to dynamically charge EV #632 is the long-standing discussion of dynamically charging the car from excess solar.
- PR Charge car on solar excess #4683 (closed) was the earlier solar-excess scheduling attempt, superseded in intent by Charge the car on forecast solar surplus #5195.
Shape of the change, for maintainer review: a cost-based ranking in
plan_car_charging()where a slot's effective price is the export price on the surplus-PV part it consumes and the import price on the rest — the export average is already in the window dicts, and the surplus-PV sizing would need the PV forecast, which this function doesn't currently receive. The closest existing approximation is settingcar_charging_plan_max_priceto your cheap-band price, which keeps the car out of expensive daytime slots when the cheap band covers the need, but cannot express "PV hours cost export revenue" for bands that overlap daylight.- With
- addedenhancementNew feature or requestNew feature or requestBOT_TRIAGEDHas been through the triage botHas been through the triage bot
on Oct 4, 2026
Is your feature request related to a problem? Please describe.
When EV charging occurs during PV generation, solar that could have been exported may instead be consumed by the EV. In my case, cheap import is 7.62p/kWh while export is 12p/kWh, so it can be more economical to export the solar and charge the EV during a later cheap period.
Describe the solution you’d like
For Predbat-led EV charging, consider the value of lost solar export when selecting charging slots. Where sufficient cheap charging time remains before the required ready time, Predbat could defer EV charging and export the PV instead.
Describe alternatives you’ve considered
I currently use Octopus-led charging and understand Predbat cannot control the slots Octopus provides. Manually avoiding daytime charging is possible, but removes the benefit of automated smart charging.
Additional context
With my tariff, each 1 kWh of PV diverted from a potential 12p/kWh export to avoid 7.62p/kWh import represents a 4.38p/kWh opportunity cost. This feature would therefore mainly benefit users whose export rate is higher than their available cheap EV charging rate.