Hello,
I have an event which outputs a line of SQL "on every started minute", with a time stamp defined using the internal template - eg:
values ('[UYYYY]-[UMM]-[UDD] [Uhh]:[Umm]:00',...etc
I also have an event which exports data (via a template I created) at minute resolution to a csv file every hour, to produce a text based log of some of the quantities in the database.
I have noticed that the SQL output, and the data exported, appear to differ by 1-minute, so for example just now the temperature (as defined by [th0temp-avg1] in the SQL, or [th0temp-avg] in the data export at minute resolution) just now changed from 9.7 to 9.8 Celsius on the obs timestamped 14:57:00 and 14:58:00 in the SQL database, but in the text file this change occurs between the 14:56:00 and 14:57:00 lines in the exported csv.
If anyone can shed any light on this discrepancy I'd be most grateful!
Many thanks
Question regarding data output
Moderator: Mattk
-
- Junior Boarder
- Posts: 37
- Joined: Sat Dec 16, 2023 7:22 pm
-
- Junior Boarder
- Posts: 37
- Joined: Sat Dec 16, 2023 7:22 pm
Re: Question regarding data output
Anyone? Thanks.
Re: Question regarding data output
Changes with 1 minute data and within a point of a degree tends to be marginal? Avg1 and avg in the context would have different meanings and probably don't relate to each other when worrying about maybe a few seconds difference?
-
- Junior Boarder
- Posts: 37
- Joined: Sat Dec 16, 2023 7:22 pm
Re: Question regarding data output
Yes, it is marginal, but it is important to me to get it exactly right, and moreover, it may expose a bug within meteobridge to be examined. Over the past few weeks I have found this to be persistent, the data exported to a log is always 1-minute out from the data inserted via SQL.
Re: Question regarding data output
My way of understanding is there is no guarantee way of knowing things are falling on the exact minute as there is no sequential line by line 1 second data. The age of the readings would obviously have inconsistent gaps in the time line. Avg1 is the average over the past minute (60 seconds) and that doesn't imply it is necessarily a whole absolute time frame, it could be from say 35 seconds past a minute to 25 second past the next minute.
This 1 minute stuff tends to become a little flaky unless one is absolutely dealing with perfect 1 second records between absolve minutes and that is not going to happen?
This 1 minute stuff tends to become a little flaky unless one is absolutely dealing with perfect 1 second records between absolve minutes and that is not going to happen?
Re: Question regarding data output
The SQL will get the current sensor data at the start of the minute. It is a snapshot. The export reports the min/max/average of sensor data that showed up from the start to the end of the minute.