Teslamate: Keep having to re-enter Tesla login details

Created on 8 Oct 2020  Â·  41Comments  Â·  Source: adriankumpf/teslamate

I have been using teslamate for about 4-5 months. I recently updated to the new version 1.20 and now i need to constantly re-enter my login details at teslamate.mydomain.com. Never had to do this before. I will know i need to re enter my credentials when i go to grafana and it shows stale data. Any insight?

Tesla API

All 41 comments

Take a look at the logs: docker-compose logs teslamate

I am experiencing the same issue. I have also been using Teslamate for quite a while and just recently update to 1.20. It was not obvious that credentials were bad but Overview chart showed no new data for 24 hours.
I had to delete my tokens from the database and then was able to reenter my credentials. Here is a portion of teh logs taht seem relevant:
teslamate_1 | 16:34:06.272 [info] Connction was closed (a:1|t:28|d:5). Reconnecting …
teslamate_1 | 16:34:12.274 [warn] Disconnected! Connection Error: :timeout | 2
teslamate_1 | 16:34:22.684 car_id=1 [info] Start / :asleep
teslamate_1 | 16:34:22.696 car_id=1 [info] Disconnecting ...
teslamate_1 | 16:35:33.169 [warn] TeslaApi.Error / timeout
teslamate_1 | 16:35:33.170 car_id=1 [error] Error / :timeout
teslamate_1 | 16:37:03.684 [warn] TeslaApi.Error / timeout
teslamate_1 | 16:37:03.684 car_id=1 [error] Error / :timeout
teslamate_1 | 16:38:03.687 [warn] TeslaApi.Error / timeout
teslamate_1 | 16:38:03.687 car_id=1 [error] Error / :timeout
teslamate_1 | 16:41:35.857 [warn] TeslaApi.Error / timeout
teslamate_1 | 16:41:35.857 car_id=1 [error] Error / :timeout
teslamate_1 | 16:42:35.860 car_id=1 [error] Error / :timeout
teslamate_1 | 16:42:52.351 [info] Refreshing access token ...
teslamate_1 | 16:43:22.362 [error] GenServer TeslaMate.Api terminating
teslamate_1 | ** (MatchError) no match of right hand side value: {:error, %TeslaApi.Error{env: %Mint.TransportError{reason: :timeout}, message: "An unknown error has occurred: :timeout", reason: :unknown}}
teslamate_1 | (teslamate 1.20.0) lib/teslamate/api.ex:126: TeslaMate.Api.handle_info/2
teslamate_1 | (stdlib 3.12.1) gen_server.erl:711: :gen_server.handle_msg/6
teslamate_1 | (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
teslamate_1 | Last message: :refresh_auth
teslamate_1 | 16:43:36.336 [error] Error / unauthorized
teslamate_1 | 16:43:52.374 [warn] Token refresh failed: %TeslaApi.Error{
teslamate_1 | env: %Mint.TransportError{reason: :timeout},
teslamate_1 | message: "An unknown error has occurred: :timeout",
teslamate_1 | reason: :unknown
teslamate_1 | }
teslamate_1 | 16:43:52.374 [info] Scheduling token refresh in 1 h
teslamate_1 | 16:43:53.072 [info] [alarm_handler: {:set, {TeslaMate.Vehicles.Vehicle_1_api_error, :fuse_blown}}]
teslamate_1 | 17:44:21.378 [info] Refreshing access token ...
teslamate_1 | 17:44:22.388 [info] Scheduling token refresh in 5 wk 5 d

It was kidn of inconsistent for me. I had ne proper data collection for about 2 days without notice, had to enter credentials multiple times, then rebooted the server and used the chance to upgrade to 1.20, all is good at the moment. But it was weird.

As of today I’m now getting this, logs below:

teslamate_1 | 17:58:45.093 [info] Sent 200 in 422ms
teslamate_1 | 17:58:45.947 car_id=1 [info] Start / :asleep
teslamate_1 | 18:01:20.969 [info] [alarm_handler: {:clear, TeslaMate.Vehicles.Vehicle_1_api_error}]
teslamate_1 | 18:01:30.822 [error] Error / unauthorized
teslamate_1 | 18:02:20.970 [info] [alarm_handler: {:set, {TeslaMate.Vehicles.Vehicle_1_api_error, :fuse_blown}}]

So an update to previous comment... I think this is 2FA related...

If I switch to the Tesla App straight after logging in with TeslaMate, I get a “session expired” message on the official app.

I started getting errors in statsapp too, after I logged out and back in with 2FA all good again.

After logging in with TeslaMate (without 2FA) I get about 60 seconds or so of use before I start to see the error above.

I am not really sure how to get the logs but everything was fine for 2 weeks and then today I’ve had to login 3 different times so far.

Same things happening here. I have to log in multiple times per day. 2FA is not enabled on my Tesla.com account.

Same. No 2FA here

Also experiencing this issue with another installation for a friend of mine. He is _not_ using 2FA or changed anything.

Does clearing the tokens help? And if so, how is this done? @rd2264

Does clearing the tokens help? And if so, how is this done? @rd2264

Yes, clearing the tokens and then re-login fixed it for me. The issue has not returned since. As for how to clear the tokens, I used the FAQ as a guide: https://docs.teslamate.org/docs/faq/

docker-compose exec database psql -U teslamate -d teslamate
DELETE FROM tokens;

Does clearing the tokens help? And if so, how is this done? @rd2264

Yes, clearing the tokens and then re-login fixed it for me. The issue has not returned since. As for how to clear the tokens, I used the FAQ as a guide: https://docs.teslamate.org/docs/faq/

docker-compose exec database psql -U teslamate -d teslamate
DELETE FROM tokens;

sadly this doesn't change anything for me :(

Same here, i wonder if entering a token manually would fix the problem

ALso - I am using a VULTR server. Are you? @robbeh1

Same here, i wonder if entering a token manually would fix the problem

It doesn’t - I’ve already tried :)

ALso - I am using a VULTR server. Are you?

No, I self host on a pi

ALso - I am using a VULTR server. Are you?

No, I self host on a pi

I guess I will rebuild today. I am unsure what else to do.

I'd be interested to know if this fixes it, let me know? if so I'll do the same :s

I'd be interested to know if this fixes it, let me know? if so I'll do the same :s

I am having issues backing up my data, I’m not savvy enough to do this i dont think.

I have an idea @robbeh1

create a 2nd email and password for tesla.com and share the vehicle with that 2nd user. Use that information for teslamate only. This way that user never opens the Tesla app and would never get logged out. Thoughts?

I have an idea @robbeh1

create a 2nd email and password for tesla.com and share the vehicle with that 2nd user. Use that information for teslamate only. This way that user never opens the Tesla app and would never get logged out. Thoughts?

It makes no odds to me if I open the Tesla app or not - I still get kicked out of TeslaMate after around 60 seconds :(

Ha

I have an idea @robbeh1
create a 2nd email and password for tesla.com and share the vehicle with that 2nd user. Use that information for teslamate only. This way that user never opens the Tesla app and would never get logged out. Thoughts?

It makes no odds to me if I open the Tesla app or not - I still get kicked out of TeslaMate after around 60 seconds :(

Have you used iOS shortcuts with your Tesla at all? Or used the api in any other way except teslamate?

Not since I enabled 2FA - prior to that I used to :)

Same here, i wonder if thats what could be causing us some issues

For me it is only when i open my Tesla app, i am going to attempt to have a 2nd account exclusively for teslamate

This method seemed to work for me i think, will post again tomorrow.

so I've now made a second account without 2FA.... given it access, and sure enough it works just fine... doesn't feel like a great solution tho :(

I can confirm all those problems.

I have not yet enabled 2FA, still I see that happening. It has already butchered the entries for my last 3 charges.
They are recorded, but without any data.

This is a serious issue.

grafik

I can confirm all those problems.

I have not yet enabled 2FA, still I see that happening. It has already butchered the entries for my last 3 charges.
They are recorded, but without any data.

This is a serious issue.

grafik

I would encourage you to use our workaround.

I can confirm all those problems.
I have not yet enabled 2FA, still I see that happening. It has already butchered the entries for my last 3 charges.
They are recorded, but without any data.
This is a serious issue.
grafik

I would encourage you to use our workaround.

it isn't a good workaround - the fact its causing a problem even for people without 2FA enabled implies something more is going on. I suspect its the first steps of blocking non 2FA access.

Yeah I mean. A good workaround is probably something that lets you use your product as seamlessly as before. And this workaround does that. It’s tough to make demands when Adrian is giving us this product for free. You could always learn how to code, build this yourself, and maintain it yourself. Orrrrrr you could create a small workaround that makes this work.

so I've now made a second account without 2FA.... given it access, and sure enough it works just fine... doesn't feel like a great solution tho :(

So this method is good and stable? I don't necessarily mind having a dedicated "user" just for TeslaMate actually. As long as this user has a pretty complex password, it should be fine.

Thoughts?

Agreed

my suspicion is that not 2FA is the problem itself, but that whenever you go into the tesla app every other party signed in will be logged out.

This explains why this workaround might work

Just wanted to clarify that this problem isn't related to _just_ TeslaMate. This concerns all apps or widgets you may use on the phone, regardless if you are using TeslaMate or not.

That said, I had my friend create a total of three users for each app he uses. All is working fine now when using separate credentials for each app.

This points to something Tesla is doing on their side, if you ask me. Just need to figure out what exactly that is.

Ive been using Teslamate for months on the pi but the last update to 1.20 appears to have upset the install. Not sure if its something Tesla have done with regards to the logging in and kicking them out.

I just wanted to share, I dont have 2FA enabled and the same as others Teslamate constantly gets logged out so results in data not being logged.
However I created a new dummy Tesla user in my Tesla account as per others advice here and having just used that for a day it is back to working fine. Updates coming through every 30 minutes when the Tesla is parked.

I'm having what looks like the same issue. Some drives missing. Long periods shown as Offline in States. The logs show many entries like:

teslamate_1 | 09:02:30.664 car_id=1 [info] Fetching vehicle state ...
teslamate_1 | 09:02:30.676 [info] Connection was closed (a:1|t:5|d:1). Reconnecting …
teslamate_1 | 09:03:00.762 [info] Stream.Timeout / 5
teslamate_1 | 09:03:00.769 [info] Connection was closed (a:1|t:6|d:1). Reconnecting …
teslamate_1 | 09:03:00.865 [error] Vehicle Error: Vehicle is offline
teslamate_1 | 09:03:30.866 [info] Stream.Timeout / 6
teslamate_1 | 09:03:30.874 [info] Connection was closed (a:1|t:7|d:1). Reconnecting …

Some users have reported success by creating a second Tesla account and using that. I don't understand exactly what is meant by this. Would I go to tesla.com, create a new Tesla account, then log in with my original account and provide Car Access to this new account? Or is this workaround referring to something else?

Some users have reported success by creating a second Tesla account and using that. I don't understand exactly what is meant by this. Would I go to tesla.com, create a new Tesla account, then log in with my original account and provide Car Access to this new account? Or is this workaround referring to something else?

No, you log into your Tesla Account at tesla.com and press Manage on your car. On the next page under Car Access, you can add additional drivers who can access your vehicle data via the Tesla app, API, etc.

Screenshot_20201114-111435_Opera

Thanks for the detailed info. I moved TeslaMate to a new Tesla account, and that seems to have resolved the issue of missing drives.

Hello. I have same issue since this Monday 30 nov.
I lost all the data of the week. Today it happened again. I don´t know what´s going on.
I don´t have 2FA

My logs

17:16:00.666 [info] control:hello – 0

17:16:37.114 [info] Connection was closed (a:1|t:3|d:1). Reconnecting …

17:16:48.034 [info] Connection was closed (a:1|t:4|d:1). Reconnecting …

17:17:31.151 [info] Connection was closed (a:1|t:5|d:2). Reconnecting …

17:18:01.850 [info] Stream.Timeout / 5

17:18:02.021 [info] Connection was closed (a:1|t:6|d:2). Reconnecting …

17:18:32.738 [info] Stream.Timeout / 6

17:18:32.911 [info] Connection was closed (a:1|t:7|d:2). Reconnecting …

17:19:03.608 [info] Stream.Timeout / 7

17:19:03.781 [info] Connection was closed (a:1|t:8|d:2). Reconnecting …

17:19:34.518 [info] Stream.Timeout / 8

17:19:34.690 [info] Connection was closed (a:1|t:9|d:2). Reconnecting …

17:20:05.391 [info] Stream.Timeout / 9

17:20:05.562 [info] Connection was closed (a:1|t:10|d:2). Reconnecting …

17:20:36.366 [info] Stream.Timeout / 10

17:20:36.539 [info] Connection was closed (a:1|t:11|d:2). Reconnecting …

17:21:07.245 [info] Stream.Timeout / 11

17:21:07.416 [info] Connection was closed (a:1|t:12|d:2). Reconnecting …

17:21:38.159 [info] Stream.Timeout / 12

17:21:38.331 [info] Connection was closed (a:1|t:13|d:2). Reconnecting …

17:22:09.061 [info] Stream.Timeout / 13

17:22:09.234 [info] Connection was closed (a:1|t:14|d:2). Reconnecting …

17:22:40.045 [info] Stream.Timeout / 14

17:22:40.218 [info] Connection was closed (a:1|t:15|d:2). Reconnecting …

17:23:10.917 [info] Stream.Timeout / 15

17:23:11.089 [info] Connection was closed (a:1|t:16|d:2). Reconnecting …

17:23:41.892 [info] Stream.Timeout / 16

17:23:42.067 [info] Connection was closed (a:1|t:17|d:2). Reconnecting …

17:24:12.767 [info] Stream.Timeout / 17

17:24:12.937 [info] Connection was closed (a:1|t:18|d:2). Reconnecting …

17:24:43.653 [info] Stream.Timeout / 18

17:24:43.824 [info] Connection was closed (a:1|t:19|d:2). Reconnecting …

17:25:14.523 [info] Stream.Timeout / 19

17:25:14.696 [info] Connection was closed (a:1|t:20|d:2). Reconnecting …

17:25:45.440 [info] Stream.Timeout / 20

17:25:45.612 [info] Connection was closed (a:1|t:21|d:2). Reconnecting …

17:26:16.310 [info] Stream.Timeout / 21

17:26:16.480 [info] Connection was closed (a:1|t:22|d:2). Reconnecting …

17:26:47.224 [info] Stream.Timeout / 22

17:26:47.399 [info] Connection was closed (a:1|t:23|d:2). Reconnecting …

17:27:18.103 [info] Stream.Timeout / 23

17:27:18.278 [info] Connection was closed (a:1|t:24|d:2). Reconnecting …

17:27:49.013 [info] Stream.Timeout / 24

17:27:49.184 [info] Connection was closed (a:1|t:25|d:2). Reconnecting …

17:28:19.885 [info] Stream.Timeout / 25

17:28:20.058 [info] Connection was closed (a:1|t:26|d:2). Reconnecting …

17:28:50.806 [info] Stream.Timeout / 26

17:28:50.977 [info] Connection was closed (a:1|t:27|d:2). Reconnecting …

17:29:21.677 [info] Stream.Timeout / 27

17:29:21.847 [info] Connection was closed (a:1|t:28|d:2). Reconnecting …

17:29:52.579 [info] Stream.Timeout / 28

17:29:52.750 [info] Connection was closed (a:1|t:29|d:2). Reconnecting …

17:30:23.468 [info] Stream.Timeout / 29

17:30:23.635 [info] Connection was closed (a:1|t:30|d:2). Reconnecting …

17:30:54.337 [info] Stream.Timeout / 30

17:30:54.510 [info] Connection was closed (a:1|t:31|d:2). Reconnecting …

17:31:25.217 [info] Stream.Timeout / 31

17:31:25.389 [info] Connection was closed (a:1|t:32|d:2). Reconnecting …

17:31:56.129 [info] Stream.Timeout / 32

17:31:56.300 [info] Connection was closed (a:1|t:33|d:2). Reconnecting …

17:32:27.004 [info] Stream.Timeout / 33

17:32:27.177 [info] Connection was closed (a:1|t:34|d:2). Reconnecting …

17:32:57.921 [info] Stream.Timeout / 34

17:32:58.093 [info] Connection was closed (a:1|t:35|d:2). Reconnecting …

17:33:28.794 [info] Stream.Timeout / 35

17:33:28.966 [info] Connection was closed (a:1|t:36|d:2). Reconnecting …

17:33:59.704 [info] Stream.Timeout / 36

17:33:59.875 [info] Connection was closed (a:1|t:37|d:2). Reconnecting …

17:34:30.579 [info] Stream.Timeout / 37

17:34:30.752 [info] Connection was closed (a:1|t:38|d:2). Reconnecting …

17:34:54.808 [info] Adding elevation to 44 positions ...

17:35:01.517 [info] Stream.Timeout / 38

17:35:01.689 [info] Connection was closed (a:1|t:39|d:2). Reconnecting …

17:35:32.391 [info] Stream.Timeout / 39

17:35:32.564 [info] Connection was closed (a:1|t:40|d:2). Reconnecting …

17:36:01.713 car_id=1 [info] Start / :asleep

17:36:01.725 car_id=1 [info] Disconnecting ...

22:47:10.500 [error] Error / unauthorized

22:47:55.863 [info] [alarm_handler: {:set, {TeslaMate.Vehicles.Vehicle_1_api_error, :fuse_blown}}]

05:02:32.957 [info] GET /

05:02:32.964 [info] Sent 302 in 6ms

05:02:33.203 [info] GET /sign_in

05:02:33.208 [info] Sent 200 in 5ms

05:07:14.291 [info] GET /sign_in

05:07:14.294 [info] Sent 200 in 3ms

05:07:36.784 [info] Scheduling token refresh in 5 wk 5 d

05:07:37.254 [info] GET /

05:07:38.504 [info] Starting logger for 'FuriusWattio'

05:07:38.515 [info] Sent 200 in 1261ms

05:07:40.259 car_id=1 [info] Start / :online

05:07:40.274 car_id=1 [info] Connecting ...

05:09:56.252 [info] [alarm_handler: {:clear, TeslaMate.Vehicles.Vehicle_1_api_error}]

05:18:14.348 [info] GET /

05:18:14.353 [info] Sent 200 in 4ms

05:18:29.419 [info] GET /settings

05:18:29.428 [info] Sent 200 in 9ms

05:25:20.823 [info] GET /settings

05:25:20.831 [info] Sent 200 in 7ms

05:25:25.868 [info] GET /

05:25:25.873 [info] Sent 200 in 4ms

I also have this issue.
You can clearly see that it's caused by logging in on the Tesla app or the other way around by entering the credentials in TeslaMate while you have the Tesla App open. The second you click sign in, the Tesla App logs out with the message: Session expired.

I thought myself of the same workaround as above mentioned but the issue is that I have leased the car and therefore I don't have the car shown in my Tesla Account. So I can't make a second account and add my car to it.

Can anyone think of another thing I can do cause this is really annoying and makes it almost impossible to use TeslaMate. Which would be a shame as this is such a nice thing to have

EDIT: I don't have e 2FA enabled

Some users have reported success by creating a second Tesla account and using that. I don't understand exactly what is meant by this. Would I go to tesla.com, create a new Tesla account, then log in with my original account and provide Car Access to this new account? Or is this workaround referring to something else?

No, you log into your Tesla Account at tesla.com and press Manage on your car. On the next page under Car Access, you can add additional drivers who can access your vehicle data via the Tesla app, API, etc.

Screenshot_20201114-111435_Opera

Thank you for this. This helped sort out some issues I was experiencing with Teslamate Home Assistant integration.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DrMichael picture DrMichael  Â·  4Comments

netkruzer picture netkruzer  Â·  6Comments

detritu5 picture detritu5  Â·  4Comments

olivercho picture olivercho  Â·  4Comments

bahree picture bahree  Â·  5Comments