How to Connect Tesla to Home Assistant Without Draining the Battery Overnight
Some time ago, the official Tesla integration quietly disappeared from the standard Home Assistant distribution. The reason is mundane: the manufacturer reshuffled authentication once again, the API broke, and maintaining the official connector in the current state became too costly for the HA core team. Users were left with a choice: manage the car exclusively from their phone or cobble together workarounds.
Fortunately, the community quickly picked up the project. The alandtse/tesla repository took the old official code as a foundation, reworked the authentication logic, and became the main custom integration for electric car owners and Powerwall home battery users.
Why Bring Your Electric Car into a Smart Home
It might seem like Tesla has a convenient official app. Why bother setting up a smart home server?
The main reason is automations at the intersection of different systems. You can link cabin preheating to your bedroom alarm, open the garage gate when the vehicle approaches, or start charging strictly during off-peak electricity hours.
The integration creates dozens of entities in Home Assistant. Here are four areas that users typically work with:
- Climate and comfort control. Start the air conditioning, set precise temperature, enable seat and steering wheel heating, activate Camp Mode or Dog Mode.
- Body and lock control. Open the trunk, frunk, or charge port flap, close windows and lock doors.
- Telemetry monitoring. Tire pressure, charge level, estimated charging completion time, interior and exterior temperature, current coordinates.
- Home energy. If you have Tesla solar panels or a Powerwall battery, the integration collects data on grid power flows, home consumption, and current reserve.
The Main Dilemma: Vampire Drain vs. Fresh Data
Tesla vehicles go to sleep when idle to conserve charge in both the traction battery and the 12V auxiliary battery. If you send HTTP requests to the car every minute, the onboard computer simply won't enter sleep mode. Over 24 hours of such "activity," the battery can easily lose 2-4% capacity for no reason. The community has aptly named this phenomenon vampire drain.
The integration developers approached the problem carefully:
The default polling interval is set to 660 seconds (11 minutes). This duration wasn't chosen at random: most models need 11 to 15 minutes of peace and quiet to fall into deep sleep. When the integration polls Tesla servers, it first checks the status. If the car is asleep, the data request is cancelled, and the vehicle continues sleeping peacefully.
If you need instant data right before departure, you can wake the car with an automation. For example, send a harmless central lock closure command 10 minutes before leaving for work. The car will wake up, execute the command, and simultaneously update all sensors in Home Assistant.
For those already running TeslaMate, there's a separate killer feature: the integration can pull fresh telemetry directly from the local MQTT broker without extra requests to the cloud.
Configuration Nuances and Tesla Fleet API
Setup requires some effort. You won't be able to enter a familiar login and password: Tesla requires a refresh token. You can obtain it through third-party utilities for Android, iOS, or a special extension for Chromium browsers.
The second complication is more recent. Tesla shut down the old Owner API for most vehicles and moved control to the new Fleet API with end-to-end encrypted commands. Reading telemetry through the cloud is still straightforward, but sending control signals (open the trunk, enable heating) now requires a separate proxy server.
In the Home Assistant ecosystem, this task is handled by the Tesla HTTP Proxy add-on. You'll need to configure DuckDNS, Nginx, and certificates so that commands from your server are properly signed with keys and accepted by Tesla servers. The instructions in the project wiki are detailed, but basic network administration skills will definitely come in handy.
How to Install the Component
The fastest way to install the component is through HACS:
- Open HACS, go to the integrations section, and add the custom repository
https://github.com/alandtse/tesla. - Download the component and restart the Home Assistant server.
- Go to "Settings" -> "Devices and Services", click "Add Integration", and find Tesla Custom Integration.
- Paste the pre-generated token and, if necessary, specify the local proxy address.
Is It Worth Installing
If you have a Tesla and a deployed Home Assistant, there are practically no alternatives. The repository is actively maintained by the community, responds quickly to changes in the Tesla cloud, and handles the vehicle's battery carefully.
The project requires patience during the initial authorization and proxy setup phase. But once you link smart home scenarios with climate control and electric car charging, you won't want to go back to manual management through the official app.
Progetti correlati