TeslaLogger icon indicating copy to clipboard operation
TeslaLogger copied to clipboard

Tesla Fleet API migration

Open bassmaster187 opened this issue 1 year ago • 8 comments

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:

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

Maybe new todos will follow

Screenshots

Gain access to teslalogger image

You can revoke access to apps anytime: image

bassmaster187 avatar Jan 29 '24 08:01 bassmaster187

Which permissions from tesla api is required?

pszabaciuk avatar Feb 09 '24 08:02 pszabaciuk

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 avatar Feb 09 '24 10:02 Shrekmachine

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 avatar Feb 09 '24 12:02 bassmaster187

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

bassmaster187 avatar Feb 09 '24 12:02 bassmaster187

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

pszabaciuk avatar Feb 09 '24 12:02 pszabaciuk

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

Shrekmachine avatar Feb 09 '24 13:02 Shrekmachine

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

https://github.com/bassmaster187/TeslaLogger/commit/8c430a873f48737a4d3515c4e4c714401645d963 and https://github.com/bassmaster187/TeslaLogger/commit/c6b3ce46b2e85bcdb64d87b8cd205f5df554f035

bassmaster187 avatar Feb 09 '24 13:02 bassmaster187

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

Shrekmachine avatar Feb 09 '24 18:02 Shrekmachine