# teslamate | TeslaMate | Knowledge Base | Instagit

A self-hosted data logger for your Tesla  🚘 [main maintainer=@JakobLichterfeld]

GitHub Stars: 8.4k

Repository: https://github.com/teslamate-org/teslamate

---

## Articles

### [How TeslaMate's Elixir Application Supervision Tree Organizes Dependencies](/teslamate-org/teslamate/how-does-the-elixir-application-supervision-tree-organize-dependencies)

Discover how TeslaMate's Elixir application supervision tree organizes dependencies between database connections, API clients, and vehicle telemetry streaming for robust application management.

- Tags: internals
- Published: 2026-06-23

### [How TeslaMate's Data Logging Cycle Persists Positions During Drives](/teslamate-org/teslamate/how-does-the-data-logging-cycle-persist-positions-during-drives)

Discover how TeslaMate's data logging cycle persists positions during drives with its state machine pipeline and Log process for accurate trip tracking.

- Tags: internals
- Published: 2026-06-23

### [How the TeslaMate Updater Module Checks for New Releases](/teslamate-org/teslamate/how-does-the-updater-module-check-for-new-teslamate-releases)

Discover how the TeslaMate Updater module checks for new releases by polling the GitHub API every 72 hours. Stay informed about the latest stable versions.

- Tags: internals
- Published: 2026-06-23

### [How Phoenix PubSub and the MQTT Publisher Coordinate Data Updates in TeslaMate](/teslamate-org/teslamate/how-do-the-phoenix-pubsub-and-mqtt-publisher-coordinate-data-updates)

Learn how Phoenix PubSub and the MQTT Publisher in TeslaMate coordinate data updates. Discover how Elixir message passing and external broker forwarding ensure clean separation of concerns for efficient data transport.

- Tags: internals
- Published: 2026-06-23

### [How TeslaMate Handles Timezone Data with TZData for Location Records](/teslamate-org/teslamate/how-does-timezone-handling-work-with-tzdata-for-location-data)

Discover how TeslaMate uses TZData to accurately manage timezone data for your location records. Convert naive timestamps to local time with ease.

- Tags: internals
- Published: 2026-06-23

### [How Does the TeslaMate API Module Handle Rate Limiting and Unauthorized Errors?](/teslamate-org/teslamate/how-does-the-api-module-handle-rate-limiting-and-unauthorized-errors)

Discover how the TeslaMate API module manages rate limiting with retry headers and unauthorized errors via circuit-breaker pattern. Prevent repeated auth failures.

- Tags: internals
- Published: 2026-06-23

### [How TeslaMate Manages Environment Configuration Across Dev, Test, and Production](/teslamate-org/teslamate/how-does-environment-configuration-work-across-dev-test-and-prod)

Discover how TeslaMate manages environment configuration across dev, test, and production. Learn about its three-layer system for seamless deployments and efficient development.

- Tags: internals
- Published: 2026-06-23

### [TeslaMate Grafana Dashboards: Complete Guide to Bundled Visualizations and PostgreSQL Queries](/teslamate-org/teslamate/what-grafana-dashboards-are-bundled-and-how-do-they-query-the-database)

Explore TeslaMate's bundled Grafana dashboards and understand their PostgreSQL queries. Learn how to leverage these visualizations for your EV data.

- Tags: deep-dive
- Published: 2026-06-23

### [How TeslaMate Charge Cost Tracking Calculates Energy Expenses Per Session](/teslamate-org/teslamate/how-does-charge-cost-tracking-calculate-energy-expenses-per-session)

Learn how TeslaMate charge cost tracking calculates energy expenses per session using geofence pricing and consumption data for per-kWh or per-minute billing.

- Tags: internals
- Published: 2026-06-23

### [How TeslaMate Handles User Sessions and Authentication in Its Web Interface](/teslamate-org/teslamate/how-does-the-web-interface-handle-user-sessions-and-authentication)

Learn how TeslaMate secures your data with signed HTTP cookie sessions and encrypted OAuth tokens for robust web interface authentication and API access.

- Tags: internals
- Published: 2026-06-23

### [How TeslaMate's HTTP Client Implements Circuit Breakers Using the Erlang Fuse Library](/teslamate-org/teslamate/how-does-the-http-client-implement-circuit-breakers-using-fuse)

Discover how TeslaMate's HTTP client uses the Erlang Fuse library to implement circuit breakers, preventing API errors and protecting your processes from cascading failures.

- Tags: internals
- Published: 2026-06-23

### [How the TeslaMate Repair Module Identifies and Fixes Data Inconsistencies](/teslamate-org/teslamate/how-does-the-repair-module-identify-and-fix-common-data-inconsistencies)

Discover how the TeslaMate Repair module automatically identifies and fixes common data inconsistencies like missing addresses. Learn how it geocodes your Tesla data efficiently and accurately.

- Tags: internals
- Published: 2026-06-23

### [How the TeslaMate Vault Module Encrypts and Stores Sensitive API Tokens](/teslamate-org/teslamate/how-does-the-vault-module-encrypt-and-store-sensitive-api-tokens)

Discover how the TeslaMate Vault module encrypts API tokens using AES-256-GCM with Cloak for secure storage and transparent decryption. Learn about this essential security feature.

- Tags: internals
- Published: 2026-06-23

### [TeslaMate Database Schema for Drives, Charges, and Positions: A Complete Technical Guide](/teslamate-org/teslamate/what-is-the-database-schema-for-drives-charges-positions-and-their-relationships)

Explore the TeslaMate database schema for drives, charges, and positions. Understand the Ecto schemas and their relationships for vehicle telemetry data.

- Tags: technical-guide
- Published: 2026-06-23

### [How the TeslaMate Vehicles Supervisor Manages Multiple Tesla Vehicles Concurrently](/teslamate-org/teslamate/how-does-the-vehicles-supervisor-manage-multiple-tesla-vehicles-concurrently)

Discover how the TeslaMate Vehicles supervisor efficiently manages multiple Tesla vehicles concurrently using isolated GenStateMachine processes and a one for one strategy for parallel operations and independent failure handling.

- Tags: internals
- Published: 2026-06-23

### [How TeslaMate Parses and Migrates CSV Data from TeslaFi and tesla-apiscraper](/teslamate-org/teslamate/how-does-the-csv-import-from-teslfi-and-tesla-apiscraper-parse-and-migrate-data)

Learn how TeslaMate imports TeslaFi CSV data with GenStateMachine. Stream files, parse rows, and migrate data effortlessly for a complete vehicle history.

- Tags: how-to-guide
- Published: 2026-06-23

### [How the TeslaMate Terrain Module Fetches and Caches Elevation Data from SRTM](/teslamate-org/teslamate/how-does-the-terrain-module-fetch-and-cache-elevation-data-from-srtm)

Discover how the TeslaMate Terrain module efficiently fetches and caches SRTM elevation data with its GenStateMachine and disk caching. Optimize your Tesla logs today.

- Tags: internals
- Published: 2026-06-23

### [How the Tesla API Authentication Flow Handles Token Refresh and MFA in TeslaMate](/teslamate-org/teslamate/how-does-the-tesla-api-authentication-flow-handle-token-refresh-and-mfa)

Discover how TeslaMate's authentication flow handles token refresh and MFA. Learn about automatic token refresh and MFA challenge resolution for seamless Tesla API access.

- Tags: internals
- Published: 2026-06-23

### [TeslaMate MQTT Topics and Data Structure: Complete Reference Guide](/teslamate-org/teslamate/what-mqtt-topics-does-teslamate-publish-and-how-is-the-data-structured)

Explore TeslaMate MQTT topics and data structure for real-time vehicle telemetry. Understand published data under teslamate/cars/$car_id/ and access comprehensive integration guides.

- Tags: api-reference
- Published: 2026-06-23

### [What Is TeslaMate.Locations? Purpose and Implementation in the TeslaMate Elixir Codebase](/teslamate-org/teslamate/teslamate-locations-purpose)

Discover the purpose of TeslaMate Locations, the central module for geographic data. Understand its role in reverse geocoding, geofence management, and spatial analytics within the TeslaMate application.

- Tags: internals
- Published: 2026-06-18

### [How Settings Are Managed in TeslaMate: A Deep Dive into the Configuration Layer](/teslamate-org/teslamate/teslamate-settings-management)

Discover how TeslaMate manages settings using Ecto schemas, PostgreSQL, and side effects. Understand the configuration layer for efficient data persistence and updates.

- Tags: deep-dive
- Published: 2026-06-18

### [How to Enable or Disable Vehicles in TeslaMate: Complete Guide](/teslamate-org/teslamate/teslamate-enable-disable-vehicles)

Learn how to enable or disable vehicles in TeslaMate by toggling the enabled field in CarSettings. Control active vehicles and hide them from the web interface easily.

- Tags: how-to-guide
- Published: 2026-06-18

### [What is TeslaMate.Vault Used For? Transparent Encryption of Tesla API Tokens](/teslamate-org/teslamate/teslamate-vault-usage)

Discover how TeslaMate.Vault securely encrypts Tesla API tokens with AES-256-GCM, ensuring your data remains protected at rest and decrypting seamlessly for Ecto schemas.

- Tags: internals
- Published: 2026-06-18

### [What is TeslaMate.Repo? The Central Database Gateway Explained](/teslamate-org/teslamate/teslamate-repo-role)

Discover TeslaMate Repo, the Ecto repository acting as your central database gateway for all PostgreSQL operations in TeslaMate. Learn how it simplifies data access.

- Tags: deep-dive
- Published: 2026-06-18

### [How the TeslaMate Supervisor Tree Works: OTP Supervision in Elixir](/teslamate-org/teslamate/teslamate-supervisor-tree-explained)

Discover how the TeslaMate supervisor tree works using OTP supervision in Elixir. Learn how its hierarchical architecture ensures system stability and automatic restarts for fault isolation.

- Tags: internals
- Published: 2026-06-18

### [How to Configure the MQTT Connection in TeslaMate](/teslamate-org/teslamate/teslamate-configure-mqtt-connection)

Easily configure your TeslaMate MQTT connection using environment variables. Learn how to set MQTT_HOST and enable telemetry publishing to your broker for seamless data integration.

- Tags: how-to-guide
- Published: 2026-06-18

### [TeslaMate MQTT Integration: Architecture, Configuration, and Topic Structure](/teslamate-org/teslamate/teslamate-mqtt-integration)

Learn how TeslaMate integrates with MQTT for real-time vehicle telemetry. Explore its architecture, configuration, and clear topic structure for seamless data publishing under teslamate/<namespace>/cars/<car_id>/<key>.

- Tags: architecture
- Published: 2026-06-18

### [How to Configure TeslaMate Polling Intervals: Environment Variable Guide](/teslamate-org/teslamate/teslamate-polling-interval-configuration)

Configure TeslaMate polling intervals by overriding default settings with environment variables. Customize API query frequency at runtime for efficient data collection.

- Tags: how-to-guide
- Published: 2026-06-18

### [Understanding the TeslaMate Vehicle State Machine: The 5 Core States Explained](/teslamate-org/teslamate/teslamate-vehicle-states)

Explore the 5 core states of the TeslaMate vehicle state machine: Charge, Climate, Drive, VehicleConfig, and VehicleState. Learn how Tesla API data transforms into usable Elixir structs.

- Tags: internals
- Published: 2026-06-18

### [Understanding the Vehicle State Machine in TeslaMate](/teslamate-org/teslamate/teslamate-vehicle-state-machine)

Discover the TeslaMate vehicle state machine, a pure functional transformer converting Tesla API data into five structured Elixir structs for charge, climate, drive, configuration, and status.

- Tags: internals
- Published: 2026-06-18

### [How TeslaMate Handles API Token Encryption: A Complete Technical Guide](/teslamate-org/teslamate/teslamate-api-token-encryption)

Learn how TeslaMate encrypts API tokens at rest using AES-GCM and Cloak for secure PostgreSQL storage. Discover transparent decryption with Ecto.

- Tags: deep-dive
- Published: 2026-06-18

### [How TeslaMate Handles API Rate Limits: Detection, Retry Logic, and Back-Off Strategy](/teslamate-org/teslamate/teslamate-api-rate-limits)

Discover how TeslaMate expertly manages Tesla API rate limits. Learn about its detection, retry logic, and back-off strategy to avoid spamming the API.

- Tags: how-to-guide
- Published: 2026-06-18

### [How TeslaMate Manages Tesla API Tokens: Encrypted Storage & Automatic Refresh](/teslamate-org/teslamate/teslamate-api-token-management)

Discover how TeslaMate securely manages Tesla API tokens with encrypted storage and automatic refreshes. Learn about token lifecycle management for seamless API integration.

- Tags: internals
- Published: 2026-06-18

### [How TeslaMate Handles API Authentication: Token Storage, Encryption, and Auto-Refresh](/teslamate-org/teslamate/teslamate-api-authentication)

TeslaMate secures API authentication with encrypted token storage, middleware injection, and auto-refresh. Learn how your Tesla data stays safe and accessible.

- Tags: internals
- Published: 2026-06-18

### [How to Access TeslaMate Logs: Docker Container Logging Guide](/teslamate-org/teslamate/teslamate-access-logs)

Easily access TeslaMate logs by reading Docker container standard output with docker logs or docker compose logs commands. Get insights into your TeslaMate application.

- Tags: how-to-guide
- Published: 2026-06-18

### [How TeslaMate is Deployed: Complete Docker Architecture Guide](/teslamate-org/teslamate/teslamate-deployment)

Discover how TeslaMate is deployed using a Docker architecture. Explore the Elixir app, PostgreSQL, Grafana, and Mosquitto services orchestrated by Docker Compose for efficient data logging.

- Tags: architecture
- Published: 2026-06-18

### [Core Components of TeslaMate: Architecture and Source Code Guide](/teslamate-org/teslamate/teslamate-core-components)

Explore TeslaMate core components: OTP supervision tree, API client, GenStateMachine, Ecto logging, MQTT, and Phoenix LiveView. Understand the architecture and source code.

- Tags: architecture
- Published: 2026-06-18

### [What Programming Language Is TeslaMate Written In?](/teslamate-org/teslamate/teslamate-programming-language)

Discover that TeslaMate is written in Elixir, a powerful functional programming language. Learn how Elixir powers its real-time dashboard and fault-tolerant data processing.

- Tags: getting-started
- Published: 2026-06-18

### [How Dependencies Are Configured in the TeslaMate Supervisor Tree](/teslamate-org/teslamate/how-are-dependencies-configured-in-the-teslamate-supervisor-tree)

Discover how TeslaMate configures dependencies within its supervisor tree. Learn about OTP supervisors, restart strategies, and dynamic child specifications for efficient process management.

- Tags: internals
- Published: 2026-06-16

### [How the TeslaMate Release Module Manages Database Migrations](/teslamate-org/teslamate/how-does-the-release-module-manage-database-migrations)

Discover how the TeslaMate Release module expertly handles database migrations using Ecto. Learn about applying changes, executing rollbacks, and monitoring status for seamless updates.

- Tags: internals
- Published: 2026-06-16

### [How State Change Logging Is Implemented in TeslaMate: Elixir Source Code Analysis](/teslamate-org/teslamate/how-is-state-change-logging-implemented-in-teslamate)

Discover how TeslaMate implements state change logging. Learn about the `State` record in PostgreSQL and the `start_state/2` function for tracking vehicle status transitions.

- Tags: internals
- Published: 2026-06-16

### [How the TeslaMate Conversion Module Handles Unit Transformations](/teslamate-org/teslamate/how-does-the-conversion-module-handle-unit-transformations)

Discover how the TeslaMate Convert module centralizes unit transformations for speed, distance, temperature, and time. Ensure consistent data across UI and database.

- Tags: internals
- Published: 2026-06-16

### [How TeslaMate's MQTT Handler and Vehicle Subscriber Coordinate Messaging](/teslamate-org/teslamate/how-do-the-mqtt-handler-and-vehicle-subscriber-coordinate-messaging)

Discover how TeslaMate's MQTT Handler and Vehicle Subscriber coordinate messaging using Phoenix PubSub for efficient telemetry broadcasting and routing to vehicle modules.

- Tags: internals
- Published: 2026-06-16

### [Database Schema for Sensitive Data in TeslaMate: Private Schemas and Cloak Encryption](/teslamate-org/teslamate/what-is-the-database-schema-for-sensitive-data-in-teslamate)

Learn how TeslaMate secures sensitive data with a private PostgreSQL schema and Cloak encryption. Protect your API tokens from plain text exposure.

- Tags: internals
- Published: 2026-06-16

### [How TeslaMate Handles MFA and CAPTCHA in Its Authentication Flow](/teslamate-org/teslamate/how-does-teslamates-authentication-flow-handle-mfa-and-captcha)

Learn how TeslaMate handles MFA and CAPTCHA by delegating to Tesla's official endpoint. Discover efficient OAuth token management for seamless authentication.

- Tags: internals
- Published: 2026-06-16

### [How the Tesla API Client is Configured in the HTTP Module in TeslaMate](/teslamate-org/teslamate/how-is-the-tesla-api-client-configured-in-the-http-module)

Discover how the Tesla API client is configured in the HTTP module. Learn about Finch pool architecture, environment settings, TLS, and proxy details for efficient traffic management.

- Tags: internals
- Published: 2026-06-16

### [How Phoenix PubSub Enables Real-Time Web Updates in TeslaMate: Event-Driven Architecture Explained](/teslamate-org/teslamate/how-does-phoenix-pubsub-enable-real-time-web-updates-in-teslamate)

Discover how TeslaMate leverages Phoenix PubSub for event-driven architecture and real-time web updates, pushing instant UI changes to LiveViews without page reloads.

- Tags: architecture
- Published: 2026-06-16

### [How the TeslaMate Terrain Module Handles Elevation Data](/teslamate-org/teslamate/how-does-the-terrain-module-handle-elevation-data)

Discover how the TeslaMate Terrain module enriches GPS data with elevation using SRTM, circuit breakers, disk caching, and batched updates for efficient processing.

- Tags: internals
- Published: 2026-06-16

### [How the TeslaMate Repair Module Fixes Data Inconsistencies: A Deep Dive](/teslamate-org/teslamate/how-does-the-repair-module-fix-data-inconsistencies)

Discover how the TeslaMate Repair module automatically fixes data inconsistencies by reverse-geocoding missing drive and charging location references directly in your database.

- Tags: deep-dive
- Published: 2026-06-16

### [How the TeslaMate Updater Module Checks for Software Updates](/teslamate-org/teslamate/how-does-the-updater-module-check-for-software-updates)

Discover how the TeslaMate Updater module checks for software updates by querying the GitHub Releases API and comparing local and remote versions for seamless notifications.

- Tags: internals
- Published: 2026-06-16

### [Ecto Schema for TeslaMate Charges, Drives, and Positions: Complete Technical Guide](/teslamate-org/teslamate/what-is-the-ecto-schema-for-teslamate-charges-drives-and-positions)

Explore the Ecto schema for TeslaMate charges, drives, and positions. Learn how TeslaMate structures vehicle telemetry in PostgreSQL with relational integrity and precise decimal handling.

- Tags: technical-guide
- Published: 2026-06-16

### [How the Fuse Circuit Breaker Protects Against Tesla API Rate Limiting in TeslaMate](/teslamate-org/teslamate/how-does-the-fuse-circuit-breaker-protect-against-tesla-api-rate-limiting)

Learn how TeslaMate's fuse circuit breaker prevents API rate limiting by instantly blocking requests after a 429 response, safeguarding your application.

- Tags: internals
- Published: 2026-06-16

### [How TeslaMate Handles Global vs Per-Car Configuration in the Settings Module](/teslamate-org/teslamate/how-does-the-settings-module-handle-global-vs-per-car-configuration)

Explore how TeslaMate's Settings module manages global vs per-car configuration using distinct Ecto schemas and a fallback pattern for efficient management.

- Tags: internals
- Published: 2026-06-16

### [How the TeslaMate Streaming Module Receives Real‑Time Vehicle Data](/teslamate-org/teslamate/how-does-the-streaming-module-receive-real-time-vehicle-data)

Discover how the TeslaMate streaming module gets real-time vehicle data via WebSocket connection. Learn about OAuth authentication and JSON parsing for efficient data flow.

- Tags: internals
- Published: 2026-06-16

### [How TeslaMate's Import Module Migrates Data from TeslaFi](/teslamate-org/teslamate/how-does-the-import-module-migrate-data-from-teslfi)

Learn how TeslaMate's import module migrates data from TeslaFi by converting CSV files into vehicle state events, recreating historical records without live API access.

- Tags: migration-guide
- Published: 2026-06-16

### [How the TeslaMate Geo-Fence Feature Creates Custom Locations: A Complete Technical Guide](/teslamate-org/teslamate/how-does-the-geo-fence-feature-create-custom-locations)

Learn how the TeslaMate Geo-fence feature creates custom locations by validating parameters, persisting to PostgreSQL, and enabling spatial queries. A technical deep dive.

- Tags: deep-dive
- Published: 2026-06-16

### [How the TeslaMate Geocoder Module Performs Automatic Address Lookup](/teslamate-org/teslamate/how-does-the-geocoder-module-perform-automatic-address-lookup)

Discover how the TeslaMate Geocoder module automatically looks up addresses using the Nominatim OpenStreetMap API. Learn how it fetches location data from coordinates.

- Tags: internals
- Published: 2026-06-16

### [How the TeslaMate Vehicles Module Manages Multiple Tesla Vehicles Simultaneously](/teslamate-org/teslamate/how-does-the-vehicles-module-manage-multiple-tesla-vehicles-simultaneously)

Manage many Tesla vehicles at once with TeslaMate. Discover how the Vehicles module uses GenStateMachine processes for parallel monitoring, fault isolation, and independent state tracking across your fleet.

- Tags: internals
- Published: 2026-06-16

### [How TeslaMate Publishes Vehicle Data to MQTT Topics Using the MQTT Publisher](/teslamate-org/teslamate/how-does-the-mqtt-publisher-publish-vehicle-data-to-topics)

Learn how TeslaMate publishes vehicle data to MQTT topics using the MQTT publisher. Explore its GenServer module and Tortoise311 client for reliable data delivery.

- Tags: internals
- Published: 2026-06-16

### [How TeslaMate Handles API Authentication and Automatic Token Refresh](/teslamate-org/teslamate/how-does-the-api-module-handle-tesla-authentication-and-token-refresh)

TeslaMate's API module securely handles Tesla authentication and automatically refreshes OAuth tokens before they expire, ensuring continuous vehicle data logging.

- Tags: internals
- Published: 2026-06-16

### [How the TeslaMate Vault Module Encrypts API Tokens Using AES-256-GCM](/teslamate-org/teslamate/how-does-the-vault-module-encrypt-api-tokens-using-aes-256-gcm)

Discover how the TeslaMate Vault module secures API tokens with AES-256-GCM encryption. Learn about key derivation hashing and Cloak library integration for robust security.

- Tags: internals
- Published: 2026-06-16

### [How TeslaMate Uses GenServer and Supervisor Patterns for Vehicle Management](/teslamate-org/teslamate/how-does-teslamate-use-genserver-and-supervisor-patterns-for-vehicle-management)

Discover how TeslaMate leverages GenServer and Supervisor patterns for robust vehicle management. Learn how its fault-tolerant design ensures reliable fleet operations and isolates vehicle processes.

- Tags: internals
- Published: 2026-06-16

