-
Notifications
You must be signed in to change notification settings - Fork 61
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
Can't login with just email and password #389
Comments
That email/pass path is unfortunately not maintained anymore after Tesla started requiring the refresh token. This library is primarily used for home assistant, so all support right now is for the implementation here: https://github.com/alandtse/tesla/blob/dev/custom_components/tesla_custom/config_flow.py#L178-L188 I believe we were seeing Tesla require javascript to generate tokens so it became a losing game for us to do it in python (although I think some other implementations eventually figured out a way). If you look at the HA component, you'll see we just require the refresh token and user name now. The README will point to various apps that can generate it. I wouldn't be against PRs to try to bring that functionality back in for non Home assistant use. |
@alandtse hey thanks, I did try to implement this myself a few weeks back but wasn't able to get the access or refresh token because I was seeing that the Tesla login page has a captcha unless the exact right user-agent (among other headers) are set and I don't know what they are. That said, i'm also using this for HA, but as a decoupled async rest service since i'm not running HA in supervisor mode so can't add integrations (i'm running on a raspberry pi zero so i don't know that i have enough compute/memory to handle all the docker containers, It starts to boot loop after about 3, been meaning to upgrade but haven't yet). That said, maybe i'll try again. If i get anything working i'll be happy to submit a PR. But in the meantime i've just supplied the refresh token. I worry that it will expire every X days and break my home automation but that's something i'll deal with when it happens. Do you know how long refresh tokens are good for? |
I believe it's 45 days. That said custom integrations don't need to run in a separate docker. They run in the same as core but are loaded from the config/custom_components directory. You're thinking about add-ons. I'd suggest you use hacs and install the custom component so you don't need to basically rewrite the component from scratch. |
cool thanks:) I did also try to reverse engineer the browser's web calls to implement the change, hit the same error i did before with captcha's and 403 errors. I haven't found any implementation in open source that uses just username and password. Everything I can find uses the refresh token. Are you aware of any functioning implementations? |
Not in python. There may be some in nodejs. Most people report issues with the API at timdorr's github. You may find something in his discussions or issues. timdorr/tesla-api#431 |
I'm trying to run the following script using teslajsonpy 3.7.0
I get the following error:
Am i missing something obvious? Or does this api not support logging in without an access token/refresh token?
The text was updated successfully, but these errors were encountered: