ngardiner / TWCManager

Control power delivered by a Tesla Wall Charger using two wires screwed into its RS-485 terminals.
The Unlicense
130 stars 55 forks source link

Car API not available - can't stop charging #564

Closed GMerg closed 5 months ago

GMerg commented 6 months ago

Hello, Im having some issues for weeks now with trying to stop charging. In log I see the following:

Mar 06 19:05:53 TWCManager python3[471]: 19:05:53 🚗 TeslaAPI 13 Car API cmd https://owner-api.teslamotors.com/api/1/vehicles/REMOVED <Response [401]>
Mar 06 19:05:53 TWCManager python3[471]: 19:05:53 🚗 TeslaAPI 20 ERROR: Can't access vehicle status for XYZ.  Will try again later.
Mar 06 19:05:53 TWCManager python3[471]: 19:05:53 🚗 TeslaAPI 13 updateCarApiLastErrorTime() called due to Tesla API Error. Updating timestamp from 1709747127.306657 to 1709748353.4

When I open the web browser, I see no request to update the "Access/Refresh Token" either. In the latest config.json I read about a change on API since 2024 for cars produced after 2021, but my car is a lot older and this all worked before....shouldn't it then work as well now?

Would be nice if someone can help me getting this start/stop command back working.

GMerg commented 5 months ago

I had this as the final URL: https://auth.tesla.com/void/callback?code=EU_xyz&state=123&issuer=https%3A%2F%2Fauth.tesla.com%2Foauth2%2Fv3 With that old Regular expression, it was not able to get the state variable correctly. So in order to work, you need to remove the issuer variable at the end. @r3pTiLe1860 maybe you received a different URL?

GMerg commented 5 months ago

Two days now and all working perfectly with my additions above. So Maybe a fix on #566 and maybe removing the manual access/refresh data (or add a note that state is needed as well) will fix it for everyone.