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.
I don't see anything about the timezone except a notice that tzdata was updated. I don't know how often logs are rotated but mine haven't since restart on 2-Feb.
Yes, I'm seeing similar:

teslamate-1 | 2024-02-06 23:21:54.900 [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 Thu, 01 Feb 2024 18:40:48 GMT.
teslamate-1 | 2024-02-06 23:21:55.234 [info] Tzdata has updated the release from 2021e to 2024a
 
Ok, try the following to find out what timezone Teslamate thinks it is in:

docker-compose ps

This will give you a list of running containers. In the name column there will be one that has teslamate in the name. Take a note of the whole name

run this command:

docker exec -it XXXXX printenv

(Replace XXXXX with the whole name of your container)

Check what the TZ line says

finally run this:

docker exec -it XXXXX date +%Z
(Replace XXXXX with the whole name of your container)

Then tell us what you see.
 
Ok, try the following to find out what timezone Teslamate thinks it is in:

docker-compose ps

This will give you a list of running containers. In the name column there will be one that has teslamate in the name. Take a note of the whole name

run this command:

docker exec -it XXXXX printenv

(Replace XXXXX with the whole name of your container)

Check what the TZ line says

finally run this:

docker exec -it XXXXX date +%Z
(Replace XXXXX with the whole name of your container)

Then tell us what you see.

None of them spit out any line with TZ. Tried the 4 listed.

teslamate-teslamate-1
teslamate-mosquitto-1
teslamate-grafana-1
teslamate-database-1
 
None of them spit out any line with TZ. Tried the 4 listed.

teslamate-teslamate-1
teslamate-mosquitto-1
teslamate-grafana-1
teslamate-database-1
It's the top one.

So the output from printenv doesn't show TZ=America/Los_Angeles? I presume it does spit out other environment variables?

In that case your timezone change isn't getting to Teslamate. You definitely restarted after saving the change to your yml file?

Do you have more than one yml file?
 
It's the top one.

So the output from printenv doesn't show TZ=America/Los_Angeles? I presume it does spit out other environment variables?

In that case your timezone change isn't getting to Teslamate. You definitely restarted after saving the change to your yml file?

Do you have more than one yml file?
It does not show that line, no. It does spit out other things, yes. I did restart Docker, and even restarted the Mac a few times. I only have one yml file, and here's how it looks:

Note: There are other places in the yml file with the "environment:" subheading. Maybe I'm putting this TZ in the wrong place?

------------

version: '3'

services:
teslamate:
image: teslamate/teslamate:latest
restart: always
environment:
- ENCRYPTION_KEY=XXXXXXXX
- DATABASE_USER=teslamate
- DATABASE_PASS=secret
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
- MQTT_HOST=mosquitto
- TZ=America/Los_Angeles
ports:
- 4000:4000
volumes:
- ./import:/opt/app/import
cap_drop:
- all


-------------
 
None of them spit out any line with TZ.
It should look like this:

Rich (BB code):
# docker-compose ps
        Name                      Command              State              Ports         
------------------------------------------------------------------------------------------
...
teslamate_teslamate_1   tini -- /bin/sh /entrypoin     Up      0.0.0.0:4000->4000/tcp,:::4
                        ...                                    000->4000/tcp

# docker exec -it teslamate_teslamate_1 printenv
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=
TERM=xterm
ENCRYPTION_KEY=
DATABASE_USER=teslamate
DATABASE_PASS=
DATABASE_NAME=teslamate
DATABASE_HOST=database
MQTT_HOST=mosquitto
TZ=America/New_York[/CODE]
 
It should look like this:

Rich (BB code):
# docker-compose ps
        Name                      Command              State              Ports        
------------------------------------------------------------------------------------------
...
teslamate_teslamate_1   tini -- /bin/sh /entrypoin     Up      0.0.0.0:4000->4000/tcp,:::4
                        ...                                    000->4000/tcp

# docker exec -it teslamate_teslamate_1 printenv
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=
TERM=xterm
ENCRYPTION_KEY=
DATABASE_USER=teslamate
DATABASE_PASS=
DATABASE_NAME=teslamate
DATABASE_HOST=database
MQTT_HOST=mosquitto
TZ=America/New_York[/CODE]
Yes. Mine looks like this:

Code:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=
TERM=xterm
DATABASE_HOST=database
MQTT_HOST=mosquitto
ENCRYPTION_KEY=
DATABASE_USER=teslamate
DATABASE_PASS=secret
DATABASE_NAME=teslamate
LANG=C.UTF-8
SRTM_CACHE=/opt/app/.srtm_cache
HOME=/opt/app
 
That's the right place for setting the Timezone for the Teslamate container, which we checked is not showing the correct Timezone.
Can you do a quick search on your computer for other yml files? It may be you have more than one. Docker is really fussy about where the yml file is.
 
Yes. Mine looks like this:

Code:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=
...
I don't see a TZ line. Does your yml look like this including spaces and hyphens (formatting)? Some parsers are fiddly.
If it does perhaps the TZ has some non-printing characters. Try replacing that line.
YAML:
    environment:
      - ENCRYPTION_KEY=
      - DATABASE_USER=teslamate
      - DATABASE_PASS=
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - MQTT_HOST=mosquitto
      - TZ=America/New_York
    ports:
      - 4000:4000
 
That's the right place for setting the Timezone for the Teslamate container, which we checked is not showing the correct Timezone.
Can you do a quick search on your computer for other yml files? It may be you have more than one. Docker is really fussy about where the yml file is.
Just checked. No other yml file. All my trips etc show the correct time zone, - as a reminder.
 
Interesting. That's not the default location for docker files.

Can you have a look in /Users/XXX/.docker

Replace XXX with your mac username Note the . before docker

I just put a yml file in there with a America/Los_Angeles TZ variable and it picked it up.
 
OK something really weird going on then.

Can you share your whole yml file in case there is something else that's causing the issue? Take out the usernames and passwords before posting though.

Another thing you could try is to change the ports for teslamate from 4000 to something else e.g. 4001. Then restart. When you go onto the web page it shouldn't load unless you change the port too. That will prove if this yml file is controlling your instance of teslamate.
 
Last edited:
OK something really weird going on then.

Can you share your whole yml file in case there is something else that's causing the issue? Take out the usernames and passwords before posting though.

Another thing you could try is to change the ports for teslamate from 4000 to something else e.g. 4001. Then restart. When you go onto the web page it shouldn't load unless you change the port too. That will prove if this yml file is controlling your instance of teslamate.
Interesting. I did the latter, and it still loads TeslaMate. So it's not using that yml file. I just can't tell you what it is using.