core: Implementation not available - Tesla

The problem

Implementation not available - Tesla Integration asks for Oauth Token

What version of Home Assistant Core has the issue?

2025.1.0

What was the last working version of Home Assistant Core?

2024.12.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tesla

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: config_entries.py:668
First occurred: 11:26:18 PM (5 occurrences)
Last logged: 11:38:47 PM

Config entry '847b2c4a-2fb2-4457-8d0e-c6a421814d29' for tesla_fleet integration could not authenticate: Implementation not available

Additional information

I tried to create a tesla developer API Key, but it won’t allow my domain as a origin or redirect url. Can someone explain in detail what to put there?

Seems to be super complicated now to get this integration running.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 84 (11 by maintainers)

Most upvoted comments

Hey guys, I got it working and made notes here on what I did: https://www.wswapps.com/books/home-assistant/page/tesla-fleet-setup

I think this can be further simplified as it appears that the second API call to activate your app isn’t actually validated at all, so any domain and any public key could be used. But for now you need to find a URL where you can upload the public key. I might share mine, but don’t know if Tesla would be unhappy with that.

Edit: I cannot share my public key since Tesla only allows it to be used once. Until someone can create a process to easily host them on subdomains, you’ll need your own domain to host the file on.

Code-owners/maintainers- I’d be happy to close the PR if the key-hosting steps are likely to be changed soon anyhow.

I always want to be able to support people doing it themselves. However I quickly wrote a hosting solution for the public keys. Will be functional in the next few hours.

https://fleetkey.cc/

I run HA on a Intel NUC (with HA OS) and the DuckDNS plugin to access my HA installation from the internet.

I have read the current documentation:

https://www.home-assistant.io/integrations/tesla_fleet/

But the current documentation has a lot of open ends:

Is it correct I need to use https://my.home-assistant.io/redirect/oauth as redirect URL ? Is my.home-assistant.io not the the optional payed HA Cloud service (https://www.nabucasa.com) ? Like bpiet2000 I do not use the optional Cloud service.

For the Allowed Origin(s) URL I need to use my own DuckDNS public URL (for example MyHomeAssystant.DuckDNS.org) ?

Then ‘Step 3: Generate a Public/Private Key Pair’. Where do I do this ? On the Terminal add-on (Terminal & SSH) ?

https://github.com/home-assistant/addons/tree/master/ssh

Another loose end : where to store the private-key.pem and the public-key.pem ?

When generated it has to be available from the public internet according Tesla:

https://developer.tesla.com/docs/fleet-api/getting-started/what-is-fleet-api#step-2-create-an-application

In my setup (using the DuckDNS URL MyHomeAssystant.DuckDNS.org):

https://MyHomeAssystant.DuckDNS.org/.well-known/appspecific/com.tesla.3p.public-key.pem

How do I create this site ?

Then the last part ‘Step 4: Call the Register Endpoint’ : For now I gave up at step 3.

It would be nice the official documentation would get an update so I can get the Tesla integration working again.

Have anybody got this worked without hosting public key? Tried the custom integration method, but for me Tesla did not accepted duckdns.org domain for allowed url’s. I think after the public key is hosted and token with this key is fetched, it might work.

I am having the same issues as others. I created a machine to machine OAuth grant. I put in the OAuth Client ID and secret. After rebooting HA I get an error in the setting screen.
It then redirects me to auth.tesla.com and states that my redirect uri is not recognized. The redirect URI listed in the URL is https://my.home-assistant.io/redirect/oauth.
I do not use the home assistant cloud service at this moment.

Is there a way to host the public key from Step 3 of App creation in HA itself (assuming it has a publicly accessible domain), or do we need to host that elsewhere ourselves?

FYI https://fleetkey.cc is working again.

It’s also possible to use BLE. That solution offers basically the same information and control, is far easier to setup and doesn’t rely on any cloud stuff. You would just need some bluetooth receiver or proxy near the car. It would be quite easy to implement in HA as well. Just use something like https://github.com/wimaha/TeslaBleHttpProxy as a drop in replacement of the Tesla server.

This has also been mentioned in the 2025.1 release notes - Backward-incompatible changes

Hello all, I’ve completed all the steps succesfully but when I try to add the Tesla integration in Home Assistant I keep getting the error that the redirect URI is not recognized. I’m using DuckDNS and nginx proxy manager, does that have an impact?

“We don’t recognize this redirect_uri. Please use the redirect_uri found in your app details.”

I had the same issue. I had set my URI to https://my.home-assistant.io/redirect/oauth but I guess I did not have this ambiguous “My Home Assistant Internal Integration” set up? This Integration page says it’s “enabled by default” but it was not in my configuration.yaml.

https://www.home-assistant.io/integrations/my/

Anyways it was a super easy fix: just added my: to a free line in my configuration.yaml, rebooted HASS fully and then it let me auth.

image

But then I got this error:

image

I (eventually) resolved this one by following the Command Signing steps, rebooting several times, and finally removing the Application Credentials that I had created in my previous unsuccessful attempts to load the integration. Not sure which one did it but I think it was redoing the Application Creds because I even after following Command Signing steps I still can’t send commands…but I don’t understand how to get the tesla_fleet.key file into Home Assistant after adding the Virtual Key to my car…

BTW I was able to get this all up and running using a free domain from a Synology NAS (*.DSmyNAS.com) with a Let’s Encrypt! SSL Cert for my Reverse Proxy subdomain that I access Home Assistant from- I really thought Tesla was gonna have issue with at least one of those things in my setup.

I’ve added the my: to my configuration.yaml but unfortunately the issue persists… Redirect URI is not recognized. When you go to my.home-assistant.io, what do you see? Does it point to your DSmyNAS.com domain?

EDIT: I’ve finally managed to make it work. Turns out that the Tesla Developer dashboard is badly translated in Dutch. There’s a box for the redirect URI and one for the return URI and so the /redirect/oauth URI was in the wrong field. I can now read all entities but not yet send any commands, I’ll have to follow the additional steps for that.

It has to be unique for both elements, the fleetkey site should be giving a random subdomain, but it appears it isnt.

Oops that’s a bug! Fixing it now

Edit: it’s unique on every page load now.

Woke up this morning to find this “gift” from Tesla, just when i had gotten everything working as i wanted. So let me get this right, Tesla have changed how there API works and now we need to create an App to access this fleet data? also from Feb, they are looking to monetise app access over a specific number of requests?

For some reason I’m getting “unauthorized_client” at Step 4 on fleetkey.cc.

I have checked all the scopes in the application. Trying to register the domain in EU region.

P.S. duplicate comment is not intentional, it seems I and @Livefour2day were commenting at the same time 😃

@Bre77 many thanks for hosting the proxy! all good here.

@andeart - Great update to the documentation. I did mostly with the instructions there, with the exception of last curl to register the partner as EU url is https://fleet-api.prd.eu.vn.cloud.tesla.com/api/1/partner_accounts

thank you all!

I ended up spinning up a simple nginx docker container and allowing access to the key. Completed registration steps, but now how do I bypass “Account linking rejected”??? No matter what I tried - adding through the button. manually, in a different browser - the integration is always rejected before I even get to the credentials phase.

UPDATE: solved this by removing old application credential. Everything works without relying on a third party (well, kind of)
UPUPDATE: Thanks @Bre77 for this integration. I restored my 2024.12 instance backup and updated again to 2025.1. This way I didn’t have to delete the old integration of the credential. When I re-authenticated all my entities came back (most of the command entities were disabled and they stayed disabled)

I ran through the existing integration steps and thought the documentation was just missing details/clarity, so I made a PR. But seeing that we’re already exploring alternative solutions on this thread. Oops! 😅 Either way, I’m hoping the documentation updates I’m proposing provide temporary relief if nothing else.

Code-owners/maintainers- I’d be happy to close the PR if the key-hosting steps are likely to be changed soon anyhow.

Would it be possible for HA to implement a switch to enable ( or try ) the old unsupported oauth authorization? The day Tesla blocks it for good, HA can remove the code.

You can roll back to 2024.12 but at the time I removed the credentials Tesla was going to start charging me personally for everyones usage January 1st. Thankfully that got pushed back to February 1st so you all have some time to migrate.

Got this to work fairly simply in the end and hopefully these notes will help.

Scenario:

I have a DDNS provider to my Home Assistant instance. And access to other websites I own.

  1. Delete Old integration
  2. Create “Application” in Tesla Developer as Per Home Assistant Instructions here:

https://www.home-assistant.io/integrations/tesla_fleet

However in the Grant Origins I listed two https addresses (press the + to add a second)

https://[A webiste you can upload files to that you own] https://[my DDNS redirected to Homeassistant]

Redirect, as per the instructions

Once you are through this you can get your [Client ID] & [Client Secret] you will need both of these.

Create the public key as described in the Tesla Documentation (Step 3), I used my MAC for this but any Linux environment should do the trick. Copy then rename the public key file as per the instructions on the Tesla website (com.tesla.3p.public-key.pem) and upload it to

https://[A webiste you can upload files to that you own]/.well-known/appspecific/com.tesla.3p.public-key.pem

Using the curl commands again from the Tesla website (Step 4), though I have added them here to make life easier, I imported these into Postmaster.co website, NOTE the variables above I have given in [] are listed in the code and will need substituting in…

curl --request POST \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode 'client_id=[Client ID]' \
  --data-urlencode 'client_secret=[Client Secret]' \
  --data-urlencode 'scope=openid offline_access energy_device_data energy_cmds' \
  --data-urlencode 'audience=https://fleet-api.prd.eu.vn.cloud.tesla.com' \
  'https://fleet-auth.prd.vn.cloud.tesla.com/oauth2/v3/token'

Please also note above, as I am in Europe, I have to change the “Audience” to suit to enable this to work, more info here:

https://developer.tesla.com/docs/fleet-api/getting-started/base-urls

Please also note, the scope of my application, litterally just for my Powerwall, if you need further scope, please see:

https://developer.tesla.com/docs/fleet-api/authentication/overview#scopes

Make a note of the output after running the Curl command with Postman you will need the [Acess Token] for the next postman curl command

Next part…to get this thing working:


curl --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer [Acess Token]' \
  --data '{"domain":"[A webiste you can upload files to that you own]"}' \
  'https://fleet-api.prd.eu.vn.cloud.tesla.com/api/1/partner_accounts' 

Run the postman command and you “should” get an output detailing your account ID, domain, app name, a load of other stuff, and then your Public Key.

I then re-added the Tesla Fleet Home assistant integration, followed the instructions and “it just woooooorrrrrked”.

This was the output of clearing up a flood, and a few beers, so these notes may not make a alot of sense, but reading what others did, it aided me, and my ramblings may simplify (or confuse) 😄

I made it work and followed the instructions from @JaggedJax . Many thanks @JaggedJax. 🙏 Everything is easy except when it comes to hosting your public keys. I had to use a dedicated subdomain in my homelab setup (with Cloudfalre) to host the public keys.

I didn’t want to use nginx proxy manager add-on within Home Assistant as it creates much more complex environment when it comes to Cloudflared + HA already in place and working well. But this is certainly an option that folks can try.

Bottomline is that HA docs has to be updated with every possible options to host the public keys and at least couple of options are below:

  • Using HA nginx proxy manager add-on
  • Using dedicated domain/sub-domain to host the public keys

Hey guys, I got it working and made notes here on what I did: https://www.wswapps.com/books/home-assistant/page/tesla-fleet-setup

These are really good instructions, but every single registration needs to use unique origin domains and unique keys.

I don’t believe you’ll be able to piggyback off freakycowbot.com.

If this becomes a problem I may be able to code up a web hosting solution using wildcard DNS that also runs Step 3 and 4.

What sort of third party service is this? Might you be able to point us to examples?

@twoprops

Teslemetry (which I own and built specifically for Home Assistant) and Tessie.

@palros looks like the energy APIs are not billable endpoints, so hopefully they don’t look at including that. https://developer.tesla.com/docs/fleet-api/endpoints/energy#grid-import-export *Click the + on the API endpoint and it says not billable

Hey guys, I got it working and made notes here on what I did: https://www.wswapps.com/books/home-assistant/page/tesla-fleet-setup I think this can be further simplified as it appears that the second API call to activate your app isn’t actually validated at all, so any domain and any public key could be used. But for now you need to find a URL where you can upload the public key. I might share mine, but don’t know if Tesla would be unhappy with that. Edit: I simplified the instructions with my public key since the key doesn’t seem to matter. So feel free to use that to make it easier (unless/until I hear that’s a problem).

Seems like i get an error that the public key is already used

I got the same in postman: “error”: “Validation failed: Public key hash has already been taken”,

But it was able to connect integration to tesla. But yet after login to tesla and integration say it is successfull in the logs “2025-01-04 11:37:35.595 INFO (MainThread) [homeassistant.components.tesla_fleet] Successfully authenticated” integration is red with error “A condition is not been met to process the request”

I followed up with Niek instructions with the same url https://freakycowbot.com

Hey guys, I got it working and made notes here on what I did: https://www.wswapps.com/books/home-assistant/page/tesla-fleet-setup

I think this can be further simplified as it appears that the second API call to activate your app isn’t actually validated at all, so any domain and any public key could be used. But for now you need to find a URL where you can upload the public key. I might share mine, but don’t know if Tesla would be unhappy with that.

Edit: I simplified the instructions with my public key since the key doesn’t seem to matter. So feel free to use that to make it easier (unless/until I hear that’s a problem).

Seems like i get an error that the public key is already used

@bluemonkeysuit07 That was helpful; at least I’m able to install the integration again. Now the Tesla Fleet integration is saying “Failed setup, will retry: A condition has not been met to process the request.” At least now, though, I can continue troubleshooting. Thanks!

Yes, this integration is now complicated to get working due to the changes Tesla has made.

Please follow the documentation at https://www.home-assistant.io/integrations/tesla_fleet or use a third party service instead that handles all this for you.