Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

TeslaMate [megathread]

This site may earn commission on affiliate links.
You need to run ps rather than ls for a list of docker processes.

You also need to run the docker-compose commands in the same directory as the YML file is stored.

Edit: Might be best to do a sudo -i and then change to the directory with the YML file then run the commands without the sudo.
 
teslamate_1 | 2023-11-20 01:01:55.253 [info] Migrations already up
teslamate_1 | 2023-11-20 01:01:58.706 [info] System Info: Erlang/OTP 26 (emu)
teslamate_1 | 2023-11-20 01:01:58.707 [info] Version: 1.27.4
teslamate_1 | 2023-11-20 01:01:58.711 [warning]
teslamate_1 | ------------------------------------------------------------------------------
teslamate_1 | No ENCRYPTION_KEY was found to encrypt and securely store your API tokens.
teslamate_1 |
teslamate_1 | Therefore, the following randomly generated key will be used instead for this
teslamate_1 | session:
teslamate_1 |
teslamate_1 |
teslamate_1 | [CENSORED]
teslamate_1 |
teslamate_1 |
teslamate_1 | Create an environment variable named "ENCRYPTION_KEY" with the value set to
teslamate_1 | the key above (or choose your own) and pass it to the application from now on.
teslamate_1 |
teslamate_1 | OTHERWISE, A LOGIN WITH YOUR API TOKENS WILL BE REQUIRED AFTER EVERY RESTART!
teslamate_1 | ------------------------------------------------------------------------------
teslamate_1 |
teslamate_1 | 2023-11-20 01:01:59.352 [warning] Could not decrypt API tokens!
 
I ran it and took out the "!" but got the error "no configuration file provided: not found".

Here are 2 commands I ran. The first one I just ran "ls" hoping it would list my docker sessions running but instead it just listed the config file.


me@NAS~$ sudo docker-compose ls
Password:
NAME STATUS CONFIG FILES
docker running(4) docker-compose.yml


This one is where I tried to close the drive.

me@NAS:~$ sudo docker-compose exec teslamate bin/teslamate rpc \
> "TeslaMate.Repo.get(TeslaMate.Log.Drive, 1208) |> TeslaMate.Log.close_drive()"
no configuration file provided: not found

Really sorry to have to ask for tips. I'm sure this stuff is simpler than I think. I just never had to really play with docker. Everything I've ever installed
that runs on it I've been able to follow a guide for. This is a good chance for me to get into the weeds a little and understand more when I'm done.
I got a little further with this, but there's still something not right. It looks like you have to run that docker compose command from the folder that has the yml file in it. So I cd into it and tried again.

root@NAS:/volume1/@docker# pwd
/volume1/@docker

root@RVNAS4:/volume1/@docker# docker-compose exec teslamate bin/teslamate rpc \
> "TeslaMate.Repo.get(TeslaMate.Log.Drive, 1208) |> TeslaMate.Log.close_drive()"
** (FunctionClauseError) no function clause matching in TeslaMate.Log.close_drive/2

The following arguments were given to TeslaMate.Log.close_drive/2:

# 1
nil

# 2
[]

lib/teslamate/log.ex:222: TeslaMate.Log.close_drive/2
nofile:1: (file)
(stdlib 5.1.1) erl_eval.erl:750: :erl_eval.do_apply/7
(elixir 1.15.7) lib/code.ex:543: Code.validated_eval_string/3



So if I'm reading the above right, then it looks like it's attaching to the teslamate container, but not finding the function TeslaMate.Log.close_drive.


I'm curious if this is supposed to run on the grafana container or teslamate container:

root@NAS:/volume1/@docker# docker container ls | grep teslamate
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
af396d60373d teslamate/grafana:latest "/run.sh" 10 days ago Up 7 days 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp docker_grafana_1
6232917d2c03 teslamate/teslamate:latest "tini -- /bin/sh /en…" 10 days ago Up 7 days 0.0.0.0:4000->4000/tcp, :::4000->4000/tcp docker_teslamate_1


Or perhaps there is just something wrong in capitalization or something that makes the function name not be correct?
 
No, you need to do what it says in the instructions:

teslamate_1 | Create an environment variable named "ENCRYPTION_KEY" with the value set to
teslamate_1 | the key above (or choose your own) and pass it to the application from now on.


Edit: and also share your database logs
hmm, copied one from the logs into the variable, and looks like it works now.. :/ still enquiring some more data - but at least state is right
 
so after adding the key:

pi@raspberrypi:~ $ docker-compose logs teslamate
Attaching to pi_teslamate_1
teslamate_1 | 2023-11-23 19:16:07.684 [info] Migrations already up
teslamate_1 | 2023-11-23 19:16:11.303 [info] System Info: Erlang/OTP 26 (emu)
teslamate_1 | 2023-11-23 19:16:11.303 [info] Version: 1.27.4
teslamate_1 | 2023-11-23 19:16:11.900 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (524.527 ms)
teslamate_1 | 2023-11-23 19:16:11.901 [info] Refreshed api tokens
teslamate_1 | 2023-11-23 19:16:11.915 [info] Scheduling token refresh in 6 h
teslamate_1 | 2023-11-23 19:16:11.921 [info] Running TeslaMateWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
teslamate_1 | 2023-11-23 19:16:11.926 [info] Access TeslaMateWeb.Endpoint at http://localhost
teslamate_1 | 2023-11-23 19:16:12.122 [info] Starting logger for 'Ninja'
teslamate_1 | 2023-11-23 19:16:12.153 [info] GET /
teslamate_1 | 2023-11-23 19:16:12.177 [info] MQTT connection has been established
teslamate_1 | 2023-11-23 19:16:12.196 [info] Sent 200 in 43ms
teslamate_1 | 2023-11-23 19:16:12.291 car_id=1 [info] Start / :asleep
teslamate_1 | 2023-11-23 19:16:14.878 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Tue, 28 Mar 2023 20:25:39 GMT.
teslamate_1 | 2023-11-23 19:16:19.396 [info] Tzdata has updated the release from 2021e to 2023c
teslamate_1 | 2023-11-23 21:50:40.217 [info] GET /
teslamate_1 | 2023-11-23 21:50:40.230 [info] Sent 200 in 12ms
teslamate_1 | 2023-11-23 21:53:33.160 [info] GET /settings
teslamate_1 | 2023-11-23 21:53:33.200 [info] Sent 200 in 39ms

if I read this correctly - it works..

however, no vehicle data for charge, level, or temps... maybe I need car to be driven or something?
 
so after adding the key:

pi@raspberrypi:~ $ docker-compose logs teslamate
Attaching to pi_teslamate_1
teslamate_1 | 2023-11-23 19:16:07.684 [info] Migrations already up
teslamate_1 | 2023-11-23 19:16:11.303 [info] System Info: Erlang/OTP 26 (emu)
teslamate_1 | 2023-11-23 19:16:11.303 [info] Version: 1.27.4
teslamate_1 | 2023-11-23 19:16:11.900 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (524.527 ms)
teslamate_1 | 2023-11-23 19:16:11.901 [info] Refreshed api tokens
teslamate_1 | 2023-11-23 19:16:11.915 [info] Scheduling token refresh in 6 h
teslamate_1 | 2023-11-23 19:16:11.921 [info] Running TeslaMateWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
teslamate_1 | 2023-11-23 19:16:11.926 [info] Access TeslaMateWeb.Endpoint at http://localhost
teslamate_1 | 2023-11-23 19:16:12.122 [info] Starting logger for 'Ninja'
teslamate_1 | 2023-11-23 19:16:12.153 [info] GET /
teslamate_1 | 2023-11-23 19:16:12.177 [info] MQTT connection has been established
teslamate_1 | 2023-11-23 19:16:12.196 [info] Sent 200 in 43ms
teslamate_1 | 2023-11-23 19:16:12.291 car_id=1 [info] Start / :asleep
teslamate_1 | 2023-11-23 19:16:14.878 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Tue, 28 Mar 2023 20:25:39 GMT.
teslamate_1 | 2023-11-23 19:16:19.396 [info] Tzdata has updated the release from 2021e to 2023c
teslamate_1 | 2023-11-23 21:50:40.217 [info] GET /
teslamate_1 | 2023-11-23 21:50:40.230 [info] Sent 200 in 12ms
teslamate_1 | 2023-11-23 21:53:33.160 [info] GET /settings
teslamate_1 | 2023-11-23 21:53:33.200 [info] Sent 200 in 39ms

if I read this correctly - it works..

however, no vehicle data for charge, level, or temps... maybe I need car to be driven or something?
When you say no data for drives etc Where are you seeing (or not seeing :) ) that? What dashboard?

And, again, what do you see in your database logs? Anything in Grafana logs?
 
When you say no data for drives etc Where are you seeing (or not seeing :) ) that? What dashboard?

And, again, what do you see in your database logs? Anything in Grafana logs?
it all works now.
I think it did not pull any data because that data was not fed into teslamate - no driving happened after re-setup all things - it has no data for existing state

after today's drive - data appeared
 
  • Like
Reactions: init6
Anyone seen this before: Car seems to go offline but can connect to it via the Tesla app and wake it.
1700827351274.png
 
Offline means the car is not connecting to the Tesla servers. I usually get it when my car is connected to my router but not to the internet - my car is quite far away from my router so the wifi sometimes drops. Try rebooting your router or the car.
 
Offline means the car is not connecting to the Tesla servers. I usually get it when my car is connected to my router but not to the internet - my car is quite far away from my router so the wifi sometimes drops. Try rebooting your router or the car.
Hi, connectivity died while driving yesterday afternoon a few miles from home - I noticed the next track on Spotify was not available and then check connectivity and no LTE. That last few miles was not recorded in the Drive. Got home, rebooted it, and it connected to home wifi and car went to sleep. Set it charge and since then it stays offline (unless I wake it). I'll take it for a drive tomorrow to see if that jogs the connection back to the tesla servers.
 
Hi, connectivity died while driving yesterday afternoon a few miles from home - I noticed the next track on Spotify was not available and then check connectivity and no LTE. That last few miles was not recorded in the Drive. Got home, rebooted it, and it connected to home wifi and car went to sleep. Set it charge and since then it stays offline (unless I wake it). I'll take it for a drive tomorrow to see if that jogs the connection back to the tesla servers.
This sounds similar:
 
Hey all - is the current teslamate fully synced to work with the new Tesla API?
No, it doesn't use the new API at all. And the developer has stated that they have no plans to update it to do so.

There was a change made, but not to the main release branch from what I have seen, to support the results returned from current firmware versions, but it is likely that TeslaMate will stop working altogether sometime early next year. (If what people have said is true, and that Tesla is going to turn off access to the private APIs that are currently being used by TeslaMate.)
 
No, it doesn't use the new API at all. And the developer has stated that they have no plans to update it to do so.

There was a change made, but not to the main release branch from what I have seen, to support the results returned from current firmware versions, but it is likely that TeslaMate will stop working altogether sometime early next year. (If what people have said is true, and that Tesla is going to turn off access to the private APIs that are currently being used by TeslaMate.)
I thought v1.27.4 Releases · teslamate-org/teslamate updates to API? Or maybe still not?