Configuration - KnevS/Tesla-Carview GitHub Wiki
๐ Language: EN ยท DE ยท FR ยท ES ยท TR ยท EL
All Tesla Carview settings are configured via the .env file at /opt/tesla-carview/backend/.env.
After any change to .env, restart the backend:
docker compose -f /opt/tesla-carview/docker-compose.prod.yml up -d --build backend| Variable | Example | Description |
|---|---|---|
JWT_SECRET |
some-random-64-char-string |
Secret key for signing login tokens. Generate with: openssl rand -hex 32
|
TESLA_CLIENT_ID |
abc123... |
From Tesla Developer Portal |
TESLA_CLIENT_SECRET |
xyz789... |
From Tesla Developer Portal |
TESLA_AUTH_BASE |
https://auth.tesla.com/oauth2/v3 |
Tesla OAuth base URL โ pre-filled by setup wizard; only change if Tesla updates their auth endpoint |
FRONTEND_URL |
https://tesla.yourdomain.com |
The public URL of your installation |
DATABASE_PATH |
/app/data |
Where databases are stored (don't change in Docker) |
| Variable | Default | Description |
|---|---|---|
AUTO_UPDATE_ENABLED |
false |
Set to true to auto-update nightly |
MFA_REQUIRED_FOR_NEW_USERS |
false |
Force MFA setup for all new user accounts |
REGISTRATION_REQUIRES_INVITE |
false |
Require an invite code to register a new tenant |
POLL_INTERVAL_MS |
60000 |
How often to poll Tesla API when car is active (ms) |
POLL_SLEEP_INTERVAL_MS |
600000 |
Polling interval when car is sleeping (ms) |
| Variable | Description |
|---|---|
AWATTAR_ENABLED |
true/false โ enable aWATTar (DE/AT, free) |
TIBBER_TOKEN |
Your Tibber API token (get at developer.tibber.com) |
| Variable | Default | Description |
|---|---|---|
DEMO_ENABLED |
false |
Enable public demo tenant with fake data |
DEMO_MAX_CONCURRENT |
10 |
Max simultaneous demo users |
DEMO_LIFETIME_DAYS |
14 |
How long demo accounts last |
VAPID keys are required for push notifications ("Charging complete", "Service interval due"). Without them, pushes don't work โ the rest of the app runs normally.
| Variable | Default | Description |
|---|---|---|
VAPID_PUBLIC_KEY |
โ | Public key โ generate with npx web-push generate-vapid-keys
|
VAPID_PRIVATE_KEY |
โ | Private key (generated at the same time) |
VAPID_CONTACT |
mailto:[email protected] |
Contact URI for the push service โ ideally your own email |
Generate both keys with one command:
npx web-push generate-vapid-keysFleet Telemetry provides real-time GPS and telemetry pushed directly from the car to your server โ instead of polling the Tesla API every minute. It is optional for most installations, but recommended (or required) for newer Tesla models.
When Fleet Telemetry matters:
- Newer models (e.g. Model Y Juniper, VINs starting with XP7) no longer return GPS data via the standard polling API โ Fleet Telemetry is then the only way to get live location data.
- For older models, it's an optional upgrade: lower API load, faster data, and real-time position updates.
Prerequisites:
- The Virtual Key must be paired first (see Tesla API Setup)
- Fleet Telemetry must be approved for your Client-ID in the Tesla Developer Portal โ this is a separate approval step beyond basic API access. Request it under your app settings.
| Variable | Description |
|---|---|
FLEET_TELEMETRY_ENABLED |
true/false โ enable real-time GPS via Fleet Telemetry |
FLEET_TELEMETRY_PORT |
Port for Fleet Telemetry server (default: 4443) |
VIRTUAL_KEY_PRIVATE_KEY_PATH |
Path to Virtual Key private key file |
openssl rand -hex 32
# Output: something like a8f3e9b2c1d4...
# Copy this into your .env file# View current .env (careful with sharing output โ contains secrets):
cat /opt/tesla-carview/backend/.env
# Check which environment variables the running container sees:
docker compose -f /opt/tesla-carview/docker-compose.prod.yml exec backend env | grep -v PASSWORD | grep -v SECRETSome settings do not require .env changes โ they are configured directly in the admin interface and stored in the database. These settings survive updates and do not require a container restart.
| Setting | Location | Notes |
|---|---|---|
| SMTP / e-mail delivery | Admin โ Admin Settings โ E-Mail | Host, port, user, password, sender โ includes a send-test button |
| OpenChargeMap API key | Admin โ Admin Settings โ External APIs | Charging station overlay on route planner โ free, register at openchargemap.io/site/develop |
| HERE Maps API key | Admin โ Admin Settings โ External APIs | Real-time traffic on route planner โ free tier (250 k req/month), register at developer.here.com |
| xAI API key | Admin โ Admin Settings โ External APIs | Grok Chat AI assistant โ get at console.x.ai |
| Anthropic API key | Admin โ Admin Settings โ Monitoring | AI-powered autofix (Claude Haiku) โ see below |
| Self-healing toggle | Admin โ Admin Settings โ Monitoring | Enable/disable automatic container restart |
| Alert e-mail address | Admin โ Admin Settings โ Monitoring | Where monitoring alerts are sent |
| Monta credentials | Settings โ Vehicle profile โ Home charging | Per-vehicle: Client ID, Client Secret, Charge-Point ID โ available for all vehicle categories |
| Electricity price per kWh | Settings โ Vehicle profile or setup wizard | Per-vehicle energy cost for charging calculations |
All of the above can also be configured during the setup wizard โ no direct server access required.
Tesla Carview includes a two-tier self-healing monitoring system that runs automatically on the server:
- Tier 1 โ Rule-based autofix (runs every 20 minutes): Handles known, deterministic problems โ restarting stopped containers, clearing full disks, fixing file permissions. No AI required, always active.
- Tier 2 โ AI autofix (optional): Triggered when Tier 1 cannot fix a problem. Sends the error log to Claude Haiku (Anthropic) and asks it to suggest and optionally apply a fix โ a more powerful fallback for unusual problems.
Tier 2 is entirely optional and can simply be left out. The system self-heals reliably with Tier 1 alone โ for most installations that is more than sufficient. Without an Anthropic key, unsolvable problems trigger an e-mail alert instead.
Get a key at console.anthropic.com (pay-per-use, Claude Haiku is very cheap โ typically a few cents per month for occasional autofix calls).
For a complete list of every environment variable with detailed descriptions, see the technical documentation: docs/10-configuration.en.md