scher.nl
← All projects Personal project · November 2026

Smart charging

A home-made charging assistant for our Tesla Model Y. With a dynamic energy contract the price of power changes every quarter hour. The app charges the car when power is cheap, charges on surplus solar power and sets the charge limit in the car itself. Built with Claude Code, on the home server.

Try the demo (in Dutch) →
Prices per day
96
Connections
5
Charge limit
80 · 90%
Cost per month
€ 0
The Current screen of Smart charging in the demo: the status of the car, the battery and charge limit, and a bar chart with the power price per quarter hour for today and tomorrow. The cheapest quarters at night and around noon are coloured green.
The Current screen in the demo, with made-up data. Green marks the quarters in which the app lets the car charge.
At a glance

Prices, sun and car together

The app on the home server fetches the power prices every day and hears from the car, the inverter and the smart meter how things stand. Every quarter hour it decides whether the car charges, and up to which percentage. It sends that to the car as a command. On my phone I can see what it does.

How Smart charging works Five sources feed data to the app on the home server: the Tesla via Fleet Telemetry, the power prices from EnergyZero, the GoodWe inverter, the HomeWizard P1 meter and the weather from Open-Meteo. The app works per quarter hour and stores everything in a database. It sends commands to the car, can be opened on the phone via Tailscale and can send notifications with ntfy. HOME SERVER Teslalive telemetry EnergyZeroprice per hour GoodWeevery 30-60 s P1 meterevery second Open-Meteoweather tomorrow Smart chargingdecides per quarter DatabaseSQLite Carlimit, start, stop Phonevia Tailscale ntfynotification
The approach

From plan to a car that charges itself

Claude wrote the plan, the code and the explanations in the app. I chose what the app is allowed to do, the percentages and when it leaves the car alone. Every change went into the repository as a pull request, and I tested with the real car in the driveway.

  1. 1

    A plan first

    Claude

    Off-the-shelf services can do a lot, but they don't know my contract, panels and meter. Claude wrote a plan in phases: first the connections, then watching along, and only then taking control. The calendar link and fast charging on the road were dropped; they added too little.

  2. 2

    Our own link with the car

    Tesla Fleet API

    The app is registered with Tesla on scher.nl and has its own digital key in the car. The car streams live data to our own Fleet Telemetry server. At home on wifi that doesn't always work; then the app asks the car itself, without waking it.

  3. 3

    Working per quarter hour

    EnergyZero

    The hourly prices come from EnergyZero, for today and from 13:00 also for tomorrow. The app converts them into the ANWB price: market price plus VAT, purchase costs and energy tax. Target charging charges to 80% in the cheapest hours. Opportunity charging raises the limit to 90% when the price drops below a threshold.

  4. 4

    Charging on our own sun

    HomeWizard

    The P1 meter measures every second what the house draws or feeds back. If there is enough surplus for five minutes, the app starts charging and matches the charging current to the surplus. To spare the car it changes the current at most once every 4 minutes, and only for a difference of more than 250 W.

  5. 5

    Watching along first

    Shadow mode

    Before the app was allowed to control the car, it only calculated along: what would each charging method have cost for my own charging sessions? Now the history shows for every session what charging right after plugging in would have cost, and how much the app saved.

  6. 6

    What's next

    In progress

    Notifications via ntfy and a weather strategy with Open-Meteo have been built, but are not switched on yet. When it freezes, the app charges the last hour just before departure, so the battery is warm. When tomorrow will be sunny, it leaves 20 to 30% room overnight for our own solar power.

Agreements

Ground rules for the app

Why a demo with made-up data The real app shows where the car is and when nobody is home. That doesn't belong on a public website. The demo is the same app, but the prices, trips and meter readings are made up.
Under the hood

What's inside

PartChoice
AppPython with FastAPI in Docker on the home server
CarTesla Fleet API and Fleet Telemetry, own virtual key, commands via the tesla-http-proxy
PricesEnergyZero (public, per hour), with ANWB surcharges set by me; calculated per quarter hour
SolarGoodWe GW3600T-DS, 3.8 kWp, read locally
GridHomeWizard P1 meter, local API
WeatherOpen-Meteo, free and without a key
StorageSQLite: prices per quarter hour and the car every minute
Web appCurrent, History and API, own SVG charts, scher.nl house style, only via Tailscale
Try it yourself

Click through the demo

The demo is the same app as on the server, with a made-up year of prices, trips and charging sessions. Pick another method under Settings and see which quarters turn green, browse the days under History or see under API which data a Tesla can pass on. Nothing goes to a car or server. The app itself is in Dutch.

Open the demo (in Dutch) →

Updated 21 November 2026.