bassmaster187 / TeslaLogger

TeslaLogger is a self hosted data logger for your Tesla Model S/3/X/Y. Actually it supports RaspberryPi 3B, 3B+, 4B, Docker and Synology NAS.
https://www.teslalogger.de
GNU General Public License v3.0
517 stars 170 forks source link

Getvehicles: Endpoint is only available on fleetapi. #1157

Closed Maddimax closed 9 months ago

Maddimax commented 9 months ago

Append Logfile

23.01.2024 07:57:14 : #1[Car_1:36]: GetVehicles: {"response":null,"error":"Endpoint is only available on fleetapi. Visit https://developer.tesla.com/docs for more info","error_description":""} 23.01.2024 07:57:14 : #1[Car_1:36]: ExitCarThread: wh.GetVehicles() == NULL

Describe the bug Looks like the Tesla api has changed.

To Reproduce Steps to reproduce the behavior: No updates since 22.01.2024 ~15:00 CET

Expected behavior Updates should work

Teslalogger Type Docker / Selfmade

Do you use Tasker or iBeacon No

Maddimax commented 9 months ago

logfile.zip

sweidenbach commented 9 months ago

Same probleme here. Tesla has apparently made some changes to the API. Access to the developer API can be requested here to get an OAuth2.0 client_id and client_secret: https://developer.tesla.com/ Currently, registration fails on my side so I am unable to test if Teslalogger works with these credentials.

fvillart commented 9 months ago

This change was announced some months ago. Tesla has started to close old access

https://developer.tesla.com/docs/fleet-api

KoljaHenckel commented 9 months ago

+1 :(

lotharbach commented 9 months ago

You may want to also check https://github.com/teslamate-org/teslamate/issues/3629#issuecomment-1905482793 for updates, where I posted this originally, but as a curtsy to the entire "unofficial tesla owner api hacker community" I want you to also be aware of the required API change:

I am reasonably sure the Tesla App is looking up the list of vehicles (and maybe other products) like this, as this is the only request I logged that contains both VIN and the ID:

curl -v --header 'Content-Type: application/json' --header "Authorization: Bearer $TOKEN" 'https://owner-api.teslamotors.com/api/1/products?orders=true'

It returns a json list, I only have one vehicle and can then see the numeric ID '.response[0].id' (and vin '.response[0].vin') to craft a vehicle_data request.

The Tesla App itself is still fetching vehicle_data every few seconds, so I think changing the way to fetch the list of vehicles will be sufficient for a while still.

motzky commented 9 months ago

Can't test right now, but I'd expect the products endpoint to return not only cars but also wall connectors, solar, and power wall products. Also, the URL parameter looks to me like it instructs the server to also include ordered products that are not delivered yet.

As a result, it would need a filter before accessing the response.

sweidenbach commented 9 months ago

I think @bassmaster187 already fixed it in master branch with commit 540f143. Thank you! I prepared a PR to reflect this in a new executable: https://github.com/bassmaster187/TeslaLogger/pull/1158 That fixed it for me.

spikesch commented 9 months ago

Same hereVon meinem iPad gesendetAm 23.01.2024 um 08:36 schrieb Sebastian Weidenbach @.***>: Same probleme here. Tesla has apparently made some changes to the API. Access to the developer API can be requested here to get an OAuth2.0 client_id and client_secret: https://developer.tesla.com/ Currently, registration fails on my side so I am unable to test if Teslalogger works with these credentials.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

jgoestl commented 9 months ago

I think @bassmaster187 already fixed it in master branch with commit 540f143. Thank you! I prepared a PR to reflect this in a new executable: #1158 That fixed it for me.

That fixed it for me too

bassmaster187 commented 9 months ago

I can confirm the bugfix seems to work sometimes. But there are now problems with isOnline, at least if you run 5 Teslalogger side by side. I stopped 4 of them and it works now with my Model 3. My wife will get home in 2 hours and I'll do some test drive with my Model S.

bassmaster187 commented 9 months ago

New Version should address this issue

Maddimax commented 9 months ago

You guys are awesome! Thanks for the super fast fix!!