Tesla Fleet

The Tesla Fleet API integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] exposes various sensors from Tesla vehicles and energy sites.

Prerequisites

You must have a Tesla account and a Tesla vehicle, PowerWall, Solar, or Wall Connector, and must not have disabled the My Home Assistant integration.

Use a custom OAuth application

The integration has a built-in OAuth application that will be suitable for most users. However, you can create your own application for the Tesla Fleet API and configure it as an application credential. When creating the application, you must set https://my.home-assistant.io/redirect/oauth as the redirect URL.

You will be prompted to pick your custom application credential when creating a Tesla Fleet config entry.

Configuration

To add the Tesla Fleet integration to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

  • Browse to your Home Assistant instance.

  • Go to Settings > Devices & Services.

  • In the bottom right corner, select the Add Integration button.

  • From the list, select Tesla Fleet.

  • Follow the instructions on screen to complete the setup.

Scopes

When connecting your Tesla account to Home Assistant, you must select the Vehicle Information or Energy Product Information scope. It is recommended you select all scopes for full functionality.

Rate limits

Tesla restricts open-source integrations to the “Discovery” plan which only allows for 200 vehicle data requests per day. The integration will initially poll every 90 seconds, making vehicle data requests only when the vehicle is awake, and then dynamically slow down polling based on how many vehicle data requests have been made in the last 24 hours.

Entities

These are the entities available in the Tesla Fleet integration. Not all entities are enabled by default, and not all values are always available.

Vehicles

Domain Name Enabled
Binary sensor Battery heater No
Binary sensor Cabin overheat protection actively cooling No
Binary sensor Charge cable Yes
Binary sensor Charger has multiple phases No
Binary sensor Dashcam No
Binary sensor Front driver door Yes
Binary sensor Front driver window Yes
Binary sensor Front passenger door Yes
Binary sensor Front passenger window Yes
Binary sensor Preconditioning enabled No
Binary sensor Preconditioning No
Binary sensor Rear driver door Yes
Binary sensor Rear driver window Yes
Binary sensor Rear passenger door Yes
Binary sensor Rear passenger window Yes
Binary sensor Scheduled charging pending No
Binary sensor Status Yes
Binary sensor Tire pressure warning front left No
Binary sensor Tire pressure warning front right No
Binary sensor Tire pressure warning rear left No
Binary sensor Tire pressure warning rear right No
Binary sensor Trip charging No
Binary sensor User present Yes
Device tracker Location Yes
Device tracker Route Yes
Sensor Battery level Yes
Sensor Battery range Yes
Sensor Charge cable No
Sensor Charge energy added Yes
Sensor Charge rate Yes
Sensor Charger current Yes
Sensor Charger power Yes
Sensor Charger voltage Yes
Sensor Charging Yes
Sensor Distance to arrival Yes
Sensor Driver temperature setting No
Sensor Estimate battery range No
Sensor Exterior color No
Sensor Fast charger type No
Sensor Ideal battery range No
Sensor Inside temperature Yes
Sensor Odometer No
Sensor Outside temperature Yes
Sensor Passenger temperature setting No
Sensor Power No
Sensor Roof color No
Sensor Scheduled charging mode No
Sensor Scheduled charging start time No
Sensor Scheduled departure time No
Sensor Shift state No
Sensor Speed No
Sensor State of charge at arrival No
Sensor Time at arrival Yes
Sensor Time at full charge Yes
Sensor Time to arrival Yes
Sensor Time to full charge Yes
Sensor Tire pressure front left No
Sensor Tire pressure front right No
Sensor Tire pressure last measured front left No
Sensor Tire pressure last measured front right No
Sensor Tire pressure last measured rear left No
Sensor Tire pressure last measured rear right No
Sensor Tire pressure rear left No
Sensor Tire pressure rear right No
Sensor Traffic delay No
Sensor Usable battery level No

Energy sites

Domain Name Enabled
Binary sensor Backup capable Yes
Binary sensor Grid services active Yes
Binary sensor Grid services enabled Yes
Sensor Battery power Yes
Sensor Energy left Yes
Sensor Generator power No
Sensor Grid power Yes
Sensor Grid services power Yes
Sensor Island status Yes
Sensor Load power Yes
Sensor Percentage charged Yes
Sensor Solar power Yes
Sensor Total pack energy No
Sensor VPP backup reserve Yes
Sensor Version Yes

Wall connector

Domain Name Enabled
Sensor Fault state No
Sensor Power Yes
Sensor State Yes
Sensor Vehicle Yes

Vehicle sleep

Constant API polling will prevent most Model S and Model X vehicles manufactured before 2021 from sleeping, so the integration will stop polling these vehicles for 15 minutes, after 15 minutes of inactivity. You can call the homeassistant.update_entity service to force polling the API, which will reset the timer.

Energy dashboard

The Tesla Fleet API only provides power data for Powerwall and Solar products. This means they cannot be used on the energy dashboard directly.

Energy flows can be calculated from Battery power and Grid power sensors using a Template Sensor to separate the positive and negative values into positive import and export values. The Load power, Solar power, and the templated sensors can then use a Riemann Sum to convert their instant power (kW) values into cumulative energy values (kWh), which then can be used within the energy dashboard.