-
Notifications
You must be signed in to change notification settings - Fork 55
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
1.3 // Can not save Tesla token or car's location -error #533
Comments
Hey @ngardiner and @MikeBishop - can you please have a quick look into this? I would really appreciate your help, as also my 1.2.6 installation out of the sudden stoped working and I'm now completely without TWCManager :( (I tried the manual and Docker installation and I get this same error in both cases!) BIG thanks in advance! |
Without digging further into the code, it looks like the |
Thank you very much @MikeBishop ! I’ll try that out on the weekend 🤞 |
@MikeBishop deleting old settings.json doesn't work. Having the same issue here from within docker:
Thinking this might me related to Tesla API changes. Isn't it? |
I strongly suspect so. I will get a release out within 24 hours to address it, appreciate the importance |
Thanks all! I just tried (out of curiosity, before renaming the settings json) to add the access token and the refresh token manually and it seems to work! No blank page, no errors so far… |
@danielsan1 yeah that seems to be a workaround. 👌🏼 |
@ngardiner will you make the new release available via docker too? |
@ngardiner is there any attempt to make v1.3.1 as docker image available too? I really would appreciate it. |
Okay, got it upgraded via
|
Hey @ngardiner any news on the Tesla API issue? I updated to 1.3.1 (web interface update still do not work for me) but I still hat to use the workaround and put the two keys manually in via the settings page... (and unfortunately the system asks me every few days again about the keys... that was not the case as "copy the auth.tesla.com..... URL in" still worked) Thanks for your help! |
I think this is due to the location API issue. Just to flag that I believe we may be as close as two weeks away (going on Tesla's start of 2024 timeline) from Tesla changing the APIs all over again. The current API that we use (the command API) is about to be replaced by the Tesla Fleet API: https://developer.tesla.com/docs/fleet-api#membership-tiers I am not entirely sure how this is going to go. I would not call it entirely favourable but we will need to find a way forward as we have with all the previous non developer friendly Tesla API changes. In particular, we will now be subject to these: On the bright side I guess, we're a lot less subject to these than solutions which limit the charge rate via API, so we'll probably be fine, given we only use the API for starting and stopping charging. I'm just a little jaded about Tesla API changes by this point so... |
Anyway the point of the above is to brace for a few more changes, but hopefully given this is an actual official documented API, these might... might be the last changes for a while, and if so I think we'd all be grateful for that. |
Thank you very much for the detailed explaination! So let's keep or fingers crossed! :) |
Yeah, it's a little unclear exactly how the new API is going to work, still. There's basically no affordance for open source / self-hosted projects like this; it assumes that each app that's going to use it has publicly accessible web servers. What's likely to happen, I'd think, is that each person will have to register for a developer API key and then have themselves as their single customer. Setting that up may be onerous for most people, unfortunately. Tesla requires a domain with Web hosting and a "business entity" in order to register a developer account. The first is easy enough for anyone tech-savvy enough to run TWCManager, but the second will be a barrier (and is almost certainly intended to be). I'd hope to see a way for individuals to get access to their own vehicles using a simpler flow, and leave the complex dance for apps that need access to vehicles across many accounts. We'll see if that happens; I'm bracing for all my Tesla-related apps to simultaneously break in January. |
Might be worth reworking the location tracking part, as if I understood correctly (and I'm really not sure about that) this queries the API once per minute. As stated in the 2023.38+ update, using Fleet Telemetry might be worth a try. Didn't look into this yet though. Curious how the membership tiers will look like. Having a shared partner level account may be troublesome, as a single deployment could mess up API access for everyone sharing the account. Let's hope there's an "owner" tier which allows easy access for car owners. From the experience with Tesla so far I'm not quite confident about this. Calling the thing "FleetAPI" doesn't improve my expectations, but then OTOH it also includes "energy devices" so they can't be really serious about the naming in general. :) |
Location won't call any more often than once per minute, but doesn't actually call that often most of the time. Typically hourly, or when a car is plugged/unplugged to check if it just arrived/left. And of course, if you're connected to Teslamate, it's just listening to the location from there and never fetches the location directly. |
This workaround doesn‘t work for me since a few days. :( |
Same here :-/ Seems like another change on Teslas side… How will it affect TWCManager? Solar charging will still work but it won’t stop automatically but continue until full with 6A, even the solar output is lower than 6A? |
They've said that...
That suggests that while we may need to switch to the new API, there will be a path forward. Of course, if they don't come up with their solution for self-hosting before they sunset the old API, we'll be out of luck at least temporarily. |
Hi @MikeBishop, @ngardiner First investigation: My takeaways: More investigations: Any Ideas what's wrong? When I enter the token, the "settings.json" file provides a "carApiTokenExpireTime" that is exactly 8 hours in the future. Thanks a lot |
Hey @MikeBishop @ngardiner @tjikkun (thanks for bringing back Kostal plugin with your solution! :)
I thought, maybe I messed up the docker installation as I'm not used to docker. So I tried the the manual installation but the error stays the same :( Can you help me with that?
When I try to save the Tesla token as asked for after installation:
Exception occurred during processing of request from ('192.168.188.23', 52903)
Traceback (most recent call last):
File "/usr/lib/python3.9/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.9/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/home/pi/TWCManager/lib/TWCManager/Control/HTTPControl.py", line 158, in init
BaseHTTPRequestHandler.init(self, *args, **kwargs)
File "/usr/lib/python3.9/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.9/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.9/http/server.py", line 415, in handle_one_request
method()
File "/home/pi/TWCManager/lib/TWCManager/Control/HTTPControl.py", line 985, in do_POST
res = master.getModuleByName("TeslaAPI").saveApiToken(url)
File "/home/pi/TWCManager/lib/TWCManager/Vehicle/TeslaAPI.py", line 1058, in saveApiToken
params = json.loads(req.text)
File "/usr/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
And the same when I try to reset my home location:
Exception occurred during processing of request from ('192.168.188.23', 52862)
Traceback (most recent call last):
File "/usr/lib/python3.9/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.9/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/home/pi/TWCManager/lib/TWCManager/Control/HTTPControl.py", line 158, in init
BaseHTTPRequestHandler.init(self, *args, **kwargs)
File "/usr/lib/python3.9/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.9/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.9/http/server.py", line 415, in handle_one_request
method()
File "/home/pi/TWCManager/lib/TWCManager/Control/HTTPControl.py", line 941, in do_POST
self.process_home_location()
File "/home/pi/TWCManager/lib/TWCManager/Control/HTTPControl.py", line 1141, in process_home_location
del master.settings["homeLat"]
KeyError: 'homeLat'
What can I do? Everything else runs smoothly...
Thank you all in advance!
I really hope to get 1.3 running at some point :)
The text was updated successfully, but these errors were encountered: