Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokens with incorrect ou_code (usually eu users) are not handled for wake up #249

Closed
jbanyer opened this issue May 28, 2024 · 2 comments
Closed
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@jbanyer
Copy link

jbanyer commented May 28, 2024

It appears that the Tesla auth API regularly issues access tokens with an incorrect ou_code. In particular, Tesla accounts in the EU region will sometimes be issued a token with ou_code=NA.

These tokens also include both the NA and EU API URLs in the aud value.

The command proxy uses the ou_code to select the appropriate URL from the aud list. This results in selecting the incorrect URL, which then leads to http 421 errors.

The command proxy has a workaround to detect the 421 error and update the stored URL to the correct one as returned in the error reply.

However, this "detect and adjust" workaround does not work for wake up commands sent to the wrong URL, as they don't seem to return anything. This means that if a vehicle is asleep before any commands have been sent, or the proxy is restarted, it is impossible to wake the vehicle.

@jbanyer
Copy link
Author

jbanyer commented Jan 9, 2025

FYI this is still occurring as of Jan 2025. A small number of our EU users have an access token with ou_code = NA

@thefireblade
Copy link
Collaborator

This is the same issue as #131. Will work on a solution to address this, but it's not going to look pretty either...

@thefireblade thefireblade added duplicate This issue or pull request already exists bug Something isn't working labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants