nfarina / homebridge-tesla

Tesla plugin for homebridge: https://github.com/nfarina/homebridge
154 stars 38 forks source link

Error login in #2

Closed charles-philippe closed 5 years ago

charles-philippe commented 7 years ago

[Model S] Error logging into Tesla: Error: 401: {"response":"undefinedmethod`strip'_for_nil:nilclass"}

any clues why I'm getting this error?

Thanks

nfarina commented 7 years ago

Hmm .. perhaps something to do with your account? I just now tried using Siri to check lock/unlock state and it logged in for me without issue.

That error is particular bizarre - speaks to a server problem on their end.

oddsolberg81 commented 6 years ago

I have the same problem, on a "Rasberry Pi Nano Wireless" install. Everything works like a charm on my other x86 linux box. But on my Pi nano, i get: [Model S] Error logging into Tesla: Error: 401: {"response":"undefinedmethod`strip'_for_nil:nilclass"} -- Where do i go from here? Teslacmd works like it should, im able to get information from my car, also from my RasPi Nano...

PeterBizz commented 6 years ago

howdi, did you manage to find a solution? I am facing the same problem It happens when I try to retreive access token, using postman as testtool. this is my request:

POST /oauth/token HTTP/1.1 Host: owner-api.teslamotors.com Content-Type: application/x-www-form-urlencoded Cache-Control: no-cache

grant_type=password&client_id=81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384&client_secret=4034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3&username=emailofowner%40ownerdomain.xx&password=droopie

oddsolberg81 commented 6 years ago

Yes, i configured the npm package homebridge-tesla to use username and password instead of token, i think that was the workaround that made the problem go away.

PeterBizz commented 6 years ago

thx, I have found the solution that gives me a working token:

all example documentation of Get-Token uses username= , instead the request for the token should use email= Tools like Postman use username as well when Request Token is issued ( which fails).

the full request is: POST /oauth/token HTTP/1.1 Host: owner-api.teslamotors.com Content-Type: application/x-www-form-urlencoded Cache-Control: no-cache

grant_type=password&client_id=81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384&client_secret=4034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3&email=emailofowner%40ownerdomain.xx&password=droopie

cbrandlehner commented 5 years ago

I think this issue can be closed as of current version fixing it.

nfarina commented 5 years ago

Thanks!