Comments (25)
I think it might help if the time displayed the timezone offset, that would help verify that the timezone is correct.
from teslamate.
I kind of think we need to be able display configuration errors - such as invalid TZ - somewhere on the website. Which in turn means the website shouldn't crash if it is invalid, but maybe resort to some sort of fallback behaviour.
The idea of looking at the logs - is a sensible one - but I think our users who are not programmers can struggle with this. So maybe we need to try to simplify the errors as much as possible and make them accessible by putting them on the website, where everyone can see them without needing to learn about logs.
It doesn't help when the invalid TZ only error only happens when the car is charging either. Perhaps we should be trying to load the timezone at startup.
from teslamate.
Note the referenced instructions set TZ=${TM_TZ}
in the docker-compose file.
So doing in this way makes sense. TeslaMate is reading the TZ
value, which is set from the TM_TZ
value.
But there is nothing in TeslaMate - that I am aware of - that reads the TM_TZ
environment variable directly.
The docker-compose file quoted above does not have the TZ=${TM_TZ}
line.
from teslamate.
Just to add another data point, my .yml file has the following:
TZ=America/Chicago
Nothing about TM_TZ in the file at all. I'm not having a problem; time is being displayed correctly in both the Teslamate page and Grafana pages.
I don't know if this information helps or hurts... I'm running the container locally in a Photon VM on an ESX host.
from teslamate.
That does make sense. If TZ
is wrong, then TeslaMate will see it and this will create the error. If TM_TZ
is wrong, it doesn't matter, TeslaMate won't look at that and continue working using whatever the system default timezone is.
from teslamate.
database:
image: postgres:13
restart: always
environment:
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD=redacted
- POSTGRES_DB=teslamate
volumes:
- teslamate-db:/var/lib/postgresql/data
Even if it is not related to the issue here, you need to update your postgres database container, please do a backup and follow https://docs.teslamate.org/docs/maintenance/upgrading_postgres
from teslamate.
- TZ="America/Indiana/Indianapolis"
The issue are the "
. Please remove the unneeded TM_TZ and replace with - TZ=America/Indiana/Indianapolis
in your case
from teslamate.
The issue was fixed when I replaced to TZ by TM_TZ. As mentioned by @cwanja Now the web page is coming up while charging (no more 500 server error), but the time is 5.5 hours off. Although my TZ is set to America/Toronto? Grafana info is spot on about drive time and charge time, it is not just not showing up right on the Teslamate homepage.(+5,5 hours), As an example, at an expected local 8h15 finish time, it was showing 13h45. Iām not worried much, just want to report here.
from teslamate.
Just pulled a pulled some "updated" version of 1.2.8.3 (Teslamate and Database have been downloaded) and now the time to finish is accordingly to my TZ ! All is good now!
from teslamate.
@TSJasonH please share your docker-compose file (without your secrets). The name of the environment variable is TZ
without any TM_
from teslamate.
sure...
version: "3"
services:
teslamate:
image: teslamate/teslamate:latest
restart: always
environment:
- ENCRYPTION_KEY=*redacted*
- DATABASE_USER=teslamate
- DATABASE_PASS=*redacted*
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
- MQTT_HOST=mosquitto
- TZ="America/Indiana/Indianapolis"
- TM_TZ="America/Indiana/Indianapolis"
ports:
- 4000:4000
volumes:
- ./import:/opt/app/import
cap_drop:
- all
database:
image: postgres:13
restart: always
environment:
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD=*redacted*
- POSTGRES_DB=teslamate
volumes:
- teslamate-db:/var/lib/postgresql/data
grafana:
image: teslamate/grafana:latest
restart: always
environment:
- DATABASE_USER=teslamate
- DATABASE_PASS=*redacted*
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
ports:
- 3000:3000
volumes:
- teslamate-grafana-data:/var/lib/grafana
mosquitto:
image: eclipse-mosquitto:2
restart: always
command: mosquitto -c /mosquitto-no-auth.conf
# ports:
# - 1883:1883
volumes:
- mosquitto-conf:/mosquitto/config
- mosquitto-data:/mosquitto/data
volumes:
teslamate-db:
teslamate-grafana-data:
mosquitto-conf:
mosquitto-data:
from teslamate.
Random thought: I would like to be able to see the current timezone that is in use when the car is not charging. Maybe something to print the last refresh date/time in the live view or something like that would be a good idea. This probably would help debug this issue as well.
from teslamate.
Been using TM_TZ in the .env file since 2019. Both TeslaMate and Grafana reported the correct time since.
Here the instruction for the .env file does mention TM_TZ:
https://docs.teslamate.org/docs/guides/traefik
All i did was change the zone and kept the same variable to fix the issue.
from teslamate.
For what it is worth, a user on TMC changed the variable from TZ
to TM_TZ
and their internal server error on TeslaMate webpage during charging went away.
https://teslamotorsclub.com/tmc/threads/teslamate-megathread.191537/page-164#post-8088719
from teslamate.
Looks good. Quotes...who knew :-/
Also thanks for the db upgrade tip. Completed the upgrade to pg 15 smoothly with the provided instructions.
from teslamate.
Looks good. Quotes...who knew :-/
So issue is resolved with only TZ=...
correct?
from teslamate.
was getting internal server errors, tried TM_TZ and it still didnt fix it.
Rolled back to teslamate/teslamate:1.28.2 and its working fine again with just the TZ env
from teslamate.
was getting internal server errors,
If you ask for help, please share your docker-compose (without credentials)
from teslamate.
Total agree. Not only valid for TZ
from teslamate.
was getting internal server errors,
If you ask for help, please share your docker-compose (without credentials)
This is the docker-compose i used a couple years ago initially, but have been using watchtower to update the stack
version: "3"
services:
teslamate:
image: teslamate/teslamate:latest
restart: always
environment:
- PUID=1000
- PGID=100
- TZ=America/Los_angeles
- ENCRYPTION_KEY=ABCDefg
- DATABASE_USER=teslamate
- DATABASE_PASS=secret
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
- MQTT_HOST=192.168.29.234
- MQTT_PORT=1883
ports:
- 4000:4000
volumes:
- /volume2/docker/teslamate/import:/opt/app/import
cap_drop:
- all
database:
image: postgres:14
restart: always
environment:
- PUID=1028
- PGID=100
- TZ=America/Los_angeles
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=teslamate
volumes:
- teslamate-db:/volume2/docker/teslamate/postgresql
grafana:
image: teslamate/grafana:latest
restart: always
environment:
- PUID=1028
- PGID=100
- TZ=America/Los_angeles
- DATABASE_USER=teslamate
- DATABASE_PASS=secret
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
ports:
- 3000:3000
volumes:
- teslamate-grafana-data:/volume2/docker/grafana
volumes:
teslamate-db:
teslamate-grafana-data:
from teslamate.
TZ=America/Los_angeles
This needs to be America/Los_Angeles
in your case (So Angeles)
TZ Environment Variable is only needed in teslamate section, not in database nor in grafana
database:
image: postgres:14
restart: always
environment:
- PUID=1028
- PGID=100
- TZ=America/Los_angeles
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=teslamate
volumes:
- teslamate-db:/volume2/docker/teslamate/postgresql
Even if it is not related to the issue here, you need to update your postgres database container, please do a backup and follow https://docs.teslamate.org/docs/maintenance/upgrading_postgres
from teslamate.
This needs to be
America/Los_Angeles
in your case (So Angeles)
Thanks, I did spot that and had updated my container, but it did still get the internal server error. I'll try updating again and trying again -also will try updating postgres
from teslamate.
I installed teslamate for the first time last week and followed the docker installation guide and using the example docker-compose.yml. I was having issues with the timestamps for my drives being hours off so I added the TZ variable into the compose and updated. Now my drives are the correct time. The TZ setting should be added to the installation docs.
from teslamate.
I was having issues with the timestamps for my drives being hours off so I added the TZ variable into the compose and updated. Now my drives are the correct time. The TZ setting should be added to the installation docs.
Where were your timestaps off? Grafana use your local browser settings for displaying.
from teslamate.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
from teslamate.
Related Issues (20)
- URL_PATH not working on breadcrumbs HOME link HOT 12
- A lot of empty space on the drive graph HOT 3
- Please add Baidu Map HOT 2
- Battery Health Dashboard Wrong Capacity - LFP HOT 1
- Timeline report returns error 502 (solution in log output section) HOT 4
- Error: Tokens are invalid HOT 10
- v1.29.0 Tesla Fleet API via MyTeslaMate stopped working - unsure if local TeslaMate or MyTeslaMate proxy issue HOT 14
- 2024.14.8 - Shows "offline" instead of "asleep" HOT 4
- Recently sold tesla, all data from teslamate is gone HOT 1
- grafana maps under drives and charges dashboards are not visible HOT 3
- Connection timeout when fetching vehicles HOT 14
- Installation Issue
- Tesla API: Retry in 60497 seconds HOT 43
- Tesla restricting api request frequency, leading to multiple malfunctions in Teslamate HOT 1
- Unable to restore a teslamate database backup using docker compose (v2) HOT 8
- Grafana no longer accessible HOT 11
- Gafana errors after importing teslamate postgres database HOT 14
- Usable (new) & Usable (now) for LFP are wrong -Battery Health dashboard v1.29.2 HOT 1
- v1.29.2: Bad Certificate when using http proxy (self signed cert) HOT 5
- 1.29.2 Grafana Failed to fetch message for every dashboard HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teslamate.