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 |
---|---|---|
For ESPHome dashboard, see
tesla-ble-example.yml
secrets.yaml.example
to secrets.yaml
and update it with your WiFi credentials (wifi_ssid
and wifi_password
) and vehicle VIN (tesla_vin
).tesla_ble_listener
package in packages/base.yml
and build the firmware.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][I][tesla_ble_listener:054]: Found Tesla vehicle | Name: S1a87a5a75f3df858C | MAC: A0:B1:C2:D3:E4:F5
tesla_ble_listener
package in packages/base.yml
and running
make clean
Connect your ESP32 device to your computer via USB
Copy and rename secrets.yaml.example
to secrets.yaml
and update it with your WiFi credentials (wifi_ssid
and wifi_password
) and vehicle details (ble_mac_address
and tesla_vin
)
Build the image with ESPHome
make compile BOARD=m5stack-nanoc6
Upload/flash the firmware to the board.
make upload
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
esphome
command. You can also use theesphome
commands directly if you prefer (e.g.esphome compile tesla-ble-m5stack-nanoc6.yml
)
secrets.yaml
file when prompted.secrets.yaml
is correct.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