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

Move to Fleet API and Tesla Vehicle Command SDK #150

Open
RichieB2B opened this issue Nov 11, 2023 · 5 comments
Open

Move to Fleet API and Tesla Vehicle Command SDK #150

RichieB2B opened this issue Nov 11, 2023 · 5 comments

Comments

@RichieB2B
Copy link

As announced by Tesla, the Owner API will stop working "starting 2024". TeslaPy will need to move to using the Fleet API (for pre-2021 cars) and Tesla Vehicle Command SDK (for post-2021 cars).

@goldhoorn
Copy link

This is a critial issue, i am getting already the following erro:
requests.exceptions.HTTPError: 403 Client Error: Tesla Vehicle Command Protocol required, please refer to the documentation here: https://developer.tesla.com/docs/fleet-api#2023-10-09-rest-api-vehicle-commands-endpoint-deprecation-warning for url: https://owner-api.teslamotors.com/api/1/vehicles/1492932313807820/command/charge_stop

However the deprication is set for next year TeslaPy stopped working for me :/

@fabianhu
Copy link

fabianhu commented Dec 17, 2023

Hi, this may be seen as a blatant self-advertising, as it is:
I just published my Python implementation of the new 2024 Tesla API here:
tesla-api

So far it works for me including the whole registration process.

  • If someone wants to hop in, you are invited.
  • As the structure is simpler than TeslaPy, a pull request does not work so far.

For producing the signed commands I am currently using the tesla-command command line tool, written in Go by Tesla, which can also be compiled for Raspberry Pi.
A python native implementation can be done, when the documentation from Tesla is published.

In the past I used TeslaPy, which worked great!
If someone feels offended by this post, please let me know, I will delete/edit it asap.
@tdorssers

@texasdan1
Copy link

texasdan1 commented Dec 17, 2023 via email

@JanJaapKo
Copy link

@tdorssers is this something you're (planning to be) working on? If so, any help needed?

I've made a Domoticz plugin around this library (which works really well I must say) so curious to know if and how to update when implementing the new Tesla API.

@RichieB2B
Copy link
Author

RichieB2B commented Jan 20, 2024

I just did the work for TWCManager. In short these were the required steps:

  1. Register an application with Tesla and your cars
  2. Get an OAuth token for each car (yes, there now is an official way to do this)
  3. Set up the proxy supplied by Tesla for your app
  4. Make the API server that TeslaPy uses configurable. This can be a FleetAPI region server or a proxy URL.
  5. Make the client_id of the app configurable in TeslaPy. This is needed for automated token refreshes.
  6. Don't use the car API ID in the command URLs. The proxy only supports the VIN in command URLs.

I'm not sure step 6 is needed for TeslaPy, maybe it already uses the VIN.

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

5 participants