My Tesla
Author: Parth Maniar — @officialpm
A practical Tesla control skill for Clawdbot built on teslapy.
Setup
Requirements
TESLA_EMAIL env var set (your Tesla account email)
- Python 3.10+
First-time authentication
TESLA_EMAIL="you@email.com" python3 {baseDir}/scripts/tesla.py auth
This opens a Tesla login URL. Log in, then paste the callback URL back into the CLI.
- Token cache:
~/.tesla_cache.json (local only; best-effort chmod 0600)
- Optional: set
MY_TESLA_DEFAULT_CAR to a vehicle display name to pick a default car via env var
- Or persist a local default with:
python3 {baseDir}/scripts/tesla.py default-car "Name" (writes ~/.my_tesla.json; best-effort chmod 0600)
Commands
# List vehicles
python3 {baseDir}/scripts/tesla.py list
python3 {baseDir}/scripts/tesla.py list --json # machine-readable, privacy-safe
# Version
python3 {baseDir}/scripts/tesla.py version
python3 {baseDir}/scripts/tesla.py --version
# Debugging
# If something fails unexpectedly, add --debug for a full traceback
# (or set MY_TESLA_DEBUG=1)
python3 {baseDir}/scripts/tesla.py --debug status --no-wake
# Pick a car (optional)
# --car accepts: exact name, partial name (substring match), or a 1-based index from `list`
python3 {baseDir}/scripts/tesla.py --car "Model" status
python3 {baseDir}/scripts/tesla.py --car 1 report
# Set a default car (used when --car is not passed)
python3 {baseDir}/scripts/tesla.py default-car "My Model 3"
# One-line summary (best for chat)
python3 {baseDir}/scripts/tesla.py summary
python3 {baseDir}/scripts/tesla.py summary --no-wake # don't wake a sleeping car
# Summary as JSON (privacy-safe)
# Unlike `status --json`, this emits a small sanitized object (no location).
# Includes `usable_level_percent` when the vehicle reports it.
python3 {baseDir}/scripts/tesla.py summary --json
python3 {baseDir}/scripts/tesla.py summary --json --raw-json # raw vehicle_data (may include location)
# One-screen report (chat friendly, more detail)
# Includes battery/charging/climate + (when available) TPMS tire pressures.
# Includes "Usable battery" when the vehicle reports it (helpful for health/degradation).
# Also includes a quick openings summary (doors/trunk/frunk/windows) when available.
# When available, includes a compact seat heater summary line.
# When the vehicle reports it, includes scheduled departure / preconditioning / off-peak charging status.
python3 {baseDir}/scripts/tesla.py report
python3 {baseDir}/scripts/tesla.py report --no-wake
# Detailed status
python3 {baseDir}/scripts/tesla.py status
python3 {baseDir}/scripts/tesla.py status --no-wake
python3 {baseDir}/scripts/tesla.py status --summary # include one-line summary + detailed output
python3 {baseDir}/scripts/tesla.py --car "My Model 3" status
# JSON output (prints ONLY JSON; good for piping/parsing)
# NOTE: `status --json` outputs *raw* `vehicle_data`, which may include location/drive_state.
# Prefer `summary --json` (sanitized) or `report --json` (sanitized) unless you explicitly need the raw payload.
python3 {baseDir}/scripts/tesla.py summary --json # sanitized summary object (no location)
python3 {baseDir}/scripts/tesla.py report --json # sanitized report object (no location; includes scheduled charging + charge port state)
python3 {baseDir}/scripts/tesla.py status --json # raw vehicle_data (may include location)
python3 {baseDir}/scripts/tesla.py report --json --raw-json # raw vehicle_data (may include location)
python3 {baseDir}/scripts/tesla.py summary --json --raw-json # raw vehicle_data (may include location)
python3 {baseDir}/scripts/tesla.py charge status --json # includes usable battery + (when charging) power details (kW/V/A)
# Lock / unlock
python3 {baseDir}/scripts/tesla.py lock
python3 {baseDir}/scripts/tesla.py unlock
# Climate (status is read-only)
python3 {baseDir}/scripts/tesla.py climate status
python3 {baseDir}/scripts/tesla.py climate status --no-wake
python3 {baseDir}/scripts/tesla.py climate on
python3 {baseDir}/scripts/tesla.py climate off
python3 {baseDir}/scripts/tesla.py climate defrost on
python3 {baseDir}/scripts/tesla.py climate defrost off
python3 {baseDir}/scripts/tesla.py climate temp 72 # default: °F
python3 {baseDir}/scripts/tesla.py climate temp 22 --celsius
# Charging
python3 {baseDir}/scripts/tesla.py charge status
python3 {baseDir}/scripts/tesla.py charge status --no-wake
python3 {baseDir}/scripts/tesla.py charge start --yes
python3 {baseDir}/scripts/tesla.py charge stop --yes
python3 {baseDir}/scripts/tesla.py charge limit 80 --yes # 50–100
python3 {baseDir}/scripts/tesla.py charge amps 16 --yes # 1–48 (conservative guardrail)
# Scheduled charging (set/off are safety gated)
python3 {baseDir}/scripts/tesla.py scheduled-charging status
python3 {baseDir}/scripts/tesla.py scheduled-charging status --no-wake
python3 {baseDir}/scripts/tesla.py scheduled-charging set 23:30 --yes
python3 {baseDir}/scripts/tesla.py scheduled-charging off --yes
# Scheduled departure (read-only)
# Shows scheduled departure, preconditioning, and off-peak charging flags (when the vehicle reports them).
python3 {baseDir}/scripts/tesla.py scheduled-departure status
python3 {baseDir}/scripts/tesla.py scheduled-departure status --no-wake
python3 {baseDir}/scripts/tesla.py --json scheduled-departure status
# Location (approx by default; use --yes for precise coordinates)
python3 {baseDir}/scripts/tesla.py location
python3 {baseDir}/scripts/tesla.py location --no-wake
python3 {baseDir}/scripts/tesla.py location --digits 1 # coarser rounding
python3 {baseDir}/scripts/tesla.py location --digits 3 # a bit more precise (still approximate)
python3 {baseDir}/scripts/tesla.py location --yes
# Tire pressures (TPMS)
python3 {baseDir}/scripts/tesla.py tires
python3 {baseDir}/scripts/tesla.py tires --no-wake
# Openings (doors/trunks/windows)
python3 {baseDir}/scripts/tesla.py openings
python3 {baseDir}/scripts/tesla.py openings --no-wake
python3 {baseDir}/scripts/tesla.py openings --json
# Trunk / frunk (safety gated)
python3 {baseDir}/scripts/tesla.py trunk trunk --yes
python3 {baseDir}/scripts/tesla.py trunk frunk --yes
# Windows
python3 {baseDir}/scripts/tesla.py windows status
python3 {baseDir}/scripts/tesla.py windows status --no-wake
python3 {baseDir}/scripts/tesla.py windows status --json
# Windows (safety gated)
python3 {baseDir}/scripts/tesla.py windows vent --yes
python3 {baseDir}/scripts/tesla.py windows close --yes
# Seat heaters
python3 {baseDir}/scripts/tesla.py seats status
python3 {baseDir}/scripts/tesla.py seats status --no-wake
python3 {baseDir}/scripts/tesla.py seats status --json
# Seat heaters (safety gated)
# seat: driver|passenger|rear-left|rear-center|rear-right|3rd-left|3rd-right (or 0–6)
# level: 0–3 (0=off)
python3 {baseDir}/scripts/tesla.py seats set driver 3 --yes
# Sentry Mode (status is read-only; on/off safety gated)
python3 {baseDir}/scripts/tesla.py sentry status
python3 {baseDir}/scripts/tesla.py sentry status --no-wake
python3 {baseDir}/scripts/tesla.py sentry on --yes
python3 {baseDir}/scripts/tesla.py sentry off --yes
# Charge port door
python3 {baseDir}/scripts/tesla.py charge-port status
python3 {baseDir}/scripts/tesla.py charge-port status --no-wake
python3 {baseDir}/scripts/tesla.py charge-port status --json
# Mileage tracking (odometer) — local SQLite
python3 {baseDir}/scripts/tesla.py mileage init
python3 {baseDir}/scripts/tesla.py mileage record --no-wake --auto-wake-after-hours 24
python3 {baseDir}/scripts/tesla.py mileage status
python3 {baseDir}/scripts/tesla.py mileage export --format csv
python3 {baseDir}/scripts/tesla.py mileage export --format csv --since-days 7
python3 {baseDir}/scripts/tesla.py mileage export --format json
python3 {baseDir}/scripts/tesla.py mileage export --format json --since-ts 1738195200
# Charge port door open/close (safety gated)
python3 {baseDir}/scripts/tesla.py charge-port open --yes
python3 {baseDir}/scripts/tesla.py charge-port close --yes
# Fun / attention-grabbing
python3 {baseDir}/scripts/tesla.py honk --yes
python3 {baseDir}/scripts/tesla.py flash --yes
Safety defaults
Some actions require an explicit confirmation flag:
unlock, charge start|stop|limit|amps, trunk, windows, seats set, sentry on|off, honk, flash, charge-port open|close, and scheduled-charging set|off require --yes
location is approximate by default; add --yes for precise coordinates (or --digits N to control rounding)
Privacy
- Credentials are cached locally only (
~/.tesla_cache.json).
- Do not commit tokens, logs, VINs, or location outputs.
1---2name: my-tesla3description: Control Tesla vehicles from macOS via the Tesla Owner API using teslapy (auth, list cars, status, lock/unlock, climate, charging, location, and extras). Use when you want to check your car state or run safe remote commands. Designed for Parth Maniar (@officialpm) with local-only auth caching, confirmation gates for disruptive actions, and chat-friendly status output.4---56# My Tesla78**Author:** Parth Maniar — [@officialpm](https://github.com/officialpm)910A practical Tesla control skill for Clawdbot built on `teslapy`.1112## Setup1314### Requirements1516- `TESLA_EMAIL` env var set (your Tesla account email)17- Python 3.10+1819### First-time authentication2021```bash22TESLA_EMAIL="you@email.com" python3 {baseDir}/scripts/tesla.py auth23```2425This opens a Tesla login URL. Log in, then paste the callback URL back into the CLI.2627- Token cache: `~/.tesla_cache.json` (local only; best-effort chmod `0600`)28- Optional: set `MY_TESLA_DEFAULT_CAR` to a vehicle display name to pick a default car via env var29- Or persist a local default with: `python3 {baseDir}/scripts/tesla.py default-car "Name"` (writes `~/.my_tesla.json`; best-effort chmod `0600`)3031## Commands3233```bash34# List vehicles35python3 {baseDir}/scripts/tesla.py list36python3 {baseDir}/scripts/tesla.py list --json # machine-readable, privacy-safe3738# Version39python3 {baseDir}/scripts/tesla.py version40python3 {baseDir}/scripts/tesla.py --version4142# Debugging43# If something fails unexpectedly, add --debug for a full traceback44# (or set MY_TESLA_DEBUG=1)45python3 {baseDir}/scripts/tesla.py --debug status --no-wake4647# Pick a car (optional)48# --car accepts: exact name, partial name (substring match), or a 1-based index from `list`49python3 {baseDir}/scripts/tesla.py --car "Model" status50python3 {baseDir}/scripts/tesla.py --car 1 report5152# Set a default car (used when --car is not passed)53python3 {baseDir}/scripts/tesla.py default-car "My Model 3"5455# One-line summary (best for chat)56python3 {baseDir}/scripts/tesla.py summary57python3 {baseDir}/scripts/tesla.py summary --no-wake # don't wake a sleeping car5859# Summary as JSON (privacy-safe)60# Unlike `status --json`, this emits a small sanitized object (no location).61# Includes `usable_level_percent` when the vehicle reports it.62python3 {baseDir}/scripts/tesla.py summary --json63python3 {baseDir}/scripts/tesla.py summary --json --raw-json # raw vehicle_data (may include location)6465# One-screen report (chat friendly, more detail)66# Includes battery/charging/climate + (when available) TPMS tire pressures.67# Includes "Usable battery" when the vehicle reports it (helpful for health/degradation).68# Also includes a quick openings summary (doors/trunk/frunk/windows) when available.69# When available, includes a compact seat heater summary line.70# When the vehicle reports it, includes scheduled departure / preconditioning / off-peak charging status.71python3 {baseDir}/scripts/tesla.py report72python3 {baseDir}/scripts/tesla.py report --no-wake7374# Detailed status75python3 {baseDir}/scripts/tesla.py status76python3 {baseDir}/scripts/tesla.py status --no-wake77python3 {baseDir}/scripts/tesla.py status --summary # include one-line summary + detailed output78python3 {baseDir}/scripts/tesla.py --car "My Model 3" status7980# JSON output (prints ONLY JSON; good for piping/parsing)81# NOTE: `status --json` outputs *raw* `vehicle_data`, which may include location/drive_state.82# Prefer `summary --json` (sanitized) or `report --json` (sanitized) unless you explicitly need the raw payload.83python3 {baseDir}/scripts/tesla.py summary --json # sanitized summary object (no location)84python3 {baseDir}/scripts/tesla.py report --json # sanitized report object (no location; includes scheduled charging + charge port state)85python3 {baseDir}/scripts/tesla.py status --json # raw vehicle_data (may include location)86python3 {baseDir}/scripts/tesla.py report --json --raw-json # raw vehicle_data (may include location)87python3 {baseDir}/scripts/tesla.py summary --json --raw-json # raw vehicle_data (may include location)88python3 {baseDir}/scripts/tesla.py charge status --json # includes usable battery + (when charging) power details (kW/V/A)8990# Lock / unlock91python3 {baseDir}/scripts/tesla.py lock92python3 {baseDir}/scripts/tesla.py unlock9394# Climate (status is read-only)95python3 {baseDir}/scripts/tesla.py climate status96python3 {baseDir}/scripts/tesla.py climate status --no-wake97python3 {baseDir}/scripts/tesla.py climate on98python3 {baseDir}/scripts/tesla.py climate off99python3 {baseDir}/scripts/tesla.py climate defrost on100python3 {baseDir}/scripts/tesla.py climate defrost off101python3 {baseDir}/scripts/tesla.py climate temp 72 # default: °F102python3 {baseDir}/scripts/tesla.py climate temp 22 --celsius103104# Charging105python3 {baseDir}/scripts/tesla.py charge status106python3 {baseDir}/scripts/tesla.py charge status --no-wake107python3 {baseDir}/scripts/tesla.py charge start --yes108python3 {baseDir}/scripts/tesla.py charge stop --yes109python3 {baseDir}/scripts/tesla.py charge limit 80 --yes # 50–100110python3 {baseDir}/scripts/tesla.py charge amps 16 --yes # 1–48 (conservative guardrail)111112# Scheduled charging (set/off are safety gated)113python3 {baseDir}/scripts/tesla.py scheduled-charging status114python3 {baseDir}/scripts/tesla.py scheduled-charging status --no-wake115python3 {baseDir}/scripts/tesla.py scheduled-charging set 23:30 --yes116python3 {baseDir}/scripts/tesla.py scheduled-charging off --yes117118# Scheduled departure (read-only)119# Shows scheduled departure, preconditioning, and off-peak charging flags (when the vehicle reports them).120python3 {baseDir}/scripts/tesla.py scheduled-departure status121python3 {baseDir}/scripts/tesla.py scheduled-departure status --no-wake122python3 {baseDir}/scripts/tesla.py --json scheduled-departure status123124# Location (approx by default; use --yes for precise coordinates)125python3 {baseDir}/scripts/tesla.py location126python3 {baseDir}/scripts/tesla.py location --no-wake127python3 {baseDir}/scripts/tesla.py location --digits 1 # coarser rounding128python3 {baseDir}/scripts/tesla.py location --digits 3 # a bit more precise (still approximate)129python3 {baseDir}/scripts/tesla.py location --yes130131# Tire pressures (TPMS)132python3 {baseDir}/scripts/tesla.py tires133python3 {baseDir}/scripts/tesla.py tires --no-wake134135# Openings (doors/trunks/windows)136python3 {baseDir}/scripts/tesla.py openings137python3 {baseDir}/scripts/tesla.py openings --no-wake138python3 {baseDir}/scripts/tesla.py openings --json139140# Trunk / frunk (safety gated)141python3 {baseDir}/scripts/tesla.py trunk trunk --yes142python3 {baseDir}/scripts/tesla.py trunk frunk --yes143144# Windows145python3 {baseDir}/scripts/tesla.py windows status146python3 {baseDir}/scripts/tesla.py windows status --no-wake147python3 {baseDir}/scripts/tesla.py windows status --json148149# Windows (safety gated)150python3 {baseDir}/scripts/tesla.py windows vent --yes151python3 {baseDir}/scripts/tesla.py windows close --yes152153# Seat heaters154python3 {baseDir}/scripts/tesla.py seats status155python3 {baseDir}/scripts/tesla.py seats status --no-wake156python3 {baseDir}/scripts/tesla.py seats status --json157158# Seat heaters (safety gated)159# seat: driver|passenger|rear-left|rear-center|rear-right|3rd-left|3rd-right (or 0–6)160# level: 0–3 (0=off)161python3 {baseDir}/scripts/tesla.py seats set driver 3 --yes162163# Sentry Mode (status is read-only; on/off safety gated)164python3 {baseDir}/scripts/tesla.py sentry status165python3 {baseDir}/scripts/tesla.py sentry status --no-wake166python3 {baseDir}/scripts/tesla.py sentry on --yes167python3 {baseDir}/scripts/tesla.py sentry off --yes168169# Charge port door170python3 {baseDir}/scripts/tesla.py charge-port status171python3 {baseDir}/scripts/tesla.py charge-port status --no-wake172python3 {baseDir}/scripts/tesla.py charge-port status --json173174# Mileage tracking (odometer) — local SQLite175python3 {baseDir}/scripts/tesla.py mileage init176python3 {baseDir}/scripts/tesla.py mileage record --no-wake --auto-wake-after-hours 24177python3 {baseDir}/scripts/tesla.py mileage status178python3 {baseDir}/scripts/tesla.py mileage export --format csv179python3 {baseDir}/scripts/tesla.py mileage export --format csv --since-days 7180python3 {baseDir}/scripts/tesla.py mileage export --format json181python3 {baseDir}/scripts/tesla.py mileage export --format json --since-ts 1738195200182183# Charge port door open/close (safety gated)184python3 {baseDir}/scripts/tesla.py charge-port open --yes185python3 {baseDir}/scripts/tesla.py charge-port close --yes186187# Fun / attention-grabbing188python3 {baseDir}/scripts/tesla.py honk --yes189python3 {baseDir}/scripts/tesla.py flash --yes190```191192## Safety defaults193194Some actions require an explicit confirmation flag:195- `unlock`, `charge start|stop|limit|amps`, `trunk`, `windows`, `seats set`, `sentry on|off`, `honk`, `flash`, `charge-port open|close`, and `scheduled-charging set|off` require `--yes`196- `location` is *approximate* by default; add `--yes` for precise coordinates (or `--digits N` to control rounding)197198## Privacy199200- Credentials are cached locally only (`~/.tesla_cache.json`).201- Do not commit tokens, logs, VINs, or location outputs.