tesla-fleet-api

Use when integrating with Tesla's official Fleet API to read vehicle/energy device data or issue remote commands (e.g. start HVAC preconditioning, wake vehicle, charge controls). Covers onboarding (developer app registration, regions/base URLs), OAuth token flows (third-party + partner tokens, refre

By odrobnik · 698 installs

npx skills add odrobnik/tesla-fleet-api-skill --skill tesla-fleet-api

Source repository · Upstream listing

Tesla Fleet API Control Tesla vehicles via the official Fleet API. Scripts Overview Script Purpose command.py Vehicle commands (climate, charging, locks, etc.) vehicle data.py Read vehicle data (battery, climate, location, etc.) vehicles.py List vehicles + refresh cache auth.py Authentication and configuration tesla oauth local.py OAuth helper with local callback server start proxy.sh Start the signing proxy (for vehicle commands) stop proxy.sh Stop the signing proxy Setup / Configuration Setup is documented in SETUP.md : [SETUP.md](SETUP.md) State directory: {workspace}/tesla fleet api/ config.json (provider creds + non token config) auth.json (tokens) vehicles.json (cached vehicle list) places.json (named locations) proxy/ (TLS material for signing proxy) No .env file loading — credentials in config.json or environment variables. command.py Vehicle Commands Execute commands on your Tesla. Vehicle is auto selected if you only have one. Usage VEHICLE Vehicle name or VIN (optional if single vehicle) Commands can be run without specifying vehicle: command.py honk Or with vehicle name: command.py flash honk (vehicle "flash", command "honk") Climate Control Start/Stop Climate Set Temperature Climate Keeper Mode Modes: off , keep , dog , camp Seat Heater Levels: Value Name 0 off 1 low 2 medium 3 high Positions: Value Names 0 driver , front left , fl 1 passenger , front right , fr 2 rear left , rl 3 rear left back 4 rear center , rc 5 rear right , rr 6 rear right back 7 third left 8 third right Examples: Seat Cooler (Ventilation) Same levels and positions as seat heater. Examples: Seat Auto Climate Modes: auto , on , off Examples: Steering Wheel Heater Examples: Precondition Schedules Modern API for scheduling departure preconditioning (replaces deprecated set scheduled departure ). Add Schedule Days options: Value Description all Every day (default) weekdays Monday through Friday weekends Saturday and Sunday mon,tue,wed,... Specific days (comma separated) Day names: sun , mon , tue , wed , thu , fri , sat (or full names) Examples: Remove Schedule Examples: Charging Control Start/Stop Charging Set Charge Limit Percent must be 50 100. Examples: Doors & Security With vehicle name: vehicle data.py Read Vehicle Data Fetch vehicle data with human readable output by default. Usage VEHICLE Vehicle name or VIN (optional if single vehicle) No flags = all data json = raw JSON output Flags Flag Long Data c charge Battery level, charge limit, charging status t climate Interior/exterior temp, HVAC status d drive Gear, speed, power, heading l location GPS coordinates s state Locks, doors, windows, odometer, software g gui GUI settings (units, 24h time) config data Vehicle config (model, color, wheels) Examples Sample Output auth.py Authentication Manage OAuth tokens and configuration. Usage Commands Login (OAuth Flow) Interactive: generates auth URL, prompts for code, exchanges for tokens. Exchange Code Exchange authorization code for tokens (non interactive). Refresh Tokens Refresh access token. Note: refresh tokens rotate the new one is saved automatically. Register Domain Register your app domain with Tesla (required for signed commands). After registration, enroll your virtual key: Show Config Display current configuration (secrets redacted). Set Config Options: client id <id client secret <secret redirect uri <uri audience <url base url <url ca cert <path domain <domain Examples: tesla fleet.py List Vehicles List vehicles with human readable output. Sample Output Configuration / Proxy / File layout All setup + configuration is documented in [SETUP.md](SETUP.md) . Regional Base URLs Region Audience URL Europe https://fleet api.prd.eu.vn.cloud.tesla.com North America https://fleet api.prd.na.vn.cloud.tesla.com China https://fleet api.prd.cn.vn.cloud.tesla.cn OAuth token endpoint (all regions): Troubleshooting "vehicle unavailable: vehicle is offline or asleep" Wake the vehicle first: "command not signed" / "vehicle rejected" Ensure the signing proxy is running and configured. See [SETUP.md](SETUP.md) § Proxy Setup. Token expired Multiple vehicles Specify vehicle by name or VIN: Complete Command Reference command.py vehicle data.py auth.py