Skip to main content

EV Charging Optimizer

The EVChargingScheduler determines the optimal charging power for each vehicle at each time slot, minimizing total energy cost while respecting site capacity, charger limits, vehicle availability, and priority ordering.

How It Works

The optimizer uses a greedy LP-relaxation approach:
  1. Availability matrix — For each session × time slot, determine if the vehicle is present
  2. Effective cost — Combine energy price and carbon intensity with configurable weights
  3. Priority ordering — Process urgent vehicles first, then by earliest departure
  4. Slot filling — For each vehicle, fill cheapest available slots until energy need is met
  5. Capacity tracking — Deduct allocated power from remaining site headroom

Configuration

Charging Sessions

Each EV is described by a ChargingSession:

Priority Levels

Tariff Integration

The scheduler natively consumes Qubit tariff schemas:
Tariff schedules support:
  • Time-of-use windowsstart_time / end_time in HH:MM format
  • Weekday filteringweekdays array (e.g., ["monday", "tuesday"])
  • Monthly filteringmonths array (e.g., [6, 7, 8] for summer)
  • Carbon intensitycarbon_intensity_gco2_kwh per rate period

Running an Optimization

Result Structure

The OptimizationResult contains:

Schedule Columns

Constraint Enforcement

The scheduler enforces several hard constraints:
Total EV charging power plus background load minus solar never exceeds the site transformer rating. The optimizer tracks remaining headroom at each slot and caps allocation accordingly.
Each vehicle’s charge rate is capped at the minimum of its onboard charger limit and the EVSE port capacity (charger_capacity_kw).
Charging only occurs during the arrival-to-departure window. No power is allocated outside these bounds.
The optimizer attempts to deliver the full energy_needed_kwh for each session. If constraints prevent this (e.g., too many vehicles competing for limited capacity), the result status changes from “optimal” to “feasible”.

Carbon-Aware Scheduling

Enable carbon-conscious scheduling by adjusting objective weights:
The effective cost becomes: 0.5 * price + 0.5 * carbon_intensity, shifting charging toward lower-carbon periods.

Next Steps

Peak Shaving

Combine EV scheduling with battery dispatch for demand management

Getting Started

Full installation and quickstart guide