tesla-fleet-apiUse 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, refresh rotation), required domain/public-key hosting, and using Tesla's official vehicle-command/tesla-http-proxy for signed vehicle commands.
Install via ClawdBot CLI:
clawdbot install odrobnik/tesla-fleet-apiControl Tesla vehicles via the official Fleet API.
| 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 is documented in 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.
Execute commands on your Tesla. Vehicle is auto-selected if you only have one.
command.py [VEHICLE] <command> [options]
VEHICLE - Vehicle name or VIN (optional if single vehicle)command.py honkcommand.py flash honk (vehicle "flash", command "honk")command.py climate start
command.py climate stop
command.py flash climate start # specific vehicle
command.py climate temps <driver_temp> [passenger_temp]
command.py climate temps 21 # both seats 21ยฐC
command.py climate temps 22 20 # driver 22ยฐC, passenger 20ยฐC
command.py climate keeper <mode>
Modes: off, keep, dog, camp
command.py seat-heater --level <level> [--position <position>]
command.py seat-heater -l <level> [-p <position>]
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:
command.py seat-heater -l high # driver (default)
command.py seat-heater -l medium -p passenger
command.py seat-heater --level low --position rear_left
command.py seat-heater -l 2 -p 4 # medium, rear center
command.py seat-heater -l off -p driver # turn off
command.py seat-cooler --level <level> [--position <position>]
command.py seat-cooler -l <level> [-p <position>]
Same levels and positions as seat heater.
Examples:
command.py seat-cooler -l medium -p driver
command.py seat-cooler -l high -p passenger
command.py seat-climate [--position <position>] <mode>
command.py seat-climate [-p <position>] <mode>
Modes: auto, on, off
Examples:
command.py seat-climate auto # driver auto
command.py seat-climate -p passenger auto
command.py seat-climate -p driver off # disable auto
command.py steering-heater <on|off>
Examples:
command.py steering-heater on
command.py steering-heater off
Modern API for scheduling departure preconditioning (replaces deprecated set_scheduled_departure).
command.py precondition add --time <HH:MM> [--days <days>] [--id <id>] [--one-time] [--disabled]
command.py precondition add -t <HH:MM> [-d <days>] [--id <id>]
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:
command.py precondition add -t 08:00 # every day at 8am
command.py precondition add -t 08:00 -d weekdays # Mon-Fri
command.py precondition add -t 07:30 -d mon,wed,fri
command.py precondition add -t 09:00 --one-time # one-time only
command.py precondition add -t 08:30 --id 123 # modify existing schedule
command.py precondition add -t 08:00 --disabled # create but disabled
command.py precondition remove --id <id>
Examples:
command.py precondition remove --id 123
command.py precondition remove --id 1
command.py charge start
command.py charge stop
command.py charge limit <percent>
Percent must be 50-100.
Examples:
command.py charge limit 80
command.py charge limit 90
command.py flash charge limit 70 # specific vehicle
command.py lock # lock all doors
command.py unlock # unlock all doors
command.py honk # honk the horn
command.py flash # flash the lights
command.py wake # wake vehicle from sleep
With vehicle name:
command.py flash wake # wake vehicle named "flash"
command.py flash flash # flash lights on vehicle "flash"
Fetch vehicle data with human-readable output by default.
vehicle_data.py [VEHICLE] [flags] [--json]
VEHICLE - Vehicle name or VIN (optional if single vehicle)--json = raw JSON output| 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) |
# All data
vehicle_data.py
vehicle_data.py flash
# Specific data
vehicle_data.py -c # charge only
vehicle_data.py -c -t # charge + climate
vehicle_data.py flash -c -l # charge + location
# Raw JSON
vehicle_data.py --json
vehicle_data.py -c --json
๐ My Tesla (online)
VIN: 5YJ... (redacted)
โก Charge State
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Battery: [โโโโโโโโโโโโโโโโโโโโ] 78%
Limit: 80%
State: Charging
Power: 11 kW (16A ร 234V ร 3ฯ)
Added: 37.2 kWh
Remaining: 10m
Range: 438 km (272 mi)
Cable: IEC
๐ก๏ธ Climate State
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Inside: 11.9ยฐC
Outside: 6.0ยฐC
Set to: 20.5ยฐC
Climate: Off
Manage OAuth tokens and configuration.
auth.py <command> [options]
auth.py login
Interactive: generates auth URL, prompts for code, exchanges for tokens.
auth.py exchange <code>
Exchange authorization code for tokens (non-interactive).
auth.py refresh
Refresh access token. Note: refresh tokens rotate - the new one is saved automatically.
auth.py register --domain <domain>
Register your app domain with Tesla (required for signed commands).
After registration, enroll your virtual key:
https://tesla.com/_ak/<domain>
auth.py config
Display current configuration (secrets redacted).
auth.py config set [options]
Options:
--client-id --client-secret --redirect-uri --audience --base-url --ca-cert --domain Examples:
# Initial setup
auth.py config set \
--client-id "abc123" \
--client-secret "secret" \
--redirect-uri "http://localhost:18080/callback"
# Configure proxy
auth.py config set \
--base-url "https://localhost:4443" \
--ca-cert "/path/to/tls-cert.pem"
List vehicles with human-readable output.
python3 scripts/tesla_fleet.py vehicles
python3 scripts/tesla_fleet.py vehicles --json
๐ Name: My Tesla
๐ VIN: 5YJ... (redacted)
๐ข Status: Online
๐ค Access: Owner
All setup + configuration is documented in SETUP.md.
| 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):
https://fleet-auth.prd.vn.cloud.tesla.com/oauth2/v3/token
Wake the vehicle first:
command.py wake
Ensure the signing proxy is running and configured. See SETUP.md ยง Proxy Setup.
auth.py refresh
Specify vehicle by name or VIN:
command.py flash climate start
command.py 5YJ... honk
climate start|stop
climate temps <driver> [passenger]
climate keeper off|keep|dog|camp
seat-heater -l <level> [-p <position>]
seat-cooler -l <level> [-p <position>]
seat-climate [-p <position>] auto|on|off
steering-heater on|off
precondition add -t <HH:MM> [-d <days>] [--id <id>] [--one-time]
precondition remove --id <id>
charge start|stop
charge limit <percent>
lock
unlock
honk
flash
wake
[VEHICLE] [-c] [-t] [-d] [-l] [-s] [-g] [--config-data] [--json]
login
exchange <code>
refresh
register --domain <domain>
config
config set [--client-id] [--client-secret] [--redirect-uri] [--audience] [--base-url] [--ca-cert] [--domain]
Generated Mar 1, 2026
Companies managing a fleet of Tesla vehicles for employee use can automate vehicle monitoring, charging schedules, and preconditioning. This ensures vehicles are ready for business trips, optimizes energy costs by charging during off-peak hours, and provides real-time location and battery status for logistics planning.
Homeowners with Tesla vehicles and energy products like Powerwall can use this skill to sync charging with solar production or grid tariffs. It enables automated commands to start charging when excess solar is available or stop during peak rates, reducing electricity bills and supporting grid stability.
Car rental companies or peer-to-peer sharing platforms can remotely manage Tesla fleets, including unlocking vehicles for customers, setting climate controls before pickup, and monitoring battery levels to ensure availability. This enhances customer experience and operational efficiency through automated remote commands.
Urban planners or charging network operators can aggregate vehicle data from multiple Teslas to analyze usage patterns, battery health, and charging demands. This helps in optimizing charger placements, forecasting load on the grid, and developing smarter infrastructure strategies.
Individual Tesla owners can automate daily routines, such as preconditioning the cabin based on departure schedules or adjusting seat heaters via voice assistants. This skill integrates with home automation systems to provide a seamless, hands-free experience for comfort and convenience.
Offer a subscription-based software service that uses this skill to provide fleet management dashboards, automated reporting, and remote command APIs. Revenue comes from monthly fees per vehicle, with tiered plans for small to large fleets, including premium features like predictive maintenance alerts.
License the skill to smart home device manufacturers or service providers, enabling them to embed Tesla control into their apps. Revenue is generated through licensing fees and partnerships, with additional income from custom development for specific integration needs.
Provide consulting services to businesses looking to integrate Tesla Fleet API into their operations, such as logistics companies or energy firms. Revenue streams include project-based fees for setup, configuration, and ongoing support, as well as training workshops for technical teams.
๐ฌ Integration Tip
Ensure proper OAuth token management and secure hosting of required domains and public keys to avoid authentication issues. Use the provided proxy scripts for signed vehicle commands to maintain API compliance.
Control Sonos speakers (discover/status/play/volume/group).
Control Philips Hue lights/scenes via the OpenHue CLI.
Control Eight Sleep pods (status, temperature, alarms, schedules).
BluOS CLI (blu) for discovery, playback, grouping, and volume.
Control Home Assistant smart home devices, run automations, and receive webhook events. Use when controlling lights, switches, climate, scenes, scripts, or any HA entity. Supports bidirectional communication via REST API (outbound) and webhooks (inbound triggers from HA automations).
Control Home Assistant smart home devices using the Assist (Conversation) API. Use this skill when the user wants to control smart home entities - lights, sw...