-
Notifications
You must be signed in to change notification settings - Fork 761
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
Endpoint is only available on fleetapi #3629
Comments
Did you previously have an installation? It looks like there might be something lingering with a previous installation or similar volume name. Try destroying all the containers and volumes and restart fresh.
This is alarming, but we shall see what happens @JakobLichterfeld @jsight @brianmay |
It does seem like the Tesla owner API has rejected the request to list the vehicles.
The error would imply that this is due to the API changes, but isn't possible to be sure. It could be something else going wrong at the Tesla server also. For the record, I don't seem to be getting these errors myself. Although maybe this only happens when restarting Teslamate. Do I dare try restarting it... I guess I should try doing a manual request to that API. |
Sorry, never meant to close this. |
This does not look good, I think I am getting the same error, from manual calls. Probably means if I restart teslamate, it will stop working. As the very first thing teslamate does is call this API to get the vehicle id and streaming id values.
On the positive side, I think that the So if you know the vehicle id an and streaming id values, it might be possible to hack something together that bypasses the list vehicles call. Possibly other fields might also be important, e.g. name of car, not sure. |
Here you have the explanation: |
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:
It returns a json list, I only have one vehicle and can then see the numeric ID 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. |
Yes, you are right, that does appear to be giving me good data. Wonder for long long... |
I think the current code passes the token as a query parameter. If I am reading this correctly. Will need to change that to pass the Authorization head instead. (I tried passing it as a query parameter manually, it didn't seem to work). Anyway, this code needs updating: teslamate/lib/tesla_api/vehicle.ex Lines 25 to 34 in bb4f1d5
|
I believe they switched over to the new fleet APIs for new logins. Got this warning email from TeslaFi this morning ->
Tessie did not warn me to switch immediately, so perhaps tokens obtained for the old API will work for a while, but going into Settings > Connectivity I could see "Upgrade to new APIs" or something like that, did it, and followed the same process. You login to your Tesla account, and grant privileges to the application that wants access, just like any oauth2 application. |
Yes, that is my concern. That above change in URL to list the vehicles will work - I was able to get a new token using tesla_auth, and then call the above URL. But I wonder for how long. Not really willing to spend much time on changing APIs right now when when the the API could get pay-walled at any time without notice, and the charges are likely to be setup for big companies like Uber, and completely ignore the open source community, |
TeslaFi have their argument backwards in my opinion. Tesla did not change "to" anything. Tesla disabled an API endpoint on the Owner API they have not been using themselves for probably a long time, which I think is fair game for them to do on an internal API. The community had another look and found the right request that Tesla is using themselves, so we can be back in business. Of course this could be the start of a never-ending chain of changes the community would need to catch up on, now that "partner" Apps can be build on the Fleet API, but maybe wait for a few more that feel "hostile" before giving up? |
My concerns above about not passing the authorisation header may not be correct. I think the authorization header is added for all requests via the middleware library. This is configured here: Line 11 in bb4f1d5
Which in turn adds the header here:
I also think that the If so, this should fix the problem: diff --git a/lib/tesla_api/vehicle.ex b/lib/tesla_api/vehicle.ex
index 1ff0690b..9c25743d 100644
--- a/lib/tesla_api/vehicle.ex
+++ b/lib/tesla_api/vehicle.ex
@@ -29,7 +29,7 @@ defmodule TeslaApi.Vehicle do
_global -> "https://owner-api.teslamotors.com"
end
- TeslaApi.get(endpoint_url <> "/api/1/vehicles", opts: [access_token: auth.token])
+ TeslaApi.get(endpoint_url <> "/api/1/products", opts: [access_token: auth.token])
|> handle_response(transform: &result/1)
end |
I think it clearly shows that Tesla have no respect for the open source community, or they would have produced an official API that we could use long ago. And the Fleet API is not open source friendly, it is not possible for open source software to distribute |
@brianmay do you open a PR? We can then test with out ghcr image. teslamate/lib/tesla_api/vehicle.ex Line 32 in bb4f1d5
|
I can't do any testing right now. Without risking my working TeslaMate setup. Will do a PR (unless somebody else beats me to it), but not right now. Also worth noting: I am guessing that API will return more then just cars. So may need some filtering, we are only interested in cars. I only have cars though, so I can't test this. |
Agree, I will open a PR to have a ghcr image which we can test on test machines |
Ready for testing on test machines, DO NOT use on Production nor stop your Production: https://github.com/teslamate-org/teslamate/pkgs/container/teslamate/169975917?tag=pr-3630 |
FYI: I could make my failing TeslaPy script working again by patching TeslaPy's vehicle_list() to use the PRODUCT_LIST API and adding a negative test for a non-existant vehicle resource_type which gets us the vehicle list data (should really be a test for not a battery or solar, bur oh well)
So teslamate's get vehicle_list could be altered similarly I think. |
Can confirm the test image from the PR #3630 works for me. Ran on an old machine of mine with a clean setup,
|
@martinblq thanks for testing! I bet you have a tesla energy product. This clearly shows how an additional check is required to get vehicles only and my proposal is to use "vehicle_id" (#3630 (comment)) - but my elixir coding is not good enough to just go ahead and propose the exact code change. The code is currently trying to parse This is the fleet api example response, but I'd bet owner API just looks the same:
|
You are right, I have a Tesla Wall connector. :'( |
I have a Wall Connector too and it doesn't work |
Same here |
Same here :( Internal server error . I have a wall connector too. |
I only discovered Teslamate yesterday. I had the "Endpoint is only available on fleetapi" error, but have it running properly now using pr-3630 (one car, no other Tesla products). |
Btw, there is a new test build, see: #3630 (comment) |
Hi. Is this a NEW updated build from today of this pr-3630 , because yesterday I've tryed this in my .yaml config "ghcr.io/teslamate-org/teslamate:pr-3630" and the results were the same error blank page ? |
@sbkbg Make sure you do a "docker pull ghcr.io/teslamate-org/teslamate:pr-3630" first because Docker won't automatically update the imagine if that tag is already downloaded. |
i've done : docker compose down and after that I've done the docker compose up -d (with the new edited line for the location container of teslamate - "pr-3630" so I can be shure that the Teslamate container is pr-3630 :) id pulled automaticaly the container and sayed that the ather parts are here and started . after that on my pi (because the first place is a cloud instance) - i've "pruned -a" :) all the images and all the volumes to be shure that is a clean install :) and started the yaml again but the result was the same blank after loging in :( |
I don't think any of those steps will get Docker to pull the latest image. Killing the container and restarting it have it use the existing pr-3630 image. Only if that doesn't exist will Docker try to look for it upstream. You need to do something like |
Yes |
Will this solve the problem related to have a wall charger and a car? |
That's the plan, yes. |
Yup. I'd seen 408's before on my side, but they were infrequent. This time I was only getting 408's so I'd pessimisticly assumed my call was being blocked somehow. :) After trying the same code today, it's now working again with the https://owner-api.teslamotors.com/api/1/products?orders=true endpoint instead of just /vehicles. The details call still works without modification. |
@JakobLichterfeld Do you think I can update my docker image to avoid an unexpected restart of the current image? |
No need to so so imo |
Hi together! I just updated to the ghcr.io/teslamate-org/teslamate:pr-3630 image. How can I login again? |
https://docs.teslamate.org/docs/faq#how-to-generate-your-own-tokens ? |
Is there any way I can use this fix on Home Assistant Teslamate Add On? https://github.com/matt-FFFFFF/hassio-addon-teslamate |
closed by #3630 |
Is there an existing issue for this?
What happened?
I followed the docker instructions, and everything starts fine, but I'm just seeing a blank page on the home screen. There is no dashboard link in the main menu:
Expected Behavior
No response
Steps To Reproduce
No response
Relevant log output
Screenshots
No response
Additional data
No response
Type of installation
Docker
Version
latest
The text was updated successfully, but these errors were encountered: