Database export [rain0total-sumXX] not working **solved**

This section covers the Meteobridge PRO, PRO2, NANO SD, Raspberry Pi and VM platforms exclusively

Moderator: Mattk

Post Reply
frogfoot
Senior Boarder
Senior Boarder
Posts: 43
Joined: Thu Feb 25, 2016 11:06 am

Database export [rain0total-sumXX] not working **solved**

Post by frogfoot »

Hi,
I'm trying to export rain totals to a file which I can use to manually update a database, I want to get hourly totals but I cant get any data out using [rain0total-sum60] (as described in the Templates page of the Wiki)

my tamplate is as follows

UPDATE meteo.alldata SET RHr =[rain0total-sum60:] where CONVERT(cast(dateTime as CHARACTER(16)),DateTime)= '[YYYY]-[MM]-[DD] [hh]:[mm]';

and I run the 'Export month in hours' option however I get the following result...

UPDATE meteo.alldata SET RHr = where CONVERT(cast(dateTime as CHARACTER(16)),DateTime)= '2016-03-01 00:00';
UPDATE meteo.alldata SET RHr = where CONVERT(cast(dateTime as CHARACTER(16)),DateTime)= '2016-03-01 01:00';
UPDATE meteo.alldata SET RHr = where CONVERT(cast(dateTime as CHARACTER(16)),DateTime)= '2016-03-01 02:00';
UPDATE meteo.alldata SET RHr = where CONVERT(cast(dateTime as CHARACTER(16)),DateTime)= '2016-03-01 03:00';
UPDATE meteo.alldata SET RHr = where CONVERT(cast(dateTime as CHARACTER(16)),DateTime)= '2016-03-01 04:00';
...
...

as you can see there is no values for [rain0total-sum60:] even though we have had a load of rain and the meteobridge pro database shows accumulated rainfall for the specified period.
I hope you can help
Tom
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Database export [rain0total-sumXX] not working

Post by admin »

Export function just grabs data from the database and does not perform any summing up over a user defined period.
By selecting the time resolution "in hours" it is fixed that hourly data is used. When you say [rain0total-sum] you
should be fine.
frogfoot
Senior Boarder
Senior Boarder
Posts: 43
Joined: Thu Feb 25, 2016 11:06 am

Re: Database export [rain0total-sumXX] not working

Post by frogfoot »

Thanks, now I understand!

Would it be possible to have export in 5 min chunks added at some point ( or even better a user defined time) in addition to per day, per hour and per minute as my database stores data at 5 minute intervals, having the possibility to export historic data in those timeslices would be very useful
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Database export [rain0total-sumXX] not working **solved

Post by admin »

This will add even more complexity to the MB PRO. I am just fighting to
get all the bugs out and therefore, I am reluctant to implement even more complicated
special features. I would recommend that you aggregate data on your side.
MB PRO can deliver down to per minute data.
Post Reply