# Tesla Fleet Setup

Instructions for setting up the Tesla Fleet integration in Home Assistant. This is an advanced setup process (for now).

1. Sign in with your Tesla Account credentials and create a new app. Give it a unique name to ensure no one else has used the same name: 
    1. [https://developer.tesla.com/dashboard](https://developer.tesla.com/dashboard)
2. In the Tesla app setting, set the **Redirect URL** to: `https://my.home-assistant.io/redirect/oauth`
3. For the **Allowed Origin(s)** setting you need a public domain where you can host a file. Hopefully soon we can simplify this step.  
    
    1. *Update:* You can use [https://fleetkey.cc/](https://fleetkey.cc/) if you don't have your own domain.
4. When asked, select all available scopes.
5. Generate a Public/Private Key Pair. See below:  
    
    1. Linux Instructions, run these commands:  
        
        1. `openssl ecparam -name prime256v1 -genkey -noout -out private-key.pem`
        2. `openssl ec -in private-key.pem -pubout -out public-key.pem`
    2. You now have two files: **private-key.pem** and **public-key.pem** which you'll need later
    3. You must place the public key on the Allowed Origins domain you specified at the following location: 
        1. *https://your-domain.com/***.well-known/appspecific/com.tesla.3p.public-key.pem**
6. Using [Postman](https://www.postman.com/) or a similar app, we need to make some API calls to Tesla now. 
    1. Here is a Postman collection you can import: [Tesla Fleet.postman\_collection.json](https://www.wswapps.com/attachments/1)
7. For the **Tesla Auth Token** call, fill in your **client\_id** and **client\_secret** from your Tesla Developer account, then click **Send** in postman. 
    1. This assumes Tesla North America or Asia-Pacific. **If you're in a different region like Europe**, find your URL here and update the **audience** field: [https://developer.tesla.com/docs/fleet-api/getting-started/base-urls](https://developer.tesla.com/docs/fleet-api/getting-started/base-urls)
8. You'll get back a response with an **access\_token** in quotes. Copy the value in the quotes.
9. Now open the **Tesla Partner Account** in postman. Go to the **Authorization** tab and enter it into the **Token** field.
10. Click the **Body** tab and in the quotes next to **domain** enter the same domain you entered in **Allowed Origin(s)** when you setup your app with Tesla (excluding the https:// portion).  
    
    1. Remember, you must place the public key you created on the Allowed Origins domain you specified at the following location: 
        1. *https://your-domain.com/***.well-known/appspecific/com.tesla.3p.public-key.pem**
11. **Send** the request in postman. If your file was in the correct place, you should get back a response. Otherwise you'll receive an error message with what went wrong.
12. Create new Application Credentials in your HA: [https://my.home-assistant.io/redirect/application\_credentials/](https://my.home-assistant.io/redirect/application_credentials/)
    1. Select **Tesla Fleet** as the Integration and Enter your app name, client\_id, client\_secret, then click **Add**
13. Reconnect the device in HA **Settings &gt; Devices &amp; services &gt; Tesla Fleet**

**Common Errors:**

- If you get the error "**We don't recognize this redirect\_uri. Please use the redirect\_uri found in your app details.**" 
    - In your Tesla Developer app settings, you may have swapped the "Redirect" and "Returned" URLs. It should look like this: [![image.png](https://www.wswapps.com/uploads/images/gallery/2025-03/scaled-1680-/QS9NBEJ2XTRxSilR-image.png)](https://www.wswapps.com/uploads/images/gallery/2025-03/QS9NBEJ2XTRxSilR-image.png)
- If you get the error "**A condition has not been met to process the request**" here are the most likely reasons: 
    - If you're in Europe of China, repeat steps 7 - 11 again, but change the **audience** field the one of the other ones listed in step 7.
    - Your public key file may not be properly hosted and available.
    - Your Client ID or Client Secret may be wrong in the Home Assistant Application Credentials. Double check them and remove/re-add them if needed.

**Notes:**

- This guide does not yet cover Command Signing which may be required by newer vehicles to perform actions. It is not required just to read stats: [https://www.home-assistant.io/integrations/tesla\_fleet#command-signing](https://www.home-assistant.io/integrations/tesla_fleet#command-signing)
- Each public key and Allowed Origin URL can only be used once. It cannot be shared with other Tesla apps.

[Leave a Comment](https://hostux.social/@JaggedJax/113768567045670284)