Horaire graphique

Comment est gérée l’heure dans les graphiques ?
Car j’ai toujours 2H d’écart dans l’affichage des courbes.

Dans la courbe on voit le premier pic démarrer a 10h30 alors qu’il était en réalité 12h30 environ.

As-tu bien configuré ton fuseau horaire dans les paramètres ?

Depuis que je l’ai fait, je n’ai plus ce souci pour ma part :

Oui j’ai vérifié

Les données viennent de quelle intégration ?

Dans ce cas les données proviennent d’une prise zigbee .

Mais j’ai le cas aussi avec des données que j’envoie depuis NodeRed.

Il faut comprendre si le problème vient du stockage de la donnée (est-ce qu’en DB l’heure stockée est la bonne), ou si le problème vient de l’affichage

Tu peux regarder les appels API dans ton navigateur pour voir si l’appel API est bon, ensuite tu peux remonter la pelotte et regarder dans ta DB SQlite pour voir si le stockage est bon

J’ai toutes les dates en GMT dans le navigateur d’où le décalage de 2H

C’est pas lié ça, regarde le retour du body, ça c’est un headers de la réponse, c’est pas utilisé :slight_smile:

Je regarderais plus en détails ce soir car je ne suis plus chez moi.

1 « J'aime »

@pierre-gilles du coup je veux bien que tu m’aiguilles un peu pour trouver l’info

J’ai vérifié dans le base de donnée et on a aussi 2H de décalage dans les enregistrements


Il était 12H21 au lieu de 10H21.

L’heure en DB me semble bonne, dans la base de donnée la data a été enregistré en timezone UTC (indiqué par le +00:00 à la fin du datetime, donc effectivement 2h avant l’heure française)

Cependant, le frontend devrait pouvoir se débrouiller avec ça et faire la conversion à l’affichage.

Est-ce que tu peux regarder dans le body JSON de la response API côté front le format de la date envoyé ?

Justement tu peux m’aiguiller pour savoir comment faire?

Pour moi, l’heure en DB devrait être stockée en UTC avec la notion de timezone non ?

10h21 en :fr:

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

Tu fais la même chose que tu avais fais dans ce post:

Mais tu regarde l’onglet « Réponse » :slight_smile:

ça devrait être un tableau d’états, tu regarde le premier élément du tableau et la date affichée :slight_smile:

C’est le cas.

10h21 heure UTC (00:00) = 12h21 heure française.

Le stockage en DB est bon

Ok, dans quel partie exactement?

Clic sur cette requête

Voila

[{"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}]}]

Et du coup @_Will_71 est-ce que cette heure est la bonne heure / ou non ?

Non l’heure n’est pas bonne.


Ici j’ai un pic a 5h20 qui correspond a heure française 7h20.
On retrouve ce pic sur le graphique a environ 7h20. Donc cela correspond.

Mais en réalité il était 9h20!