For those that have a Tesla Car & HA integration or similar

I also launched a REST API integration for Voltayze (https://voltayze.com). This runs on the Tesla Fleet official telemetry service. Besides all the reporting you are getting (similar to Teslamate but with more features) , now you can use the RestAPI to pull the data in Homeassistant (using the REST integration). Commands will be supported next.
I would appreciate if I can get some feedback: REST API Integration - Voltayze, Electric Data, Smart Analytics

2 Likes

I’ve produced an automation to open my electric gate that differentiates my leaving and arriving. I found the car has some idiosyncrasies that made a simple approach not work. I’ve documented it here in my substack.

1 Like

Left a comment but thought I would add my method, it works for any car.

The Tesla broadcasts an iBeacon all the time. I use an esp32 in the garage to see if the car is located there. Connected to the same esp32 I have a sonar, this used the distance to tell if the car is in the spot. Between these 2 sensors I have the garage door opening and closing quite well. I also put an iBeacon in my old truck and get all the same advantages.

2 Likes

Thanks for the comment. I’ve replied. I’ve actually been looking at the BLE option for a while as it happens.

For Bluetooth tracking I use Bermuda.

I use GitHub - yoziru/esphome-tesla-ble: Interact with Tesla vehicles over BLE using ESPHome and Home Assistant in an ESPHome device which generally works fine. Are there any dis/advantages to Bermuda?

2 Likes

Not sure, Bermuda is just what I ended up with for location tracking. If the Tesla Bluetooth integration updates location when your within range of the Bluetooth extender and you are able to tell that it is connected to the extender at the gate it should work.
Of the solutions I have tried I like this way the best, the garage opens about when I hit the bottom of the driveway and closes when I am about fifty feet away.
I can move my car into the driveway and the garage doesn’t close on me.

1 Like

Hi,
Great thread!
I have a question about the Tesla API key pairing, can I use Bluetooth (BLE) instead of the standard cloud based method?
The reason I ask is that my HAOS is installed on a Raspberry Pi which has built-in Bluetooth. I was hoping I could just relocate it to the garage where the Tesla lives. This would keep all the OAuth handshaking local which seems like a simpler solution…

I use this custom integration: GitHub - alandtse/tesla: Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.

I have a microswitch in my charge cable holder, connected to HA through MQTT, sending a message with the Tesla integration to open the charge door when I pull the plug out of the holder, ready to plug in. And a button on the holder that I can push to unlock the charging cable.

I also have set up integration with Google calendar so that charge levels are set, and car is heated up at the correct times, plus that I get a notification if I forgot to plug the car in the evening before the car is to be used. And lowering the charge level.

1 Like

Let me revive the post just to tell you that I use the custom integration available on HACS to open and close my garage door when I’m arriving or leaving home. This and accessing powerwalls 3 energy dashboard is what i currently use for tesla integration on HA

That’s not helpful, please tell us which one.

Sorry, here it is

We have a 23kw solar system and I was able to do manage the charging via local tuya using a grecell charger. My automations set charging current to prevent the inverter from exceeding its limit and also limiting charging current so that the solar power is split between the house and car battery instead of having the house battery charge the car battery.

In case anyone gets here looking for a BLE option I have significantly extended an original BLE ESPHome project here: GitHub - PedroKTFC/esphome-tesla-ble: Interact with Tesla vehicles over BLE using ESPHome and Home Assistant

4 Likes

I have a number of pretty decent use cases.

I use it to control solar energy consumption as a means to avoid exporting power. I do this by controling the car locally via Bluetooth using this - GitHub - tesla-local-control/tesla_ble_mqtt_docker but also I run this Blueprint - GitHub - flashg1/evSolarCharger: Home Assistant Blueprint using OCPP and/or EV specific API to charge EV from surplus solar and weather forecast..

I also use Teslemetry for cloud based control when the car isn’t home so I can have an Android widget screen on my phone to trigger things like the heater or boot.

I pull an .ical file from local gov with all the school holidays in it, and then use that to create a switch of School Holidays On/Off. I do the same for public holidays. And using a template have a switch for Is it a holiday or not.

I also have a weather station outside (Ecowitt) that get outside temps, and an intergration with our federal weather forcasting service.

With all those bits, I built an Automation that will turn on the heater, and warm the seats and steering wheel, 5 minutes before school drop off, but only if it’s not a holiday, and only if it’s below 15c. If it’s below 8c it will automatically defrost the car as well as put the heater on.

Great, I intend to use your code but I can’t get it to run correctly. I am running it on a M5stick nanoc6 and the latest version of HA.

here is the code

substitutions:
  esphome_name: espteslakey
  esphome_comment: Tesla eKey
  esphome_project_name: "Tesla.eKey Project"
  esphome_project_version: "tesla_e_key_2025_10_31"
  device_name: teslaekey_nano_c6
  friendly_name: "Tesla eKey"
  global_update_interval: 15min
  wifi_update_interval: 24h

esphome:
  name: ${device_name}
  friendly_name: ${friendly_name}
  comment: ${esphome_comment}
  project:
    name: ${esphome_project_name}
    version: ${esphome_project_version}
  platformio_options:
    lib_ldf_mode: deep+
    lib_deps:
      - nanopb/[email protected]
      - https://github.com/PedroKTFC/tesla-ble.git#main   

esp32:
  variant: esp32c6
  board: esp32-c6-devkitc-1   
  framework:
    type: esp-idf              

logger:
  level: INFO

api:
  encryption:
    key: !secret api_encryption_key

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  power_save_mode: none
  ap:
    ssid: "${friendly_name} Fallback"

# BLE scan base + VCSEC BLE client
esp32_ble_tracker:

ble_client:
  - mac_address: !secret tesla_ble_mac
    id: tesla_vcsec

external_components:
  - source: github://PedroKTFC/esphome-tesla-ble
    components: [tesla_ble_vehicle]

# Fork expects these polling params; types are strict
tesla_ble_vehicle:
  ble_client_id: tesla_vcsec
  vin: !secret tesla_vin
  update_interval: 10s
  post_wake_poll_time: 300
  poll_data_period: 60
  poll_asleep_period: 120
  poll_charging_period: 10
  ble_disconnected_min_time: 300
  fast_poll_if_unlocked: 0
  wake_on_boot: false

# Diagnostics
sensor:
  - platform: ble_client
    type: rssi
    ble_client_id: tesla_vcsec
    id: tesla_ble_rssi
    name: "Tesla BLE RSSI"
    update_interval: 5s
    filters:
      - sliding_window_moving_average:
          window_size: 10
          send_every: 1

  - platform: template
    id: tesla_ble_signal_pct
    name: "Tesla BLE Signal (%)"
    unit_of_measurement: "%"
    update_interval: 5s
    lambda: |-
      if (isnan(id(tesla_ble_rssi).state)) return NAN;
      const float rssi = id(tesla_ble_rssi).state;  // ~ -90..-30 dBm
      float pct = (rssi + 90.0f) * (100.0f / 60.0f); // -90→0%, -30→100%
      if (pct < 0) pct = 0;
      if (pct > 100) pct = 100;
      return pct;

  - platform: wifi_signal
    name: "ESP Wi-Fi RSSI"
    update_interval: ${wifi_update_interval}

  - platform: uptime
    name: "ESP Uptime"

# Pull in text_sensor headers (component includes them)
text_sensor:
  - platform: template
    id: _ts_placeholder
    name: "TS Placeholder"
    internal: true
    lambda: |-
      return std::string("");

binary_sensor:
  - platform: status
    name: "ESP Online"

switch:
  - platform: restart
    name: "${device_name} Restart"

And a screenshot

Can you raise an issue in the repository GitHub - PedroKTFC/esphome-tesla-ble: Interact with Tesla vehicles over BLE using ESPHome and Home Assistant. I don’t use that board but others do and will undoubtedly be able to help. I am also in the process of updating the readme to cover different board types.

This yaml works for me for M5Stack NanoC6:

# this configuration is for the M5Stack NanoC6
substitutions:
  # all substitutions for this project
  #espidf_version: 5.3.0
  #platformio_version: 6.8.1
  #friendly_name: Tesla BLE
  #device_name: tesla-ble
  device_description: Tesla BLE
  #board: esp32dev
  #variant: esp32
  flash_size: 4MB
  ble_mac_address: !secret ble_mac_address
  tesla_vin: !secret tesla_vin
  charging_amps_max: "16"

esphome:
  name: ble4tesla
  friendly_name: ble4tesla

  project:
    name: PedroKTFC.esphome-tesla-ble
    version: "2025.5.1"
  libraries:
    - TeslaBLE = https://github.com/PedroKTFC/tesla-ble.git

esp32:
  board: esp32-c6-devkitc-1
  framework:
    type: esp-idf

# Enable logging
logger:
  level: INFO

# Enable Home Assistant API
api:
  encryption:
    key: "redeacted"

ota:
  - platform: esphome
    password: "redacted"

wifi:
  networks:
  - ssid: !secret wifi_ssid_2
    password: !secret wifi_password_2
  
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
    manual_ip: 
      static_ip: 192.168.178.150
      gateway: 192.168.178.1
      subnet: 255.255.255.0
      dns1: 192.168.178.1
  use_address: 192.168.178.203
  
  #domain: ".fritz.box"
     #  use_address: "192.168.178.111"
  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Ble4Tesla Fallback Hotspot"
    password: "redacted"

improv_serial:
#  next_url: http://{{ip_address}}?device_name={{device_name}}&ip_address={{ip_address}}&esphome_version={{esphome_version}}

captive_portal:

web_server:
  port: 80
  version: 3

time:
  - platform: homeassistant
    id: homeassistant_time
    timezone: Europe/Madrid

external_components:
  source: github://PedroKTFC/esphome-tesla-ble/components

packages:
  #base: github://PedroKTFC/esphome-tesla-ble/packages/base.yml
  #device_base: github://PedroKTFC/esphome-tesla-ble/boards/esp32-generic.yml
  client: github://PedroKTFC/esphome-tesla-ble/packages/client.yml

tesla_ble_vehicle:
  odometer:
    name: "Odometer" # Rename if desired
    unit_of_measurement: "km"
    filters:
      - multiply: 1.60934 # Convert miles to kms
  battery_range:
    name: "Range"
    unit_of_measurement: "km"
    filters:
      - multiply: 1.60934 # Convert miles to kms

  #update_interval: 30s # ha_update_interval    #30s # Base polling interval, used for VCSEC sensors
  #post_wake_poll_time: 300               # How long to poll for data after car awakes (s)
  #poll_data_period: 60                   # Normal period when polling for data when not asleep (s)
  #poll_charging_period: 30               # Period to poll for data when charging (s)
  #poll_asleep_period: 600                # Period to poll for data when asleep (s)

text_sensor:
  - platform: version
    name: "Firmware Version"
  - platform: wifi_info
    ip_address:
      name: "IP Address"
      entity_category: diagnostic
    ssid:
      name: "Connected SSID"
      entity_category: diagnostic
    mac_address:
      name: "Mac Address"
      entity_category: diagnostic    

Just wanted to confirm this is working with a Seeed esp32c6, using the following (everything else default):

  board: "esp32-c6-devkitc-1"
  variant: "esp32c6"
1 Like