- name
- tesla
- version
- 3.0.0
- description
- Complete Tesla Fleet API control - all 66 vehicle commands, energy/Powerwall management, vehicle sharing, charging history, navigation, media, V2G/Powershare, and multi-vehicle management from the terminal.
- author
- mvanhorn
- license
- MIT
- repository
- https://github.com/mvanhorn/clawdbot-skill-tesla
- homepage
- https://developer.tesla.com/docs/fleet-api
- metadata
- {"openclaw":{"emoji":"🚗","requires":{"env":"[Truncated]"},"primaryEnv":"TESLA_EMAIL","tags":["tesla","vehicle","iot","fleet-api","electric-vehicle","ev","charging","supercharger","powerwall","solar","energy","automotive","cybertruck","v2g","powershare","navigation","media"],"triggers":["tesla","my car","my vehicle","battery level","charge status","lock my car","unlock my car","car location","where is my car","climate control","precondition","supercharger","powerwall","solar panels","energy usage","fleet api","honk horn","flash lights","charge my car","sentry mode","valet mode","dog mode","camp mode","navigate to","media controls","seat heater","steering wheel heater","charge history","share my car","guest mode","speed limit","software update","[Truncated]"]}}
# Tesla
Complete Tesla Fleet API control from OpenClaw. All 66 vehicle commands, energy/Powerwall management, vehicle sharing, charging history, navigation, media controls, V2G/Powershare, and multi-vehicle management.
> **Fleet API (2026):** Tesla has deprecated the legacy Owner API. All vehicles now use the Fleet API at
> `fleet-api.prd.na.vn.cloud.tesla.com`. Vehicles on firmware 2024.26+ require the Vehicle Command Protocol
> (VCP). The `tesla-fleet-api` Python package handles both paths automatically.
---
## Setup
### Prerequisites
- Python 3.10+
- A Tesla account with at least one vehicle, Powerwall, or solar system
- `TESLA_EMAIL` environment variable set to your Tesla account email
### First-time authentication
```bash
TESLA_EMAIL="you@email.com" python3 {baseDir}/scripts/tesla.py auth
```
Steps:
1. The script displays a Tesla login URL
2. Open it in your browser, sign in, and authorize the application
3. Copy the callback URL from your browser's address bar (starts with `https://auth.tesla.com/void/callback?...`)
4. Paste it back into the terminal
5. Token is cached at `~/.tesla_cache.json` for ~30 days with automatic refresh
### Environment variables
| Variable | Required | Description |
|---|---|---|
| `TESLA_EMAIL` | Yes | Your Tesla account email address |
Token storage: `~/.tesla_cache.json` (auto-created on first auth, auto-refreshes)
---
## Vehicle Command Protocol (VCP)
Vehicles running firmware 2024.26 or later require VCP for sending commands. Without VCP configured, status queries will work but commands (lock, unlock, climate, charge start/stop) will fail with a `vehicle_command_protocol_required` error.
### How to check if VCP is needed
```bash
python3 {baseDir}/scripts/tesla.py status
```
If you see a VCP error in the output, your vehicle needs VCP setup.
### VCP setup
1. Generate a public/private key pair on your machine:
```bash
openssl ecparam -name prime256v1 -genkey -noout -out private_key.pem
openssl ec -in private_key.pem -pubout -out public_key.pem
```
2. Register your public key with Tesla's servers. This requires creating a third-party application at https://developer.tesla.com/ and uploading your `public_key.pem` to a `.well-known` endpoint on your registered domain.
3. Pair your key with each vehicle. Sit inside the vehicle with the key card on the center console, then run:
```bash
python3 {baseDir}/scripts/tesla.py vcp-pair --key private_key.pem
```
Tap "Approve" on the vehicle's touchscreen when prompted.
4. Once paired, commands are end-to-end encrypted between your machine and the vehicle. The `tesla-fleet-api` package handles signing automatically when it finds your key.
> **Note:** If you are only reading vehicle data (status, location, charge state), VCP is not required. VCP is only needed for sending commands.
---
## Dashboard
Get a unified view of all your vehicles in one command:
```bash
python3 {baseDir}/scripts/tesla.py dashboard
```
Output includes for each vehicle:
- Name, model, and state (online/asleep/offline)
- Battery level and estimated range
- Charging state and time remaining (if charging)
- Location as a human-readable address (reverse geocoded from GPS)
- Lock status (locked/unlocked)
- Climate state (on/off, cabin temperature)
- Software version and any pending updates
- Sentry mode status
Example output:
```
--- Dashboard ---
1. Snowflake (Model Y - Online)
Battery: 78% (245 mi) Charging: Not charging
Location: 4521 Mercer Way, Mercer Island, WA 98040
Locked: Yes Sentry: On Climate: Off (68F inside)
Software: 2025.48.3 (up to date)
2. Stella (Model 3 - Asleep)
Battery: 92% (310 mi) Charging: Complete
Location: 1200 NE 45th St, Seattle, WA 98105
Locked: Yes Sentry: Off Climate: Off
Software: 2025.48.3 (update available: 2025.50.1)
```
---
## Multi-Vehicle Management
### List all vehicles
```bash
python3 {baseDir}/scripts/tesla.py list
```
Shows all vehicles on your account with name, VIN, model, state, and battery level.
### Select a specific vehicle
Use `--car` or `-c` with any command to target a specific vehicle by its display name:
```bash
python3 {baseDir}/scripts/tesla.py --car "Snowflake" status
python3 {baseDir}/scripts/tesla.py -c "Stella" lock
python3 {baseDir}/scripts/tesla.py --car "Snowflake" climate on
```
Without `--car`, commands target your first vehicle.
### Set a default vehicle
If you have multiple vehicles and mostly control one, set a default:
```bash
python3 {baseDir}/scripts/tesla.py set-default "Stella"
```
The default persists in `~/.tesla_cache.json`. Override it anytime with `--car`.
---
## Vehicle Commands Reference (66 commands)
### Doors and Access
```bash
# Lock/unlock
python3 {baseDir}/scripts/tesla.py lock # door_lock
python3 {baseDir}/scripts/tesla.py unlock # door_unlock
# Trunk and frunk (actuate_trunk)
python3 {baseDir}/scripts/tesla.py trunk open # actuate_trunk rear
python3 {baseDir}/scripts/tesla.py frunk open # actuate_trunk front
# Windows (window_control)
python3 {baseDir}/scripts/tesla.py windows vent # Vent all windows
python3 {baseDir}/scripts/tesla.py windows close # Close all windows
# Sunroof (sun_roof_control) - vehicles with panoramic sunroof
python3 {baseDir}/scripts/tesla.py sunroof vent # Vent sunroof
python3 {baseDir}/scripts/tesla.py sunroof close # Close sunroof
# HomeLink (trigger_homelink) - garage door
python3 {baseDir}/scripts/tesla.py homelink # Trigger nearest HomeLink device
python3 {baseDir}/scripts/tesla.py homelink --lat 47.57 --lon -122.22 # Trigger at specific location
```
Fleet API endpoints: `door_lock`, `door_unlock`, `actuate_trunk`, `window_control`, `sun_roof_control`, `trigger_homelink`
### Charging
```bash
# Basic charging
python3 {baseDir}/scripts/tesla.py charge start # charge_start
python3 {baseDir}/scripts/tesla.py charge stop # charge_stop
python3 {baseDir}/scripts/tesla.py charge status # GET charge_state
# Charge port
python3 {baseDir}/scripts/tesla.py charge port-open # charge_port_door_open
python3 {baseDir}/scripts/tesla.py charge port-close # charge_port_door_close
# Charge limit
python3 {baseDir}/scripts/tesla.py charge limit 80 # set_charge_limit (percentage)
python3 {baseDir}/scripts/tesla.py charge limit standard # charge_standard (daily limit)
python3 {baseDir}/scripts/tesla.py charge limit max # charge_max_range (trip limit)
# Charging amps (set_charging_amps) - limit current draw
python3 {baseDir}/scripts/tesla.py charge amps 32 # Set to 32A
python3 {baseDir}/scripts/tesla.py charge amps 16 # Set to 16A (reduce for shared circuits)
# Charge schedules (NEW - replaces deprecated set_scheduled_charging)
python3 {baseDir}/scripts/tesla.py charge schedule add 23:00 06:00 # add_charge_schedule (off-peak window)
python3 {baseDir}/scripts/tesla.py charge schedule add 01:00 05:00 --days mon,tue,wed,thu,fri
python3 {baseDir}/scripts/tesla.py charge schedule remove 1 # remove_charge_schedule (by schedule ID)
python3 {baseDir}/scripts/tesla.py charge schedule list # List active charge schedules
```
Fleet API endpoints: `charge_start`, `charge_stop`, `charge_port_door_open`, `charge_port_door_close`, `charge_standard`, `charge_max_range`, `set_charge_limit`, `set_charging_amps`, `add_charge_schedule`, `remove_charge_schedule`
> **Deprecation:** `set_scheduled_charging` is deprecated. Use `add_charge_schedule` / `remove_charge_schedule` instead.
### Climate
```bash
# On/off (auto_conditioning_start / auto_conditioning_stop)
python3 {baseDir}/scripts/tesla.py climate on
python3 {baseDir}/scripts/tesla.py climate off
# Temperature (set_temps)
python3 {baseDir}/scripts/tesla.py climate temp 72 # Fahrenheit (default)
python3 {baseDir}/scripts/tesla.py climate temp 22 --celsius # Celsius
python3 {baseDir}/scripts/tesla.py climate temp 72 --driver-only # Driver side only
# Max preconditioning (set_preconditioning_max)
python3 {baseDir}/scripts/tesla.py climate max-precondition on # Maximum defrost/heat
python3 {baseDir}/scripts/tesla.py climate max-precondition off
# Precondition schedules (NEW - replaces deprecated set_scheduled_departure)
python3 {baseDir}/scripts/tesla.py climate schedule add 07:30 # add_precondition_schedule
python3 {baseDir}/scripts/tesla.py climate schedule add 07:30 --days weekdays
python3 {baseDir}/scripts/tesla.py climate schedule remove 1 # remove_precondition_schedule
python3 {baseDir}/scripts/tesla.py climate schedule list
# Seat heater (remote_seat_heater_request) - 0=off, 1=low, 2=medium, 3=high
python3 {baseDir}/scripts/tesla.py climate seat-heater driver 2
python3 {baseDir}/scripts/tesla.py climate seat-heater passenger 1
python3 {baseDir}/scripts/tesla.py climate seat-heater rear-left 3
python3 {baseDir}/scripts/tesla.py climate seat-heater rear-center 1
python3 {baseDir}/scripts/tesla.py climate seat-heater rear-right 2
# Seat cooler (remote_seat_cooler_request) - vehicles with ventilated seats
python3 {baseDir}/scripts/tesla.py climate seat-cooler driver 2
python3 {baseDir}/scripts/tesla.py climate seat-cooler passenger 1
# Steering wheel heater (remote_steering_wheel_heater_request)
python3 {baseDir}/scripts/tesla.py climate steering-heater on
python3 {baseDir}/scripts/tesla.py climate steering-heater off
# Bioweapon defense mode (set_bioweapon_mode) - vehicles with HEPA filter
python3 {baseDir}/scripts/tesla.py climate bioweapon on
python3 {baseDir}/scripts/tesla.py climate bioweapon off
# Cabin overheat protection (set_cabin_overheat_protection)
python3 {baseDir}/scripts/tesla.py climate overheat-protection on
python3 {baseDir}/scripts/tesla.py climate overheat-protection off
python3 {baseDir}/scripts/tesla.py climate overheat-protection fan-only # No AC, fan only
# Climate keeper mode (set_climate_keeper_mode)
python3 {baseDir}/scripts/tesla.py climate keeper off # Off
python3 {baseDir}/scripts/tesla.py climate keeper keep # Keep climate on
python3 {baseDir}/scripts/tesla.py climate keeper dog # Dog mode (display shows temp)
python3 {baseDir}/scripts/tesla.py climate keeper camp # Camp mode (media + climate)
```
Fleet API endpoints: `auto_conditioning_start`, `auto_conditioning_stop`, `set_temps`, `set_preconditioning_max`, `add_precondition_schedule`, `remove_precondition_schedule`, `remote_seat_heater_request`, `remote_seat_cooler_request`, `remote_steering_wheel_heater_request`, `set_bioweapon_mode`, `set_cabin_overheat_protection`, `set_climate_keeper_mode`
> **Deprecation:** `set_scheduled_departure` is deprecated. Use `add_precondition_schedule` / `remove_precondition_schedule` instead.
### Security
```bash
# Sentry mode (set_sentry_mode)
python3 {baseDir}/scripts/tesla.py sentry on
python3 {baseDir}/scripts/tesla.py sentry off
# Valet mode (set_valet_mode)
python3 {baseDir}/scripts/tesla.py valet on # Enable valet mode
python3 {baseDir}/scripts/tesla.py valet on --pin 1234 # Enable with PIN
python3 {baseDir}/scripts/tesla.py valet off --pin 1234 # Disable with PIN
# Reset valet PIN (reset_valet_pin)
python3 {baseDir}/scripts/tesla.py valet reset-pin
# PIN to drive (set_pin_to_drive)
python3 {baseDir}/scripts/tesla.py pin-to-drive on --pin 1234 # Require PIN to shift out of park
python3 {baseDir}/scripts/tesla.py pin-to-drive off --pin 1234
# Speed limit (speed_limit_activate / speed_limit_deactivate / speed_limit_set_limit)
python3 {baseDir}/scripts/tesla.py speed-limit set 70 # Set limit to 70 mph (50-90 mph range)
python3 {baseDir}/scripts/tesla.py speed-limit activate --pin 1234
python3 {baseDir}/scripts/tesla.py speed-limit deactivate --pin 1234
# Guest mode (guest_mode)
python3 {baseDir}/scripts/tesla.py guest-mode on # Enable guest restrictions
python3 {baseDir}/scripts/tesla.py guest-mode off
# Remote start drive (remote_start_drive) - start without key for 2 minutes
python3 {baseDir}/scripts/tesla.py remote-start
# Erase user data (erase_user_data) - factory reset personal data
python3 {baseDir}/scripts/tesla.py erase-data --confirm # Requires --confirm flag
```
Fleet API endpoints: `set_sentry_mode`, `set_valet_mode`, `reset_valet_pin`, `set_pin_to_drive`, `speed_limit_activate`, `speed_limit_deactivate`, `speed_limit_set_limit`, `guest_mode`, `remote_start_drive`, `erase_user_data`
### Navigation
```bash
# Navigate to address (navigation_request)
python3 {baseDir}/scripts/tesla.py navigate "1600 Amphitheatre Parkway, Mountain View, CA"
# Navigate to GPS coordinates (navigation_gps_request)
python3 {baseDir}/scripts/tesla.py navigate --gps 47.6062 -122.3321
# Navigate to nearest Supercharger (navigation_sc_request)
python3 {baseDir}/scripts/tesla.py navigate --supercharger
python3 {baseDir}/scripts/tesla.py navigate --supercharger "Bellevue" # Specific Supercharger
# Multi-stop route (navigation_waypoints_request)
python3 {baseDir}/scripts/tesla.py navigate --waypoints "Seattle, WA" "Portland, OR" "San Francisco, CA"
```
Fleet API endpoints: `navigation_request`, `navigation_gps_request`, `navigation_sc_request`, `navigation_waypoints_request`
### Media
```bash
# Playback
python3 {baseDir}/scripts/tesla.py media play # media_toggle_playback (play/pause)
python3 {baseDir}/scripts/tesla.py media pause # media_toggle_playback
# Track navigation
python3 {baseDir}/scripts/tesla.py media next # media_next_track
python3 {baseDir}/scripts/tesla.py media prev # media_prev_track
# Favorites
python3 {baseDir}/scripts/tesla.py media next-fav # media_next_fav
python3 {baseDir}/scripts/tesla.py media prev-fav # media_prev_fav
# Volume
python3 {baseDir}/scripts/tesla.py media volume up # adjust_volume (increment)
python3 {baseDir}/scripts/tesla.py media volume down # media_volume_down
python3 {baseDir}/scripts/tesla.py media volume 7 # adjust_volume (absolute, 0-11)
```
Fleet API endpoints: `media_toggle_playback`, `media_next_track`, `media_prev_track`, `media_next_fav`, `media_prev_fav`, `media_volume_down`, `adjust_volume`
Voir sur GitHub