Dashboard has a 2h offset

Hello to all,

i got a strange Problem. I am trying to move away from FHEM SVG Plots to FHEM with Grafana. The DB Queries are easy to setup but i am struggeling with a constant 2h offset Grafana is displaying …

I checked on the TZ Config on all 3 Machines involved (moved between three windows and typed date):

Fhem Server:
pi@fhempi:~ $ date
Mon 1 Oct 14:54:14 CEST 2018

mysqlServer:
root@xxxx:~# date
Mon Oct 1 14:54:18 CEST 2018

Grafana Server:

pi@PiHole:~ $ date
Mon 1 Oct 14:54:22 CEST 2018

They use same Timeserver.

Just comparing the old SVG plot and the Grafana plot i do see:

in comparison Grafana is 2h late:

Looking at the raw data in the mysql DB i do see that the data is correct (NB - i did look into this DB a couple of minutes later but it’s showing the correct time)

So FHEM is logging it to Mysql correctly, SVG is plotting it correctly - why does Grafana has the 2h offset?

TIA

Christian

Make sure you store you timestamps/date column data in UTC format

Mmmm, so grafana can’t handle cest?

Why ist svg Not having a Problem?

Christian

Nope, UTC is the best time zone for time series data. How is your SVG plot handling CEST<->CET (summer time<-> non-summer time) change? I guess you have a 1-hour gap or 1 hour of double data points in your svg graph.

There is issue in grafana where it checks time as UTC time but when in interval comparison or group by it checks time as local and only converting interval time to UNIX .

Solution - You should add one more column to table which should contains UNIX equivalent time of your timestamp and pass that in time column and everything will work.

Eg.

Local Browser Time - 2020-05-31 17:21:05 (It is UTC + 5:30)
UNIX_TIMESTAMP - 1590945665