fhem / bfs

BFS - Bundesamt für Strahlenschutz Module for FHEM [GITHUB ONLY PROJECT]
GNU General Public License v2.0
0 stars 0 forks source link

Time shenanigans #8

Open christoph-morrison opened 4 years ago

christoph-morrison commented 4 years ago

The ReadingTimestamp does no match a) the last published value of a station or b) the FHEM time:

Internals:
   CFGFN     
   DEF        057540080
   FUUID      5e2c3433-f33f-0f53-635e-8a0c10bb97dad085
   NAME       general.test.bfs
   NR         18654
   RADIATION  Gütersloh-Hollen
   STATE      0.061 µSv/h
   TYPE       bfs
   .attraggr:
   .attrminint:
   Helper:
     DBLOG:
       radiation_cosmic:
         general.system.log.db:
           TIME       1579955343.96793
           VALUE      0.041
       radiation_terrestrial:
         general.system.log.db:
           TIME       1579955343.97335
           VALUE      0.02
       radiation_total:
         general.system.log.db:
           TIME       1579955343.96255
           VALUE      0.061
   READINGS:
     2020-01-25 13:29:03   .lastUpdateRadiation 1579946400
     2020-01-25 11:00:00   radiation_cosmic 0.041
     2020-01-25 11:00:00   radiation_terrestrial 0.02
     2020-01-25 11:00:00   radiation_total 0.061
   helper:
     INTERVAL   3600
     STATION    057540080
Attributes:
   showTimeReadings 0
   stateFormat radiation_total µSv/h
   userPassODL notyour:business

Values were updated around 13:xx and the last data published by the BfS are from 10:00

christoph-morrison commented 4 years ago

Last update: Readings are from 17:00, last data captured from 16:00 -- 1h offset

florian-asche commented 4 years ago
2020.01.25 19:26:25.996 3: bfs: DateTime:2020-01-25 01:00
2020.01.25 19:26:25.996 3: bfs: DateTime (timestamp): 1579914000
2020.01.25 19:26:25.997 3: bfs: DateTime:2020-01-25 02:00
2020.01.25 19:26:25.997 3: bfs: DateTime (timestamp): 1579917600
2020.01.25 19:26:25.999 3: bfs: DateTime:2020-01-25 03:00
2020.01.25 19:26:25.999 3: bfs: DateTime (timestamp): 1579921200
2020.01.25 19:26:26.000 3: bfs: DateTime:2020-01-25 04:00
2020.01.25 19:26:26.000 3: bfs: DateTime (timestamp): 1579924800
2020.01.25 19:26:26.001 3: bfs: DateTime:2020-01-25 05:00
2020.01.25 19:26:26.001 3: bfs: DateTime (timestamp): 1579928400
2020.01.25 19:26:26.002 3: bfs: DateTime:2020-01-25 06:00
2020.01.25 19:26:26.003 3: bfs: DateTime (timestamp): 1579932000
2020.01.25 19:26:26.004 3: bfs: DateTime:2020-01-25 07:00
2020.01.25 19:26:26.004 3: bfs: DateTime (timestamp): 1579935600
2020.01.25 19:26:26.005 3: bfs: DateTime:2020-01-25 08:00
2020.01.25 19:26:26.005 3: bfs: DateTime (timestamp): 1579939200
2020.01.25 19:26:26.007 3: bfs: DateTime:2020-01-25 09:00
2020.01.25 19:26:26.007 3: bfs: DateTime (timestamp): 1579942800
2020.01.25 19:26:26.008 3: bfs: DateTime:2020-01-25 10:00
2020.01.25 19:26:26.008 3: bfs: DateTime (timestamp): 1579946400
2020.01.25 19:26:26.009 3: bfs: DateTime:2020-01-25 11:00
2020.01.25 19:26:26.009 3: bfs: DateTime (timestamp): 1579950000
2020.01.25 19:26:26.011 3: bfs: DateTime:2020-01-25 12:00
2020.01.25 19:26:26.011 3: bfs: DateTime (timestamp): 1579953600
2020.01.25 19:26:26.012 3: bfs: DateTime:2020-01-25 13:00
2020.01.25 19:26:26.012 3: bfs: DateTime (timestamp): 1579957200
2020.01.25 19:26:26.014 3: bfs: DateTime:2020-01-25 14:00
2020.01.25 19:26:26.014 3: bfs: DateTime (timestamp): 1579960800
2020.01.25 19:26:26.015 3: bfs: DateTime:2020-01-25 15:00
2020.01.25 19:26:26.015 3: bfs: DateTime (timestamp): 1579964400
2020.01.25 19:26:26.017 3: bfs: DateTime:2020-01-25 16:00
2020.01.25 19:26:26.017 3: bfs: DateTime (timestamp): 1579968000
florian-asche commented 4 years ago

2020.01.25 19:26:26.017 3: bfs: DateTime:2020-01-25 16:00 2020.01.25 19:26:26.017 3: bfs: DateTime (timestamp): 1579968000

Assuming that this timestamp is in seconds:
GMT: Saturday, 25. January 2020 16:00:00
Your time zone: Samstag, 25. Januar 2020 17:00:00 GMT+01:00
Relative: 3 hours ago

Die Uhrzeit über die API wird in MEZ ausgegeben und von dem Module dann direkt in einen Timestamp umgewandelt. Da die Zeitzone dabei nicht beachtet wird, kommen die Daten falsch in die Datenbank.

christoph-morrison commented 3 years ago

push