
Plan MAI----Own plan
To understand this blog post you need to read the post "Keeeping token cost down and evaluation test" and the other posts
MVP plan for Tesla charging scheduler
Problem
Build a lightweight local Docker app that charges a Tesla in the cheapest hours of the day while still reaching a user-defined target battery percentage by a chosen departure time.
Shared understanding
- Primary goal: reach target battery percentage by departure time.
- Cheapest-hours scheduling is the strategy used to achieve that goal.
- Tesla API usage should stay low and configurable, with reads only at defined times (for example 18:00 and 20:00) and commands used for charging control.
- Price data comes from a public Danish electricity price source only.
- The app runs locally in Docker and uses environment variables for secrets.
Proposed approach
- Create a small scheduler service that runs on a timer.
- Fetch Danish electricity prices from a public API.
- Compute the cheapest charging window(s) needed to reach the target battery percentage before departure.
- Use the Tesla API only for command execution (start/stop charging, set charge limit) and for a small number of read operations at configured times.
- Persist the last known state locally so the app can continue planning without requiring a full state refresh every run.
Key components
- Scheduler: decides when to evaluate prices and charging actions.
- Price provider: fetches and normalizes Danish hourly prices.
- Planner: calculates the cheapest charging plan for the target SoC and departure time.
- Tesla client: sends commands and performs limited state reads.
- Config layer: environment variables and optional local config file.
- Storage: local JSON/state file for last known status and plan history.
MVP scope
- One target battery percentage and one departure time per day.
- Configurable read times for Tesla state.
- Docker-based local deployment.
- Basic logging and health check endpoint.
Out of scope for MVP
- Multi-car support.
- Complex user accounts or cloud hosting.
- Price fallback to manual input.
- Advanced forecasting beyond the public price feed.
Implementation order
- Define configuration model and environment variables.
- Implement the price provider integration.
- Implement the charging planner.
- Implement the Tesla command layer and limited state reads.
- Add the scheduler loop and local state persistence.
- Package as Docker and validate the flow end-to-end.
Share this post
Related Posts

Jobseekerv3
A local web chat assistant that turns a job listing into tailored CV and cover-letter PDFs in English and Danish, with evidence-backed review before anything is saved.
August 6, 2026

What do users want from Windows 11
GitHub stars are a countable proxy for demand for workaround tools. Verified means the page was fetched and checked; Cited means the headline/date was confirmed but the article was not directly readable. Reddit and Feedback Hub counts were unavailable because those services blocked automated access.
August 4, 2026

Wincontainer now has MCP server
MCP Server WinContainers exposes a built-in Model Context Protocol (MCP) server so that AI coding assistants (GitHub Copilot, Cursor, Claude, etc.) can manage containers, images, volumes, and networks directly from the editor.
August 3, 2026
Comments
Be the first to leave a comment.