This project lets you use an ESP32 device to manage charging a Tesla vehicle over BLE, using the yoziru/tesla-ble library. Tested with M5Stack NanoC6 and Tesla firmwares 2024.26.3.1.
| Controls | Sensors | Diagnostic |
|---|---|---|
![]() |
![]() |
![]() |
- Pair BLE key with vehicle
- Wake up vehicle
- Use Charging Manager role (wake command not yet supported as of 2024.26.3.1)
- Set charging amps
- Set charging limit (percent)
- Turn on/off charging
- BLE information sensors
- Asleep / awake
- Doors locked / unlocked
- User present / not present
- Charging flap open / closed (only when vehicle is awake)
- BLE signal strength
The component supports configurable polling intervals to balance responsiveness and battery life:
tesla_ble_vehicle:
# ... other configuration ...
# Polling intervals (in seconds)
vcsec_poll_interval: 10 # Vehicle status polling (default: 10s, range: 5-300s)
infotainment_poll_interval_awake: 30 # Data polling when awake (default: 30s, range: 10-600s)
infotainment_poll_interval_active: 10 # Data polling when active (default: 10s, range: 5-120s)
infotainment_sleep_timeout: 660 # Wake window duration (default: 11min, range: 1-60min)Polling Types:
- VCSEC: Basic vehicle status (sleep/awake, locked/unlocked, user presence) - safe to poll when asleep
- Infotainment Awake: Detailed data (battery, charging state) when awake but not active
- Infotainment Active: Frequent updates when charging, unlocked, or user present
Smart Wake Management: The system respects Tesla's sleep behavior by polling infotainment data only during an 11-minute wake window, then allowing the vehicle to sleep. Active states (charging/unlocked/user present) override this timeout for continuous monitoring.
For ESPHome dashboard, see
tesla-ble-example.yml
- Python 3.10+
- GNU Make
- Copy and rename
secrets.yaml.exampletosecrets.yamland update it with your WiFi credentials (wifi_ssidandwifi_password) and vehicle VIN (tesla_vin). - Enable the
tesla_ble_listenerpackage inpackages/base.ymlby uncommenting thelistener: !include listener.ymlline. - Build and flash the firmware to your ESP32 device. See the 'Building and flashing ESP32 firmware' section below.
- Open the ESPHome logs in Home Assistant and wake it up. Watch for the "Found Tesla vehicle" message, which will contain the BLE MAC address of your vehicle.
Note: The vehicle must be in range and awake for the BLE MAC address to be discovered. If the vehicle is not awake, open the Tesla app and run any command
[00:00:00][D][tesla_ble_listener:044]: Parsing device: [CC:BB:D1:E2:34:F0]: BLE Device name 1 [00:00:00][D][tesla_ble_listener:044]: Parsing device: [19:8A:BB:C3:D2:1F]: [00:00:00][D][tesla_ble_listener:044]: Parsing device: [19:8A:BB:C3:D2:1F]: [00:00:00][D][tesla_ble_listener:044]: Parsing device: [F5:4E:3D:C2:1B:A0]: BLE Device name 2 [00:00:00][D][tesla_ble_listener:044]: Parsing device: [A0:B1:C2:D3:E4:F5]: S1a87a5a75f3df858C [00:00:00][I][tesla_ble_listener:054]: Found Tesla vehicle | Name: S1a87a5a75f3df858C | MAC: A0:B1:C2:D3:E4:F5 - Clean up your environment before the next step by disabling the
tesla_ble_listenerpackage inpackages/base.ymland runningmake clean
If you are already running an instance of ESPHome, you can also include this repository directly by including it as a package. The main benefit here is having centralized management of all your ESPhome devices. To do this, you can use the following config for your device:
substitutions:
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
wifi_hotspot_password: !secret wifi_hotspot_password
ota_password: !secret ota_password
api_encryption_key: !secret api_encryption_key
ble_mac_address: !secret ble_mac_address
tesla_vin: !secret tesla_vin
packages:
remote_package_shorthand: github://yoziru/esphome-tesla-ble/tesla-ble-m5stack-nanoc6.dashboard.yml@main
Be sure to use the correct .dashboard.yml file for your board. Also make sure you have the secrets defined otherwise it will not work and use defaults from this repository.
-
Connect your ESP32 device to your computer via USB
-
Copy and rename
secrets.yaml.exampletosecrets.yamland update it with your WiFi credentials (wifi_ssidandwifi_password) and vehicle details (ble_mac_addressandtesla_vin) -
Build the image with ESPHome. Alternate boards are listed in the
boards/directory.make compile BOARD=m5stack-nanoc6
-
Upload/flash the firmware to the board.
make upload BOARD=m5stack-nanoc6
-
After flashing, you can use the log command to monitor the logs from the device. The host suffix is the last part of the device name in the ESPHome dashboard (e.g.
5b2ac7).make logs HOST_SUFFIX=-5b2ac7
-
For updating your device, you can OTA update over local WiFi using the same host suffix:
make upload HOST_SUFFIX=-5b2ac7
Note: the make commands are just a wrapper around the
esphomecommand. You can also use theesphomecommands directly if you prefer (e.g.esphome compile tesla-ble-m5stack-nanoc6.yml)
- In Home Assistant, go to Settings > Devices & Services. If your device is discovered automatically, you can add it by clicking the "Configure" button by the discovered device. If not, click the "+ Add integration" button and select "ESPHome" as the integration and enter the IP address of your device.
- Enter the API encryption key from the
secrets.yamlfile when prompted. - That's it! You should now see the device in Home Assistant and be able to control it.
-
Make sure your ESP32 device is close to the car (check the "BLE Signal" sensor) and the BLE MAC address and VIN in
secrets.yamlis correct. -
Get into your vehicle
-
In Home Assistant, go to Settings > Devices & Services > ESPHome, choose your Tesla BLE device and click "Pair BLE key"
-
Tap your NFC card to your car's center console
-
A prompt will appear on the screen of your car asking if you want to pair the key
Note: if the popup does not appear, you may need to press "Pair BLE key" and tap your card again
-
Hit confirm on the screen
-
To verify the key was added, tap Controls > Locks, and you should see a new key named "Unknown device" in the list
-
[optional] Rename your key to "ESPHome BLE" to make it easier to identify



