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

Open
jbanyer opened this issue May 28, 2024 · 0 comments

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant