I'm completely stuck trying to get the Tesla Fleet integration installed. I'm following the instructions here.
- I've created a Tesla developer account
- I've created my application (I already have my own website to store the public key at)
- I have a Client ID and Client Secret from the developer site
When I try to install the Tesla Fleet integration, I experience the following things:
- I'm told: "This step requires you to visit an external website to be completed." and I click the button to visit the external site
- This opens a new browser tab to (Tesla Auth) where I submit my username, password, and MFA key
- The web page momentarily says something like "Authentication successful" and then I'm presented with a page at Link to OAuth2 Authorize Callback – My Home Assistant informing me that I'm about to be redirected to my local HA URL.
- I click "Link Account"
- The tab disappears
- The original tab I was installing the integration from now has a pop-up saying: "OAuth authorization error while obtaining access token."
- The logs get an entry reading: "ERROR (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Error resolving OAuth token: 400, message='Bad Request', url='Tesla Auth'"
I've verified that the client ID and client secret are valid by using the manual partner token generation request described on this Tesla page.
I was able to self-generate a keypair by following this Tesla page and put the private key at config/tesla_fleet.key and the public key at my website's .well-known/appspecific/com.tesla.3p.public-key.pem location, which, as I expected, didn't help.
The Client Details I have at the Tesla Developer site are:
Allowed Origin(s): https://<domain_redacted>/
Allowed Redirect URI(s): https://my.home-assistant.io/redirect/oauth
Allowed Returned URL(s): (empty)
I guess this is all to say that I can probably do all of the key setup and token generation manually if I just knew where to put all of the data in the HA filesystem, but I'd really prefer that the documented setup procedure just work. I'm trying my best to follow the steps to the letter, but it keeps failing.
Suggestions?