Integrating Tesla into Home Assistant (HA) is a very popular feature, but because Tesla’s official API changes frequently (especially after the Fleet API and stricter authentication were introduced in 2024), the built-in Tesla integration often no longer works.

The most stable and feature-complete solution today is to install the third-party Tesla Custom Integration through HACS (Home Assistant Community Store).

Below is the most up-to-date detailed guide as of 2024/2025.


Prerequisites

  • Home Assistant is installed and running normally.
  • HACS (the community store) is installed.
  • If you have not installed HACS yet, search for a “Home Assistant install HACS” tutorial first. It is an essential tool for anyone using HA.

A Tesla account (email and password).

A tool to obtain a token (covered below; you cannot simply log in with your password).


Step 1: Install the Tesla Custom Integration (via HACS)

Do not use the built-in “Tesla” integration in HA; it most likely will not work. We will use the version maintained by alandtse.

  • Open HACS in the left sidebar of Home Assistant.
  • Click Integrations.
  • Click Explore & Download Repositories in the bottom right corner.
  • Type Tesla in the search bar.
  • Find Tesla Custom Integration (the author is usually shown as alandtse or similar, so do not pick the wrong one).
  • Click into it, then click Download in the bottom right corner.
  • After the download finishes, restart Home Assistant (Settings -> System -> Restart).

Step 2: Obtain a Refresh Token

Because Tesla now enforces complex verification (MFA / verification codes), entering your account and password directly in HA usually fails. We need to generate a Refresh Token externally first.

The following third-party apps are recommended for safely obtaining a token (these apps are designed specifically for generating Tesla API tokens):

  • Android users: download Tesla Tokens (search on the Play Store or GitHub).
  • iOS / macOS users: download Auth for Tesla (search the App Store).
  • Generic web version (if you do not trust apps): you can use some open-source token generation scripts, but apps are currently the most convenient option.

Steps:

  • Open the app mentioned above.
  • Log in with your Tesla account.
  • Once logged in successfully, the app will generate a string of characters.
  • Locate and copy the Refresh Token.
  • Note: the token is a very long string, so make sure you copy it completely.

Step 3: Configure the integration in Home Assistant

  • Make sure HA has finished restarting.
  • Click Settings -> Devices & Services in the left sidebar.
  • Click Add Integration in the bottom right corner.
  • Search for Tesla Custom Integration (note: it may appear as “Tesla” with a red T icon. Make sure it is the one you just installed via HACS. If two Tesla entries appear in the list, usually pick the one marked “Custom” or the one listed first; if there is only one, just click it).
  • In the configuration dialog that appears:
  • Email: enter your Tesla account email.
  • Refresh Token: paste the long string obtained in step 2.
  • Access Token (optional): usually not needed, leave it blank.
  • URL Proxy (optional): leave it blank if you have not set up your own Fleet API proxy.

Click Submit.

If everything goes well, HA will connect to the Tesla servers and prompt you to choose which “region” to place the vehicle in. When finished, you will see a new device (your car’s name).


Step 4: Verify functionality and understand the entities

After a successful setup, go to “Devices & Services”, find Tesla and open its “devices” page. You will see dozens of entities.

Commonly used entities include:

  • Binary Sensor:
  • binary_sensor.tesla_online: whether the car is online (awake).
  • binary_sensor.tesla_charging: whether the car is currently charging.
  • binary_sensor.tesla_parking_brake: parking brake status.

Sensor:

  • sensor.tesla_battery_level: battery percentage.
  • sensor.tesla_range: remaining range.
  • sensor.tesla_charging_rate: charging rate.
  • sensor.tesla_location: vehicle location (used for map tracking).
  • sensor.tesla_inside_temperature: interior temperature.

Switch (controllable):

  • switch.tesla_charger: start/stop charging.
  • switch.tesla_sentry_mode: Sentry Mode switch.
  • switch.tesla_heated_steering_wheel: heated steering wheel.

Lock:

  • lock.tesla_door_lock: door lock control.

Climate:

  • climate.tesla_hvac_climate_system: turn the climate system on/off and set the temperature.

Step 5: A critical setting – keep the car from “insomnia” (power drain)

This is the most important step! If configured incorrectly, HA will keep polling the vehicle state, preventing the car from sleeping and causing severe vampire drain.

  • On the Tesla integration page, click your device and find the Configure button (or click “Options” on the integration list page).
  • Enable Polling:
  • By default, this integration attempts intelligent polling.
  • It is recommended to check the settings under Active polling, but do so carefully.

Strongly recommended settings:

  • Polling Policy: make sure HA does not force-wake the vehicle while it is sleeping.
  • The integration usually handles this automatically: when binary_sensor.tesla_online becomes Off, HA stops sending commands until you manually trigger a switch (such as turning on the climate) or the car wakes up on its own (such as when you open a door).
  • You can set the Wake Up policy in the integration options. If you do not need HA to control the car at any time, it is recommended to turn off “automatic wake up”.

Best practices:

  • Do not create an automation that checks the battery every minute.
  • Use the HA button.tesla_wake_up entity. If you need to operate the vehicle (for example, an automation that turns on the climate at 8 AM), call the “wake up vehicle” service before calling the “turn on climate” service, wait a few seconds, and then send the command.

Advanced: how to create automations (examples)

Scenario: charge automatically when your solar panels produce excess power, or charge during off-peak electricity rates.

  • Trigger: the time is 10:00 PM (off-peak rates begin).
  • Condition: the car is at home (device_tracker.tesla_location is in the Home zone) and is plugged in (binary_sensor.tesla_charger_sensor is Connected).
  • Action:
  • Call service: switch.turn_on -> Target: switch.tesla_charger.

Scenario: cool the car automatically before heading out in summer.

  • Trigger: your phone alarm stops (on Android) or the time reaches 8:00 AM.
  • Action:
  • Call service: climate.set_temperature -> Target: Tesla climate -> Temperature: 22 degrees.
  • Call service: climate.set_hvac_mode -> Mode: Heat/Cool.

Common issues and troubleshooting

  • 401 / 403 error (Authentication Failed):
  • The Refresh Token has expired. Generate a new token with the app, then click “Reconfigure” on the HA integration page and enter the new token.

The car never sleeps:

  • Check whether other third-party apps (such as TeslaFi or Tessie) are also polling frequently.
  • In the HA integration options, turn off “Wake up on start”.

Control delay:

  • This is normal. If the vehicle is asleep, sending a command must first wake it up (about 15-30 seconds) before the action can be executed.

API limits (Fleet API):

  • Tesla now limits the number of API calls. If you find that you cannot control the car at all, you may have exceeded the daily call limit; pausing for a day usually restores it automatically.

I hope this tutorial helps you successfully integrate Tesla into Home Assistant!

About the author — Laite Intelligent was founded in 2010 and focuses on complete smart home solutions. Now ALL IN Home Assistant.

相关新闻

cloud@haiots.com

QQ
微信