gekro
GitHub LinkedIn
EV

Tesla Charge Optimizer

Time-of-use rate schedule + battery + departure → cheapest contiguous charging window.

Vehicle

Charge plan

Time-of-use rates ($/kWh)

Set the price per kWh for each hour of the day. Click an hour-block to edit it. Default below is a common 3-tier TOU pattern.

Cheapest charge cost

$—

Optimal start
Optimal end
Duration
Energy delivered
Avg rate

If you charged immediately

Cost (no optimization)$—
Savings by timing$—
Monthly savings (30 cycles)$—

Schedule

Assumes constant kW from plug-in to target (Tesla and most EVs do this until ~80%, then taper). Real charging tapers above 80%, slightly extending the window. Schedule shown in Tesla / EVCC / Home Assistant format.

As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.

© 2026 Rohit Burani · MIT · Built at gekro.com · View source ↗

Guide

What It Does

Most EVs let you schedule charging start time but DON’T know your utility’s time-of-use rates. This tool bridges that gap:

  1. Pick your vehicle (or set custom battery + charger rate)
  2. Set current SoC + target SoC
  3. Pick plug-in time + departure time
  4. Set hourly rates (preset or custom — click any hour to edit)

You get: the cheapest contiguous charging window, dollar savings vs charging immediately, and a copy-pasteable schedule for Tesla / Home Assistant / EVCC / OpenEVSE.

Rate Presets Included

  • PG&E EV2-A — California, common Tesla owner default. ~$0.31 off-peak / $0.61 peak (4-9pm)
  • SCE TOU-D-PRIME — Southern California. ~$0.26 super-off-peak / $0.54 peak (4-9pm)
  • ERCOT flat — Texas reference flat rate ~$0.13/kWh
  • TXU Free Nights — Texas plan with free charging 8pm-6am
  • Solar self-consumption — Cheap midday from rooftop solar, expensive overnight

Click “Custom” and edit any hour to match your specific plan.

Algorithm

For a needed energy E = battery × (target - current) / 100 / efficiency, charging duration is D = E / charge_rate kW. We sweep start times from plug-in to (depart - D) in 5-minute increments. For each candidate start, sum the cost across hour-block boundaries:

for hour-segment from start to start+D:
  segment_cost = rate[floor(hour) % 24] × charge_rate × segment_duration
total_cost = sum(segment_costs)

Pick the start time with lowest total_cost. O(N) in number of 5-minute slots — fast enough to recompute on every input change.

Limitations

  • Assumes constant kW charging — real EVs taper above ~80% SoC. Above 80% target, expect 5-15 more minutes than the calculator estimates.
  • No demand charges — commercial / industrial TOU plans sometimes also charge for peak kW pulled. Not modelled.
  • Tesla supercharger pricing is location-dependent and not in scope — this is for home charging.
  • 5-minute resolution — most utilities bill at the hour, so this is fine.

For informational purposes only. Not financial, medical, or legal advice. You are solely responsible for how you use these tools.