Tesla Oauth failure

Hi all,

I’m trying to integrate my Tesla Model Y into Home Assistant. I’m following this guide:
Tesla Fleet - Home Assistant

I’ve setup a Tesla developer account and generated oauth credentials:

Said oauth credentials are configured to use in the integration:

Redirect is working just fine:

But then I just get:

And in the logs it shows bad request as cause:

I’m running HAOS on a Raspberry Pi 5, version 2026.9.0.

This is my first community post, I’ve searched the forums and the internet and found a few similar cases but none of them managed to resolve my issue. I’ve tried to regenerate the oauth tokens on the Tesla portal a few times but far no luck.

Any and all advice is welcome. Also let me know if I should update or change something about this first initial post.

Greetings.

Also, I’ve tried to fetch a token with my credentials using postman, which was succesful:

So that is strange indeed.

I’ve also tried the following to no avail:
Removed application credentials
Restarted Home Assistant
Redone the wizard (with credentials copied from Postman)

Same error.

Solve it. Turns out the integration doesn’t URL encode properly.
Tesla generated a % in the secret which got encoded instead of sent as plain text.
Creating a new app until no HTML characters where present (I now have a * and a ^) resulted in successful authentication.