onokje / node-red-contrib-tesla

Node red nodes to control Tesla vehicles and devices
MIT License
20 stars 11 forks source link

Error: Tesla API: Get access token failed #12

Closed adima959 closed 2 years ago

adima959 commented 3 years ago

I´m running: Intel Nuc with HA 2021.2.3. Node red: 1.1.3 v node-red-contrib-tesla: 1.0.3

This used to work but recently stopped.

When I try any action I get this error: Error: Tesla API: Get access token failed

Appreciate some help on this.

delboy711 commented 3 years ago

After having used node-red-contrib-tesla for some time very successfully (Thanks), I am having similar problems.

I deleted the tesla-config and when I created a new one the vehicle-list node gives me the response "Unauthorized". I can log into my Tesla account normally, and do not use 2FA

tombenzeen commented 3 years ago

same here...

andrewgarfield commented 3 years ago

I am also having this issue for the last few days.

What's weird is that without changing anything (no changes to my node-red flows, no change to the library, etc) it will randomly start working and then stop working and then start working again.

LudwigWen commented 3 years ago

same here, works fine again after update to 1.0.3 for some weeks. may be caused : Token from external lib teslajs is expired.

tombenzeen commented 3 years ago

have also some issues with the Andorid App "Dashboard for Tesla. The fact that it works sometime and sometime not is probably caused by an Web Application Firewall which blocks to many Requests ?

LudwigWen commented 3 years ago

temp solution until base library "teslajs" will be corrected:

https://github.com/mseminatore/TeslaJS/pull/225/commits/2e89bc3b6399a066e42e5d7c52fa09e8951a74e6

  1. change .../NodeRed/node_modules/teslajs/src/auth.js to new version
  2. sudo service nodered restart
delboy711 commented 3 years ago

Yes that works! Thanks. I had to restart NodeRed. Restarting the flow was not sufficient.

CommanderB commented 3 years ago

@LudwigWen Thank you! That worked. Had been struggling..

adima959 commented 3 years ago

@LudwigWen , thank you! :) Works for me too.

One thing not working is "Remote start" anyone else experiencing that problem?

Desmo996 commented 3 years ago

I still can't get this to work and getting the "Get access token failed" message. I'm using the "id_s" number and I've checked auth.js and the fix above was already in place so not sure where to go from there.

baku104788 commented 3 years ago

I did the above fix and it worked for a while - now i just get "unauthorized" and it no longer works.

frownbreaker commented 3 years ago

I think this is all fixed? Can this be closed?

baku104788 commented 2 years ago

I've done the manual update above and now I'm getting the get access token failed message again as of a few days ago. Anyone else seeing this?

It would appear to be related to this: https://github.com/mseminatore/TeslaJS/pull/220

Does anyone know how to just clear the token and get it to do a fresh pull - it seems like that should still work as only the refresh is broken

GaPhi commented 2 years ago

You can try node node_modules/teslajs/samples/login.js <user> <pass> command line... In my case, it gives the same error message in both cases but the Tesla Android App or Tesla Website logs in successfully with same user/pass and same network ; it is clearly in the HTTPS exchange (teslajs) that a mistake exists IMHO.

node node_modules/teslajs/samples/login.js 'email' 'pass'

Error: Login credentials rejected
    at /usr/src/node-red/node_modules/teslajs/src/auth.js:95:19
    at tryCallOne (/usr/src/node-red/node_modules/promise/lib/core.js:37:12)
    at /usr/src/node-red/node_modules/promise/lib/core.js:123:15
    at flush (/usr/src/node-red/node_modules/asap/raw.js:50:29)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
onokje commented 2 years ago

Closing this, check the 2.0.0 update and this issue: https://github.com/onokje/node-red-contrib-tesla/issues/18 for more info.