Skip to content
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

Tesla: No response #78

Closed
bluppdiwupp opened this issue May 29, 2021 · 55 comments
Closed

Tesla: No response #78

bluppdiwupp opened this issue May 29, 2021 · 55 comments

Comments

@bluppdiwupp
Copy link

after the update with 5.1:

Could not retrieve token, Error from Tesla: No response

i don't have TFA.

@dbweb-ch
Copy link
Owner

Did you try it a couple of times? Sometimes the tesla server does not respond for a while....

@bluppdiwupp
Copy link
Author

yes, many times. No issue with the homepage or app.

@SamLowrie
Copy link

Same here, no TFA as-well, same "Tesla: no response" error:

  • V 0.5.1
  • Tried to enable debug, but nothing usefull.
  • Tried to manually delete token/password from objects.json => removed binary garbage in gui, re-entered login/password => Still same error.
  • Log: Username or Password invalid. No response

@hombach
Copy link
Contributor

hombach commented May 29, 2021

same here: "Could not retrieve token, Error from Tesla: No response" perhaps we should wait some hours - tesla is changing a lot right now because of upcoming new software for Model S/X refresh....

@and-web
Copy link

and-web commented May 30, 2021

This affects me, also. Downgraded to 0.4.2 to restore a working adapter state.

My observations for troubleshooting:

  • Creating a new instance and entering the credentials from scratch does not solve the problem, same issue.
  • In the adapter settings of the 0.5.1 instance, in the token fields, several strange unicode symbols appear. I'm sure that's new, in previous versions these symbols didn't appear.
  • I logged into my tesla.com account and noticed a captcha. I don't know if this is because of several unsuccesful attempts of the adapter or maybe the captcha is a new barrier for the adapter?

@hombach
Copy link
Contributor

hombach commented May 30, 2021

I also get the captcha - a "good" one, also hard for me....
Inside the account are also changes, my old cars aren't viewable any more, same for tesla shop orders.

@dbweb-ch
Copy link
Owner

@hombach yes this seems to be the issue, see:
mseminatore/TeslaJS#247
and
timdorr/tesla-api#390
and
https://twitter.com/ycorsair/status/1398160096325111808?s=20

as this adapter is based on TesjaJS, there is not much that I can do to resolve this. Either someone finds a way to work around this captcha, but I am sure tesla will find another way to reject us, or Tesla finally generates an official api. You can try to ask tesla support for this feature, if we are enough people tesla might sees that this is needed.

@ChrisPrefect
Copy link

Same for me. Adapter does not work anymore. It worked before. Can we downgrade somehow?

@ChrisPrefect
Copy link

I can't enter a token directly in the adapter settings. Is this blocked somehow? How can the input fields be activated?

@dbweb-ch
Copy link
Owner

dbweb-ch commented Jun 2, 2021

This is blocked, yes, as the adapter is supposed to get the token by itself. You can't downgrade, as said, tesla itself has changed their login process, this has nothing to do with the version of this adapter and will happen with any version.

@hombach
Copy link
Contributor

hombach commented Jun 2, 2021

Tesla removed the captcha - Adapter is working again!!!

@bluppdiwupp
Copy link
Author

doesn't work: Could not retrieve Data from the Car! Response: Error response: 408

@aski71
Copy link

aski71 commented Jun 29, 2021

Same here. :-(
Everything still worked well last week.

@aski71
Copy link

aski71 commented Jun 29, 2021

I’m using 2FA. I was able to retrieve a new token when entering a current OTP and then requesting a new token.
I was able to store it.
Since then I‘m also getting:
Could not retrieve Data from the Car! Response: Error response: 408

@dbweb-ch
Copy link
Owner

Can you try to wake up the car first by using the Tesla App on your phone and then try to get data with the adapter?

@DanielWeeber
Copy link
Contributor

Adapter still showning me "no response" although Tesla deactivated the captcha

@dbweb-ch
Copy link
Owner

dbweb-ch commented Jul 1, 2021

It looks like this is pretty random and has nothing to do with the adapter. I have two installations of the adapter and both work with the newest version. But on one of them I was not able to get a token for a while. To say, I can't test it without 2 factor authentication, but as the adapter is pretty often installed I assume there would might be more users having troubles.
That would mean you have to try to authenticate a couple of times until you get a token.

Btw. I am curently testing Version 0.5.3 which has a couple of improvements with requesting data and the sleep function, will merge it into master in a couple of days.

@DanielWeeber
Copy link
Contributor

It's broken for since a few weeks for me. I tried about 50 times min. :( Will try to use 0.5.3

@dbweb-ch
Copy link
Owner

dbweb-ch commented Jul 1, 2021

strange. I just updated another test instance to 0.5.3 and it worked with the first try.
Do you have 2FA or not?

@DanielWeeber
Copy link
Contributor

No 2FA.

@dbweb-ch
Copy link
Owner

dbweb-ch commented Jul 1, 2021

ok, then this might really does not work anymore. I will check if I can get a hand on a tesla without 2FA, one of my colleges has one.

Or you could just use 2FA, for such an expensive thing like a car I would suggest this anyway ;)

@DanielWeeber
Copy link
Contributor

I just logged in to tesla.com. It notified me that my account is locked due to too many failed authentications (maybe because of the tesla adapter when captcha was activated). Strangely my tesla app was working all the time, hence I did not notice that my account was locked. I just changed the password, I think/hope it will work again. Will try later today.

@dbweb-ch
Copy link
Owner

dbweb-ch commented Jul 1, 2021

As long as the app has a valid token, it can still get data even if the account is locked.

@DanielWeeber
Copy link
Contributor

I just tried, is working fine now. Account locked was the problem.

@aski71
Copy link

aski71 commented Jul 1, 2021

My issue might indeed be that the car is in an underground garage with no access currently. Will know latest tomorrow.
Nevertheless Token Refresh seems to require to type in a new OTP at the time of refresh when 2FA is enabled.

@dbweb-ch
Copy link
Owner

dbweb-ch commented Jul 1, 2021

I am not sure about this, we will see if it needs a new OTP.
But the "refresh"-Token wouldn't make much sense in that case, as it is usually there to prevent from user interaction but still being able to refresh a token.
Also, the Tesla App would require a new OTP every time the token refreshes, I don't think I've ever had to reenter the OTP since I activated 2FA. I will see as soon as my current token needs to be refreshed next time.

@aski71
Copy link

aski71 commented Jul 2, 2021

All I can say:
It is working again, now that I have the new token.
And I was only able to refresh the token manually.
And when I wanted to refresh it, I always received „No response“.
Only when I unchecked 2FA, checked it again, entered a current OTP and did a token refresh then, the refresh operation succeeded.

@aski71
Copy link

aski71 commented Jul 3, 2021

I‘ll keep observing what will happen should troubles reoccur.

@BerniZindel
Copy link

I had the same issue (no 2FA) - the solution for me was to re-enter the password and refresh the token manually (v.0.5.2)

@aski71
Copy link

aski71 commented Jul 15, 2021

Interesting effect today:
Today I had hundreds of log messages:
2021-07-15 10:41:56.529 | warn | Invalid answer from Vehicle request. Error: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Authorization"] -- | -- | --

Needed to obtain a new token using 2FA with a current OTP. Then it worked again.
Even though the old token was not yet expired.

@PanRe
Copy link

PanRe commented Jul 28, 2021

Interesting effect today:
Today I had hundreds of log messages:
2021-07-15 10:41:56.529 | warn | Invalid answer from Vehicle request. Error: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Authorization"] -- | -- | --

Needed to obtain a new token using 2FA with a current OTP. Then it worked again.
Even though the old token was not yet expired.

I had the same issue but without 2FA and without saved credentials... I had to restart the iobroker tesla instance to obtain a new valid token (while the old one should have been still valid). Trying to get a new token before i restarted the instance always ended in the same error message
(26917) Invalid answer from Vehicle request. Error: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Authorization"]
(26917) Could not retrieve Data from the Car! Response: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Authorization"]
While this error was active, there really were "invalid" characters shown in the former received token. Multiple characters were displayed by a [x] like symbol! Before this came up, it worked flawlessly for weeks.

OS: Raspberry Pi OS Lite on a Raspi Zero W, Node.js: v12.22.3, NPM 6.14.13

@aski71
Copy link

aski71 commented Jul 31, 2021

Same behaviour again today:
`

tesla-motors.0 2021-07-31 19:29:21.662 warn Invalid answer from Vehicle request. Error: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Authorization"]

`
This message kept repeating continuously.
The token should have been valid until September.
I had to manually obtain a new token using 2FA with a current OTP. Then it worked again.

Just like 16 days ago.

@dbweb-ch
Copy link
Owner

This might has something to do with mseminatore/TeslaJS#220 , as soon as this is merged with teslajs and release, I will update teslajs.
In meantime, I've enabled the manual input of the token, you should get it from the latest version 0.5.4.

@aski71
Copy link

aski71 commented Aug 16, 2021

Had the invalid character in header error again today.
Updated to 0.5.4.
With 0.5.4 it's now completely broken.
With 0.5.3 I was formerly able to retreive a new token with a new OTP.
With 0.5.4 I can not even do that anymore: No response. :-(
Tried to downgrade to 0.5.3 again but did not work. So I uninstalled completely and reinstalled. Again 0.5.4.
Again: No response. :-(
Tried to manually enter Tokens via Auth for Tesla: Does not work, because the save button is grayed out. :-(
So the adapter became completely unusable for me. :-(((

@nachtschatt3n
Copy link

This might has something to do with mseminatore/TeslaJS#220 , as soon as this is merged with teslajs and release, I will update teslajs.
In meantime, I've enabled the manual input of the token, you should get it from the latest version 0.5.4.

I did that as well but this strange encryption kicks in. Also you need the vehicle so I arranged the code a little to get the vehicle but its not working yet. Maybe I continue tonight at nachtschatt3n@52b5e27

@adultano
Copy link

adultano commented Aug 17, 2021

Hi. I will describe here what steps I have taken to make the Tesla adapter in iobroker working again. First of all it is important to know that I will not take any responsibility whatsoever if it comes to system issues and/or fraudelent activitites. I am a private user with a little bit of coding knowledge. I have nothing to do with neither the coding of the tesla adapter nor teslafi or teslapy. This workaround is based on two steps. 1) you need to obtain the tokens either through teslafi.com or teslapy (python module on github). 2) you need to manipulate the code in iobroker -> tesla adapter to enable the token fields and the save & close button. I run iobroker on a rapberry 4 and another one on win10. To manipulate the code, I used google Chrome. The same approach might be feasible through other browser, but I do not know how these work.
1a) Obtain token through teslafi.com
-This should be self-explaining. There is a 14days trial period. You will submit your login-details, the 2FA code if necessary and you'll be prompted with the captcha. Afterwards you'll receive the access and refresh token which you'll need.
1b) Obtain token through teslapy
-This is a bit more complex. You need python and telsapy from github. You'll also need to change the Init__.py file as discussed on github under issues, issue #29. You will submit again your credentials and receive the captcha through the standard defined browser on your system. Your tokens will then be stored in cache.json in the same folder as you save your python script to obtain the tokens. As said, this is a more complex approach and you might need to play around a bit.

  1. In chrome (or any other browser, go to the tesla instance in iobroker. Enter email address and password. Don't tick 2FA, no matter if you have it or not. Next right click on the token field -> inspect. The debug window will be added on the right. You'll see that the field is marked as readonly="readonly". Double click on read-only and delete this. Same for the refresh token tab. Last, right click on the Save and Close button -> inspect, click the little arrow and change in the second line (btn-save-close) from disable to enable. Now you're all setup and should b able to copy paste the token and the refresh token from 1a or 1b and click the save & close button. Ideally the car is not asleep when you do this, but in theory it should wake it if it still is.

I did not bother adding the expiry time. You'll probably notice that in 3 months it wont work anymore. If the problem with captcha persists by then I suppose we can do the same steps again and update the tokens manually.

I attached a couple of printscreens which might help with the debug part in 2. I also added a printscreen of my python script which stores the tokens in cache.json.
inspect

remove_readoly

updatedTokens

buttonEnabled

updatedSaveButton

pythonScript

Ideally the developers of the adapter give the user the flexibilty in a next release, to either let the adapter obtaining the tokens automatically or that the user can provide this on his own.

I hope above steps work for other users too. Again, I do not take any responsibility especially for the generation of the tokens. You are submitting your login details to a third party which always poses a certain risk which you need to decide for yourself if you are willing to take it. Any feedback will be appreciated.

Lastly a big thanks to the developpers of the Tesla adapter! And should I have violated any rules with my post, please let me know or delete it. I am just trying to help out other users with thisworkaround.

Thanks

@aski71
Copy link

aski71 commented Aug 17, 2021

Thanks for the workaround!
I tried it with a token pair I obtained via Auth For Tesla app. Did not work, unfortunately.
Maybe it is because my car is not reachable right now. Will try again.

@adultano
Copy link

Thanks for the feedback. Ill try auth for tesla too later and let you know

@adultano
Copy link

adultano commented Aug 17, 2021

I think authfortesla might not work - whilst the acces token looks ok (qts-xxxxxx..) the refresh token seems to be of a different type. The one from my approach has 64 digits, the one from the app has a gazillion. Maybe try it with teslafi.com and check again.

@BerniZindel
Copy link

BerniZindel commented Aug 17, 2021

thanks @adultano - followed your steps and used teslapy. Had to insert code as mentioned here in this commit: tdorssers/TeslaPy@ebcef52

edit: installed via pip - there is the fix not implemented yet

@adultano
Copy link

thanks @adultano - followed your steps and used teslapy. Had to insert code as mentioned here in this commit: tdorssers/TeslaPy@ebcef52

edit: installed via pip - there is the fix not implemented yet

Thanks - does this mean your connected to your car again and this workaround worked for you too?

@BerniZindel
Copy link

thanks @adultano - followed your steps and used teslapy. Had to insert code as mentioned here in this commit: tdorssers/TeslaPy@ebcef52
edit: installed via pip - there is the fix not implemented yet

Thanks - does this mean your connected to your car again and this workaround worked for you too?

yes - everything works fine again.

@adultano
Copy link

thanks @adultano - followed your steps and used teslapy. Had to insert code as mentioned here in this commit: tdorssers/TeslaPy@ebcef52

edit: installed via pip - there is the fix not implemented yet

Thanks - does this mean your connected to your car again and this workaround worked for you too?

yes - everything works fine again.

Glad I wasnt making things up then. Appreciathe feedback.

@and-web
Copy link

and-web commented Aug 17, 2021

Hi. I will describe here what steps I have taken to make the Tesla adapter in iobroker working again.

Thanks @adultano, you made my day. Well, you made my month! Thank you so much.

I obtained the token via the iOS app "Auth for Tesla", used Chrome to make the save button clickable (the input fields are already writable since 0.5.4), entered the two tokens, saved - and it worked again, after 12 days of abstinence. Feels good man!

So proud of you @adultano and also a big shout out to @dbweb-ch, this here means a lot to me. Thank you!

@dbweb-ch
Copy link
Owner

dbweb-ch commented Aug 18, 2021

been working a couple of hours on this and released a new version 0.5.5.
I hope this time I've tested it enough...

You are now able to enter the token manually, then retrieve the car info, store that stuff all together and the adapter works. I've also tested the automatic token refresh which was not working anymore due to a double-encryption issue, this was causing the "ERR_INVALID_CHAR" error.
I hope now it works well and you can use the adapter again.
I still don't know why I can't get any token but this might has something to do with an error of the teslajs-API, need to dig deeper into that, but at least with the manual token input you now have a workaround.

And thanks @adultano for your help delivering a workaround in meantime.

@dbweb-ch
Copy link
Owner

Ah and btw.: I've also not been able to get a token with the adapter. I've used the php script which is mentioned on https://www.teslafi.com/ and is posted here:
timdorr/tesla-api#362

I could put that script onto my server but then you would need to trust me as credentials are sent to the server to get the token (serverside script), but this is anyway an issue you will have with most of the services that get you a token (including teslafi).
Btw.: If you don't use 2FA I HIGHLY recommend it, especially when you get tokens from any other source than from your own server / iobroker. Someone could easy steal your credentials and as tesla is telling you where it is located, steal your car. Or just observe you when you leave your house and break in...or whatever a criminal mind would do.

@BerniZindel
Copy link

Ah and btw.: I've also not been able to get a token with the adapter. I've used the php script which is mentioned on https://www.teslafi.com/ and is posted here:
timdorr/tesla-api#362

I could put that script onto my server but then you would need to trust me as credentials are sent to the server to get the token (serverside script), but this is anyway an issue you will have with most of the services that get you a token (including teslafi).
Btw.: If you don't use 2FA I HIGHLY recommend it, especially when you get tokens from any other source than from your own server / iobroker. Someone could easy steal your credentials and as tesla is telling you where it is located, steal your car. Or just observe you when you leave your house and break in...or whatever a criminal mind would do.

Thank you for your incredible work, @dbweb-ch . I'm not sure how they automatically solve the capture but I guess, for me was the possibility to solve it manually the breaking point....

@adultano
Copy link

been working a couple of hours on this and released a new version 0.5.5.
I hope this time I've tested it enough...

You are now able to enter the token manually, then retrieve the car info, store that stuff all together and the adapter works. I've also tested the automatic token refresh which was not working anymore due to a double-encryption issue, this was causing the "ERR_INVALID_CHAR" error.
I hope now it works well and you can use the adapter again.
I still don't know why I can't get any token but this might has something to do with an error of the teslajs-API, need to dig deeper into that, but at least with the manual token input you now have a workaround.

And thanks @adultano for your help delivering a workaround in meantime.

Thank you very much @dbweb-ch ! This works flawlessly so far; the login screen is now exactly how I imagined it should look like with the possibility to provide own tokens. Simply perfect. Works awesome. I really highly appreciate the work you put into this! Hero!

@aski71
Copy link

aski71 commented Aug 31, 2021

Manual input of tokens now works for me as well! Thanks!! Highly appreciated!

@and-web
Copy link

and-web commented Sep 15, 2021

Unfortunately this stopped working once again. :-(

Did they change the token format? The access token now starts with "eu-", where formerly it started with "qts-". Could this be the reason?

Behaviour is:

  • manually entering the tokens obtained via iOS app AuthAppForTesla
  • the adapter successfully recognizes the new expiration date 2021-11-14
  • the log shows "You tried to set a State, but there is currently no valid Token, please configure Adapter first!"
  • no data is being retrieved from the car whatsoever, despite there's a "vehicle Answer:" log entry.
  • adapter stays in status yellow

Could it be that the adapter refuses to accept access tokens starting with "eu-"? Due to the fact that it successfully detects the token's expiration date and also due to the fact that it receives the vehicle parameters, there seems to be at least limited functionality with the refreshed token.

@dbweb-ch
Copy link
Owner

Did you already try the new version which is now in the iobroker comminity:
https://github.com/iobroker-community-adapters/ioBroker.tesla-motors
also released on NPM with version 1.0.1

@BerniZindel
Copy link

Tesla worked again on its API, take a look here. I recently reset my password and wasn't able to generate token again, but now is it working with TeslaPy. My new token also begins with EU-.
I don't know your app @and-web but I also tried one on Android and this app gave me just the token but not the refresh-token and you have to enter both in the io-broker app.
Long story short: the adapter works well with eu-token and it's corresponding refresh token.

@dbweb-ch
Copy link
Owner

As said, in version 1.0.1 it is different. Before I was using teslajs as library and this library did the communication with tesla, now we are doing it completly on our own. The new changes on the api are taken into account on the new version already. The new version will be adopted to new changes tesla makes, this version here will not be updated anymore.
So please switch to the new version, especially when you encounter problems.

@and-web
Copy link

and-web commented Sep 17, 2021

Thanks @dbweb-ch, but 1.0.1 is useless to me. Unimportant objects get updated, but the ones I need remain in the old state. Do I have to rebuild the object tree after migrating from 0.5.5 to 1.0.1? As great as it is now to see which color my car has, the object "tesla-motors.0.chargeState.battery_level" won't be updated anymore. :-/

edit: After activating the "stream" option, several objects appeared. Also, after waking up the car other objects have been updated. Compared to my initial posting, now I have plenty of information. Nevertheless, a documentation would be great. Can I help do document something here? Anyhwere else here I've read a comment from another user that also struggled with the meaning of the objects.

@dbweb-ch
Copy link
Owner

as written on https://github.com/iobroker-community-adapters/ioBroker.tesla-motors all data points are new, so yes, it is better to just delete the old and insert the new ones.
your charge state is now under tesla-motors.0."yourid".charge_state.charging_state and will be updated as required.

You can take the "semi"-official documentation from https://tesla-api.timdorr.com/ to find all information that is needed.
Please also consider to write new questions to the github repo above and not to this one here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests