teslamate icon indicating copy to clipboard operation
teslamate copied to clipboard

Statistics and Trip display are inconsistent

Open Fred3343 opened this issue 10 months ago • 14 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What happened?

In the statistics display, the Distance displayed on April 9, 2024 is 2km, but when I clicked on the date to enter the interface of that day, my actual Distance was 77.9 km. I had this problem recently image image

Expected Behavior

I think they're a match. I was fine

Steps To Reproduce

No response

Relevant log output

teslamate_1  | waiting for postgres at database:5432
teslamate_1  | 2024-04-10 09:40:29.886 [info] Migrations already up
teslamate_1  | 2024-04-10 09:40:34.112 [info] System Info: Erlang/OTP 26 (jit)
teslamate_1  | 2024-04-10 09:40:34.112 [info] Version: 1.28.3
teslamate_1  | 2024-04-10 09:40:34.685 [info] POST https://auth.tesla.cn/oauth2/v3/token -> 200 (492.022 ms)
teslamate_1  | 2024-04-10 09:40:34.685 [info] Refreshed api tokens
teslamate_1  | 2024-04-10 09:40:34.690 [info] Scheduling token refresh in 6?h
teslamate_1  | 2024-04-10 09:40:34.696 [info] Running TeslaMateWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
teslamate_1  | 2024-04-10 09:40:34.699 [info] Access TeslaMateWeb.Endpoint at http://localhost
teslamate_1  | 2024-04-10 09:40:34.978 [info] GET /settings
teslamate_1  | 2024-04-10 09:40:35.007 [info] Sent 200 in 27ms
teslamate_1  | 2024-04-10 09:40:35.098 [info] Starting logger for '换新版 Model 3'
teslamate_1  | 2024-04-10 09:40:35.117 [info] MQTT connection has been established
teslamate_1  | 2024-04-10 09:40:35.305 car_id=1 [info] Start / :asleep
teslamate_1  | 2024-04-10 09:40:38.760 [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-04-10 09:40:41.038 [info] Tzdata has updated the release from 2021e to 2024a
teslamate_1  | 2024-04-10 09:45:35.349 [info] Update available: 1.28.3 -> 1.28.5

Screenshots

image

image

Additional data

No response

Type of installation

Docker

Version

1.28.3

Fred3343 avatar Apr 10 '24 10:04 Fred3343

Thanks for reporting. Even if it seems unrelated, please use latest version, which is as of now 1.28.5

JakobLichterfeld avatar Apr 10 '24 11:04 JakobLichterfeld

Additional your second screenshot shows timeframe from 2024-04-09 till 2024-04-10

JakobLichterfeld avatar Apr 10 '24 11:04 JakobLichterfeld

I'm not able to reproduce on teslamate 1.28.5

JakobLichterfeld avatar Apr 10 '24 11:04 JakobLichterfeld

Hmmm, interesting. In the first screenshot of drives, there is an entry as of 2024/09/04 01:... of 35km. Although the range does not include that time. Difficult to track that down, when not in Shangai timezone... If the system/browser timezone is also Asia/Shanghai, the daily stats should start at 00:00, not 08:00. @Fred3343 can you please check the timezone setting in Home->Administration->General->Default preferences

DrMichael avatar Apr 10 '24 13:04 DrMichael

Hmmm, interesting. In the first screenshot of drives, there is an entry as of 2024/09/04 01:... of 35km. Although the range does not include that time. Difficult to track that down, when not in Shangai timezone... If the system/browser timezone is also Asia/Shanghai, the daily stats should start at 00:00, not 08:00. @Fred3343 can you please check the timezone setting in Home->Administration->General->Default preferences

Thank you for your answer. My default time zone is Shanghai, which has been shown as 8:00 when I first deployed it

Fred3343 avatar Apr 11 '24 01:04 Fred3343

Additional your second screenshot shows timeframe from 2024-04-09 till 2024-04-10

Thank you. Yes, the content shown in the second picture is correct.

Fred3343 avatar Apr 11 '24 01:04 Fred3343

Please note that I also found a problem, this problem may not be important, my server time zone is Shanghai, but the data stored in my database is not saved according to the time of Shanghai, my browser time zone is also Shanghai. I don't know if this is normal.

Fred3343 avatar Apr 11 '24 01:04 Fred3343

I am a bit confused, why Grafana says CST as timezone... image

(Ah, date and times in the database are stored in UTC, I think to remember.)

DrMichael avatar Apr 11 '24 09:04 DrMichael

I am a bit confused, why Grafana says CST as timezone... image

(Ah, date and times in the database are stored in UTC, I think to remember.)

In Grafana's time bar, the CST is always displayed

Fred3343 avatar Apr 11 '24 09:04 Fred3343

When you click on the range, you should get information about the timezone used: image And possibility to change it.

DrMichael avatar Apr 11 '24 10:04 DrMichael

@Fred3343 you might want to try the new version in https://github.com/teslamate-org/teslamate/issues/3857#issuecomment-2066592205

DrMichael avatar Apr 19 '24 13:04 DrMichael

PR created https://github.com/teslamate-org/teslamate/pull/3862. Please test and discuss there.

DrMichael avatar Apr 20 '24 09:04 DrMichael

@Fred3343 could you test latest version https://github.com/DrMichael/teslamate/blob/master/grafana/dashboards/statistics.json?

DrMichael avatar Apr 25 '24 08:04 DrMichael

@Fred3343 could you test latest version https://github.com/DrMichael/teslamate/blob/master/grafana/dashboards/statistics.json?

I tested the statistics.json and I'm sure it works, thanks

Fred3343 avatar Apr 28 '24 05:04 Fred3343