Graphical schedule

How is time handled in the graphs ?
Because I always have a 2-hour difference in the display of the curves.

In the graph you can see the first peak starting at 10:30 while it was actually around 12:30.

Have you properly configured your time zone in the settings?

Since I did that, I no longer have this issue:

Yes, I’ve checked

Which integration do the data come from?

In this case the data comes from a Zigbee plug.

But I also have the same issue with data that I send from Node-RED.

We need to determine whether the problem comes from the data storage (is the time stored correctly in the database (DB)?), or whether the problem comes from the display

You can check the API calls in your browser to see if the API call is correct, then you can trace the flow back and check your SQLite database to see if the storage is correct

I have all the dates in GMT in the browser, hence the 2-hour offset

That’s not related, look at the body return, that’s a response header, it’s not used :slight_smile:

I’ll take a closer look this evening because I’m not at home right now.

1 Like

@pierre-gilles so could you point me in the right direction to find the info?

I checked in the database and we also have a 2-hour offset in the records


It was 12:21 instead of 10:21.

The time in the DB seems correct to me; in the database the data was recorded in the UTC timezone (indicated by the +00:00 at the end of the datetime, so indeed 2 hours before French time)

However, the frontend should be able to handle that and perform the conversion when displaying.

Can you check in the JSON body of the API response on the frontend what date format is being sent?

So can you guide me on how to do it?

For me, the time in the DB (database) should be stored in UTC with timezone information, right?

10:21 in :fr:

2021-06-02T08:21:07+02:00

You do the same thing you did in this post:

But look at the « Response » tab :slight_smile:

It should be a states array, look at the first element of the array and the displayed date :slight_smile:

[quote=« cicoub13, post:14, topic:7347 »]
To me, the time in

Ok, in which part exactly?
![image|690x222](upload://f9W1LgN6ih2d0WQbXkQ8G

Click on this request

Here you go

[{"device":{"name":"Prise TV"},"deviceFeature":{"name":"Puissance consommée"},"values":[{"created_at":"2022-06-05T17:30:00.000Z","value":49.33},{"created_at":"2022-06-05T17:40:00.000Z","value":44.75},{"created_at":"2022-06-05T17:50:00.000Z","value":49.67},{"created_at":"2022-06-05T18:10:00.000Z","value":46.5},{"created_at":"2022-06-05T18:20:00.000Z","value":43.71},{"created_at":"2022-06-05T18:40:00.000Z","value":50.43},{"created_at":"2022-06-05T18:45:00.000Z","value":43.29},{"created_at":"2022-06-05T19:10:00.000Z","value":49.29},{"created_at":"2022-06-05T19:15:00.000Z","value":46.33},{"created_at":"2022-06-05T19:35:00.000Z","value":44.71},{"created_at":"2022-06-05T19:40:00.000Z","value":54},{"created_at":"2022-06-05T20:00:00.000Z","value":42.67},{"created_at":"2022-06-05T20:15:00.000Z","value":53},{"created_at":"2022-06-05T20:35:00.000Z","value":39.47},{"created_at":"2022-06-05T20:40:00.000Z","value":53.5},{"created_at":"2022-06-05T20:55:00.000Z","value":44.38},{"created_at":"2022-06-05T21:15:00.000Z","value":52},{"created_at":"2022-06-05T21:30:00.000Z","value":44.45},{"created_at":"2022-06-05T21:40:00.000Z","value":46.13},{"created_at":"2022-06-05T21:50:00.000Z","value":52.67},{"created_at":"2022-06-05T22:05:00.000Z","value":5},{"created_at":"2022-06-05T22:25:00.000Z","value":5},{"created_at":"2022-06-05T22:35:00.000Z","value":6},{"created_at":"2022-06-05T22:50:00.000Z","value":7},{"created_at":"2022-06-05T23:05:00.000Z","value":5},{"created_at":"2022-06-05T23:25:00.000Z","value":7},{"created_at":"2022-06-05T23:35:00.000Z","value":4.5},{"created_at":"2022-06-05T23:50:00.000Z","value":6},{"created_at":"2022-06-06T00:05:00.000Z","value":4.5},{"created_at":"2022-06-06T00:15:00.000Z","value":5},{"created_at":"2022-06-06T00:35:00.000Z","value":6},{"created_at":"2022-06-06T00:40:00.000Z","value":5},{"created_at":"2022-06-06T01:05:00.000Z","value":5},{"created_at":"2022-06-06T01:15:00.000Z","value":6.5},{"created_at":"2022-06-06T01:25:00.000Z","value":5},{"created_at":"2022-06-06T01:40:00.000Z","value":5.4},{"created_at":"2022-06-06T02:00:00.000Z","value":5},{"created_at":"2022-06-06T02:15:00.000Z","value":4},{"created_at":"2022-06-06T02:20:00.000Z","value":5.5},{"created_at":"2022-06-06T02:35:00.000Z","value":5},{"created_at":"2022-06-06T03:00:00.000Z","value":5},{"created_at":"2022-06-06T03:15:00.000Z","value":6},{"created_at":"2022-06-06T03:30:00.000Z","value":50.75},{"created_at":"2022-06-06T03:35:00.000Z","value":55},{"created_at":"2022-06-06T03:45:00.000Z","value":47.73},{"created_at":"2022-06-06T04:00:00.000Z","value":54.5},{"created_at":"2022-06-06T04:25:00.000Z","value":54},{"created_at":"2022-06-06T04:35:00.000Z","value":43.34},{"created_at":"2022-06-06T04:55:00.000Z","value":47.86},{"created_at":"2022-06-06T05:05:00.000Z","value":53.6},{"created_at":"2022-06-06T05:20:00.000Z","value":87.33},{"created_at":"2022-06-06T05:25:00.000Z","value":71.13},{"created_at":"2022-06-06T05:50:00.000Z","value":66.88},{"created_at":"2022-06-06T06:00:00.000Z","value":57.35},{"created_at":"2022-06-06T06:10:00.000Z","value":5.8},{"created_at":"2022-06-06T06:25:00.000Z","value":5},{"created_at":"2022-06-06T06:45:00.000Z","value":5.5},{"created_at":"2022-06-06T07:00:00.000Z","value":4},{"created_at":"2022-06-06T07:05:00.000Z","value":5},{"created_at":"2022-06-06T07:25:00.000Z","value":6},{"created_at":"2022-06-06T07:35:00.000Z","value":4},{"created_at":"2022-06-06T07:50:00.000Z","value":6},{"created_at":"2022-06-06T08:15:00.000Z","value":5},{"created_at":"2022-06-06T08:25:00.000Z","value":46.45},{"created_at":"2022-06-06T08:35:00.000Z","value":55},{"created_at":"2022-06-06T08:55:00.000Z","value":55},{"created_at":"2022-06-06T09:10:00.000Z","value":49.6},{"created_at":"2022-06-06T09:20:00.000Z","value":55},{"created_at":"2022-06-06T09:35:00.000Z","value":52.78},{"created_at":"2022-06-06T09:55:00.000Z","value":54},{"created_at":"2022-06-06T10:00:00.000Z","value":44.87},{"created_at":"2022-06-06T10:15:00.000Z","value":51.8},{"created_at":"2022-06-06T10:30:00.000Z","value":47.6},{"created_at":"2022-06-06T10:45:00.000Z","value":55},{"created_at":"2022-06-06T11:05:00.000Z","value":47.07},{"created_at":"2022-06-06T11:10:00.000Z","value":45.54},{"created_at":"2022-06-06T11:25:00.000Z","value":51.4},{"created_at":"2022-06-06T11:50:00.000Z","value":54},{"created_at":"2022-06-06T12:00:00.000Z","value":48},{"created_at":"2022-06-06T12:05:00.000Z","value":54},{"created_at":"2022-06-06T12:20:00.000Z","value":47.47},{"created_at":"2022-06-06T12:35:00.000Z","value":45.33},{"created_at":"2022-06-06T13:00:00.000Z","value":53},{"created_at":"2022-06-06T13:10:00.000Z","value":48},{"created_at":"2022-06-06T13:20:00.000Z","value":54},{"created_at":"2022-06-06T13:40:00.000Z","value":47.83},{"created_at":"2022-06-06T13:50:00.000Z","value":54.33},{"created_at":"2022-06-06T14:05:00.000Z","value":49.76},{"created_at":"2022-06-06T14:25:00.000Z","value":55},{"created_at":"2022-06-06T14:30:00.000Z","value":45.96},{"created_at":"2022-06-06T14:45:00.000Z","value":49},{"created_at":"2022-06-06T15:10:00.000Z","value":45.69},{"created_at":"2022-06-06T15:20:00.000Z","value":50.33},{"created_at":"2022-06-06T15:30:00.000Z","value":54},{"created_at":"2022-06-06T15:45:00.000Z","value":45.4},{"created_at":"2022-06-06T16:00:00.000Z","value":54.4},{"created_at":"2022-06-06T16:20:00.000Z","value":48.91},{"created_at":"2022-06-06T16:25:00.000Z","value":54},{"created_at":"2022-06-06T16:40:00.000Z","value":54},{"created_at":"2022-06-06T16:55:00.000Z","value":47.62}]}]

So, @_Will_71, is this the right time or not?

No, the time is not correct.


Here I have a peak at 5:20 which corresponds to French time 7:20.
We find this peak on the chart at about 7:20. So that matches.

But in reality it was 9:20!