$ show PedroKTFC/esphome-tesla-ble
This repository is an ESPHome custom component and configuration pack that turns an ESP32 into a BLE bridge for controlling Tesla vehicles. It implements a `tesla_ble_listener` component that connects to the car's BLE advertisement/command channel, encrypts/decrypts Tesla's proprietary BLE messages using a forked `tesla-ble` library, and exposes ESPHome services, buttons, sensors, and selectors for actions like lock/unlock, frunk/trunk, climate, and cabin overheat protection. The repo is primarily YAML package definitions and C++ component code, with a Makefile and CI workflow for building board-specific firmware.
The LLM identified 4 files worth highlighting for reuse:
Implements a table-driven dispatcher for Tesla BLE commands. Each action (lock, unlock, frunk, etc.) is defined as a row in a localActionDef table with message contents, so adding a new command requires only a new table row, not new C++ logic. Demonstrates a clean separation of protocol details from control flow and is a good reference for BLE command handlers.
ESPHome component configuration schema and validation. Performs VIN format checks, secret substitution, and multi-car secret handling with clear error messages. Shows how to build robust custom ESPHome component validators that fail fast with actionable diagnostics.
Build orchestration for ESPHome projects: creates a Python venv, installs pinned requirements, validates YAML, and compiles board-specific firmware. Uses touchfiles to avoid redundant rebuilds and supports BOARD variable for multiple targets. A reusable pattern for ESPHome-based firmware repos.
CI pipeline that validates ESPHome configurations and builds firmware for supported boards. Catches YAML errors and compilation failures before merge. Standard but effective for an ESPHome component repo.