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

Tesla Fleet API migration #1167

Open
16 of 19 tasks
bassmaster187 opened this issue Jan 29, 2024 · 8 comments
Open
16 of 19 tasks

Tesla Fleet API migration #1167

bassmaster187 opened this issue Jan 29, 2024 · 8 comments

Comments

@bassmaster187
Copy link
Owner

bassmaster187 commented Jan 29, 2024

Tesla Fleet API migration

Tesla has officially shut down the "owner-api" Teslalogger used to get data from. It is still possible to get data from the old owner-api with some dirty tricks, but some cars are now returning an error if you want to send commands to the car (e.g turn on sentry mode).

{"response":null,"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","error_description":""}

Here are the docs:
https://developer.tesla.com/docs/fleet-api#fleet-telemetry

Latest beta is in branch "TeslaFleetAPI"
https://github.com/bassmaster187/TeslaLogger/tree/TeslaFleetAPI

Todos:

  • Register Teslalogger as an app
  • Get Access Token & Refresh Token
  • Refresh Access Token from Refresh Token after it gets invalid
  • Support Europe endpoints
  • Trips logging
  • Charging logging
  • Nearby Superchargers
  • Streaming API - it works, but I'm pretty sure it will be shut down in favor for fleet-telemetry
  • Setup proxy server for end-to-end command authentication
    https://github.com/teslamotors/vehicle-command
  • Use proxy server to send commands to vehicle (e.g turn on sentry mode)
  • Detect if vehicle needs to use the proxy (Pre 2021 Model S / X are not supported)
  • Detect the required region endpoint for the car and use it (Europe, North America, China)
    https://developer.tesla.com/docs/fleet-api#region
  • Wait for CSR (Certificate signing request)
  • Setup fleet-telemetry server with signed certificate
  • Detect if vehicle needs the fleet-api to communicate and migrate user to the new fleet api
  • Teslalogger communicate with fleet-telemetry
  • New features with fleet-telemetry. e.g percentage of driven by Autopilot Add AutopilotState to vehicle_data teslamotors/fleet-telemetry#96
  • Check if user remove access to Teslalogger an stop logging
  • Partner token generation for China region fails teslamotors/vehicle-command#100

Maybe new todos will follow

Screenshots

Gain access to teslalogger
image

You can revoke access to apps anytime:
image

@pszabaciuk
Copy link

Which permissions from tesla api is required?

@Shrekmachine
Copy link

after successful switch to FleetAPI Teslalogger shows no more actual data for both my cars.
Logfile error:
09.02.2024 11:21:32 : #1[Car_1:21]: GetVehicles Error: Object reference not set to an instance of an object

@bassmaster187
Copy link
Owner Author

Which permissions from tesla api is required?

Does this answer your question?
https://github.com/bassmaster187/TeslaLogger/blob/master/docs/en/tesla-fleet-permission.md

@bassmaster187
Copy link
Owner Author

bassmaster187 commented Feb 9, 2024

after successful switch to FleetAPI Teslalogger shows no more actual data for both my cars. Logfile error: 09.02.2024 11:21:32 : #1[Car_1:21]: GetVehicles Error: Object reference not set to an instance of an object

@Shrekmachine could you please send my your logfile

@pszabaciuk
Copy link

Which permissions from tesla api is required?

Does this answer your question? https://github.com/bassmaster187/TeslaLogger/blob/master/docs/en/tesla-fleet-permission.md

Yes, please, pin it up to main readme :D

@Shrekmachine
Copy link

after successful switch to FleetAPI Teslalogger shows no more actual data for both my cars. Logfile error: 09.02.2024 11:21:32 : #1[Car_1:21]: GetVehicles Error: Object reference not set to an instance of an object

@Shrekmachine could you please send my your logfile

on the way

@bassmaster187
Copy link
Owner Author

Which permissions from tesla api is required?

Does this answer your question? https://github.com/bassmaster187/TeslaLogger/blob/master/docs/en/tesla-fleet-permission.md

Yes, please, pin it up to main readme :D

8c430a8
and
c6b3ce4

@Shrekmachine
Copy link

after successful switch to FleetAPI Teslalogger shows no more actual data for both my cars. Logfile error: 09.02.2024 11:21:32 : #1[Car_1:21]: GetVehicles Error: Object reference not set to an instance of an object

After a couple of hours it started to work, without further action from my side

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

No branches or pull requests

3 participants