Open usuryadevara opened 1 month ago
I want to update that i followed the instructions but same issue.
Here is what i did: I was able to access this Tesla HTTP Proxy add-on login with my tesla account, 1) have muti factor authentication setup with google authenticator 2) Setup the Tesla-endpoint Allowed origin https://centtsla.duckdns.org and https://centtsla.duckdns.org/callback and was able to generate the token from URL and configure the token inTesla custom integration plugin from HACS (use fleet API proxy, emailid of what i use for tesla login, refresh token from tesla-endpoint generated. Rest domain and all proxy url and certs left defaults.
Please let me know what else i need to try?
The error message implies you've not given it the correct refresh token as there is an error message saying The refresh_token is invalid
Feom that tesla add on page I was able to authenticate with tesla http proxy login page and copied the token from.
I tried atleast 40 times. It's generating token ok.
I had exact same issue:
2024-10-26 21:14:09.421 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -20023 days, 2:45:51 2024-10-26 21:14:09.421 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected 2024-10-26 21:14:09.422 DEBUG (MainThread) [teslajsonpy.connection] Refreshing access token with refresh_token 2024-10-26 21:14:09.683 DEBUG (MainThread) [teslajsonpy.connection] Unable to refresh sso oauth token 2024-10-26 21:14:09.683 DEBUG (MainThread) [teslajsonpy.connection] Auth returned {'error': 'login_required', 'error_description': 'The refresh_token is invalid', 'referenceID': 'd11f01b5-5335-47ad-b938-a125db2dd980-1739966349570. For more information, visit: https://developer.tesla.com/docs/fleet-api#help-and-support'}
Then I noticed that I'm using my local address to create the token. And tried with the duckdns.org address. Things changed to unexpected direction. Tesla Custom Integration still says: "Failed to set up: Check the logs"
And the log says:
2024-10-26 21:28:49.875 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -20023 days, 2:31:11 2024-10-26 21:28:49.875 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected 2024-10-26 21:28:49.875 DEBUG (MainThread) [teslajsonpy.connection] Refreshing access token with refresh_token 2024-10-26 21:28:50.164 DEBUG (MainThread) [teslajsonpy.connection] Saved new auth info {'access_token': 'xxxxxxxxxxxxxxxx', 'refresh_token': 'xxxxxxxxxxxxxxx', 'expires_in': 1730006929} 2024-10-26 21:28:50.164 DEBUG (MainThread) [teslajsonpy.connection] Successfully refreshed oauth 2024-10-26 21:28:50.165 DEBUG (MainThread) [teslajsonpy.connection] get: https://3f232c9f-tesla-http-proxy/api/1/products {} 2024-10-26 21:28:50.231 DEBUG (MainThread) [teslajsonpy.connection] 412: {"error":"Account xxxxxxxxxxxxxxxxxxxxx must be registered in the current region https://fleet-api.prd.eu.vn.cloud.tesla.com, please see https://developer.tesla.com/docs/fleet-api/endpoints/partner-endpoints#register"} [the above section total 5 times] 2024-10-26 21:29:05.621 ERROR (MainThread) [custom_components.tesla_custom] Unable to communicate with Tesla API: UNKNOWN_ERROR_412
And a bit above that:
2024-10-26 21:28:49.859 DEBUG (MainThread) [custom_components.tesla_custom] Trusting CA: {'subject': ((('countryName', 'TR'),), (('localityName', 'Gebze - Kocaeli'),), (('organizationName', 'Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK'),), (('organizationalUnitName', 'Kamu Sertifikasyon Merkezi - Kamu SM'),), (('commonName', 'TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1'),)), 'issuer': ((('countryName', 'TR'),), (('localityName', 'Gebze - Kocaeli'),), (('organizationName', 'Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK'),), (('organizationalUnitName', 'Kamu Sertifikasyon Merkezi - Kamu SM'),), (('commonName', 'TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1'),)), 'version': 3, 'serialNumber': '01', 'notBefore': 'Nov 25 08:25:55 2013 GMT', 'notAfter': 'Oct 25 08:25:55 2043 GMT'}
...I am located in Finland. Any idea why the car is registered in Turkey? Or rather, how to fix this one? I'm the first owner of the car, 1.5y old MY - or at least that was my belief until today :)
Googling, it seems like others have Turkey there as well, so that might not be the actual cause. Problem persists:
DEBUG (MainThread) [teslajsonpy.connection] 412: {"error":"Account xxxxxxxxxxxxxxxxxxxxx must be registered in the current region https://fleet-api.prd.eu.vn.cloud.tesla.com, please see https://developer.tesla.com/docs/fleet-api/endpoints/partner-endpoints#register"}
Is there an existing issue for this?
I have read about the Fleet API and understand I may need to use it
Version of the Tesla component
3.24.1
Version of the Tesla car software
2024.32.7
Model
Model y 2021 LR
Current Behavior
I followed the instructions https://github.com/alandtse/tesla/wiki/Proxy-setup-with-DuckDNS-and-NGinx multiple times and have same issue
Expected Behavior
I should be able to see and control the tesla.
Debug logs
Anything else?
No response