Export template: Total rain tags, not the value

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

Moderator: Mattk

livadea
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: Tue Oct 30, 2018 11:02 am

Export template: Total rain tags, not the value

Post by livadea »

Hi to all,

After five years on Meteobridge based on TL-MR3020, I upgraded to Meteobridge PRO (red cap).
Now I try to struggle to understand its internal mechanisms.
For the beginning, I try to translate the functionality of the old one.
I tried to export on one-minute resolution, using a template, the total precipitation

- for today - [rain0total-daysum]
- for yesterday - [rain0total-ydaysum]
- for this month - [rain0total-monthsum],
- for this year - [rain0total-yearsum]

But instead of values, I got the tags [rain0total-daysum], [rain0total-ydaysum],[rain0total-monthsum],[rain0total-yearsum].
I made the export every hour for last completed hour.
It is true, that I didn't face any rainy day since I tried to export data, but there are rainy days since I powered up Meteobridge PRO.
My weather station is Davis Vantage VUE.

Thank you!
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Export template: Total rain tags, not the value

Post by Mattk »

What does your complete template look like?

Also try a replacement value and see if this changes getting the tag reflected back?
[rain0total-daysum:---] etc
livadea
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: Tue Oct 30, 2018 11:02 am

Re: Export template: Total rain tags, not the value

Post by livadea »

Hi,
For debugging purposes, I am using a reduced template form and it looks like this:

Code: Select all

#                DateTime: [YYYY]-[MM]-[DD] [hh]:[mm]:[ss]
#         Temperature Avg: [th0temp-avg.2:]
#     Rain Rate Avg10 min: [rain0rate-avg10]
#        Rain Total Today: [rain0total-daysum]
#    Rain Total Yesterday: [rain0total-ydaysum.1]
#Total Rain Current Month: [rain0total-monthsum]
#Rain Total Current Year: [rain0total-yearsum]
#__________________________________________________________

[YYYY]-[MM]-[DD] [hh]:[mm]:[ss],[th0temp-avg.2:],[rain0rate-avg10],[rain0total-daysum],[rain0total-ydaysum.1],[rain0total-monthsum],[rain0total-yearsum]
The output result it is like this:
.....
2018-10-31 19:00:00,12.55,[rain0rate-avg10],[rain0total-daysum],[rain0total-ydaysum.1],[rain0total-monthsum],[rain0total-yearsum]
2018-10-31 20:00:00,11.22,[rain0rate-avg10],[rain0total-daysum],[rain0total-ydaysum.1],[rain0total-monthsum],[rain0total-yearsum]
2018-10-31 21:00:00,10.04,[rain0rate-avg10],[rain0total-daysum],[rain0total-ydaysum.1],[rain0total-monthsum],[rain0total-yearsum]
2018-10-31 22:00:00,9.31,[rain0rate-avg10],[rain0total-daysum],[rain0total-ydaysum.1],[rain0total-monthsum],[rain0total-yearsum]
2018-10-31 23:00:00,8.87,[rain0rate-avg10],[rain0total-daysum],[rain0total-ydaysum.1],[rain0total-monthsum],[rain0total-yearsum]
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Export template: Total rain tags, not the value

Post by Mattk »

If I run that line as is I get
2018-11-02 06:10:25,,0.0,0.0,0.0,0.0,902.8

The double colon ,, indicates incorrect syntax in the temp [th0temp-avg.2:] because avg requires a value avg1, avg2, avg10 etc so should be something like [th0temp-avg1.2:] or similar.

Otherwise I get output like 2018-11-02 07:19:48,23.67,0.0,0.0,0.0,0.0,902.8 which is valid

When you see 2018-11-02 06:55:04,[th0temp-avg1.2],[rain0rate-avg10],[rain0total-daysum],[rain0total-ydaysum.1],[rain0total-monthsum],[rain0total-yearsum] then you have no sensor/data and you can check for this in the Live Data tab
livadea
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: Tue Oct 30, 2018 11:02 am

Re: Export template: Total rain tags, not the value

Post by livadea »

Hi!
Thank you for your patience!

1. Regarding your observation of temperature tag.
I made an export template with the following structure:

Code: Select all

$ #[YYYY]-[MM]-[DD] [hh]:[mm]:[ss],[th0temp-avg.2:],[th0temp-avg1.2:],[th0temp-avg5.2:],[th0temp-avg10.2:],[th0temp-avg20.2:],[th0temp-avg60.2:]
[YYYY]-[MM]-[DD] [hh]:[mm]:[ss],[th0temp-avg.2:],[th0temp-avg1.2:],[th0temp-avg5.2:],[th0temp-avg10.2:],[th0temp-avg20.2:],[th0temp-avg60.2:]
The export looks like:
#[YYYY]-[MM]-[DD] [hh]:[mm]:[ss],[th0temp-avg.2:],[th0temp-avg1.2:],[th0temp-avg5.2:],[th0temp-avg10.2:],[th0temp-avg20.2:],[th0temp-avg60.2:]
2018-11-01 00:00:00,8.50,,,,,
2018-11-01 00:01:00,8.50,,,,,
2018-11-01 00:02:00,8.48,,,,,
2018-11-01 00:03:00,8.44,,,,,
2018-11-01 00:04:00,8.42,,,,,
2018-11-01 00:05:00,8.40,,,,,

As you can observe I got a valid output for temperature just with [th0temp-avg.2:] all the others seems to indicate an incorect syntax.
The export data was yesterday at one-minute resolution.

As you can see below, the data exists in the device and it seems to be OK.
temperature test.JPG
temperature test.JPG (61.72 KiB) Viewed 4636 times

2. Regarding rain data, as you can see in the capture from LiveData I have data and they are correct.
Rain Rate.JPG
Rain Rate.JPG (18.82 KiB) Viewed 4636 times
I don't know if it does make any sense for my problem, but when I set up for the very first time Meteobridge PRO I imported a configuration file from the old Meteobridge (Platform: TL-MR3020, SW Version: Meteobridge 3.2).
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Export template: Total rain tags, not the value

Post by Mattk »

livadea wrote: Fri Nov 02, 2018 10:37 am .... I don't know if it does make any sense for my problem, but when I set up for the very first time Meteobridge PRO I imported a configuration file from the old Meteobridge (Platform: TL-MR3020, SW Version: Meteobridge 3.2).
Gee that raises some flags? That's not something I would do and all indications are your template in my systems are obviously working totally different to yours
livadea
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: Tue Oct 30, 2018 11:02 am

Re: Export template: Total rain tags, not the value

Post by livadea »

a) I made a factory reset of the device and I reconfigured it from scratch.
b) I deleted all the sensors database to avoid any legacy from the old configuration and I asked for its reconstruction.
c) I let the system to achieve data for some hours.

After running the export template there is no change - I got valid value for a non-valid variable while the correct variables, as per user manual, are returning invalid values.

Template :

Code: Select all

$ #[YYYY]-[MM]-[DD] [hh]:[mm]:[ss],[th0temp-avg.2:],[th0temp-avg1.2:],[th0temp-avg5.2:],[th0temp-avg10.2:],[th0temp-avg20.2:],[th0temp-avg60.2:]
[YYYY]-[MM]-[DD] [hh]:[mm]:[ss],[th0temp-avg.2:],[th0temp-avg1.2:],[th0temp-avg5.2:],[th0temp-avg10.2:],[th0temp-avg20.2:],[th0temp-avg60.2:]
Export Data:
#[YYYY]-[MM]-[DD] [hh]:[mm]:[ss],[th0temp-avg.2:],[th0temp-avg1.2:],[th0temp-avg5.2:],[th0temp-avg10.2:],[th0temp-avg20.2:],[th0temp-avg60.2:]
.......
2018-11-02 19:01:00,12.78,,,,,
2018-11-02 19:02:00,12.73,,,,,
2018-11-02 19:03:00,12.70,,,,,
2018-11-02 19:04:00,12.70,,,,,
2018-11-02 19:05:00,12.70,,,,,
.......

Historical data of the sensor it is OK, as you can see below.
history temp.jpg
history temp.jpg (46.09 KiB) Viewed 4625 times
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Export template: Total rain tags, not the value

Post by Mattk »

Ok I think I can see what's going on here? Anything other than "avg" does not conform to the specifics of an export file. An export file is a line by line export based on and within a selected resolution, avg is applied by default to the full resolution period and the intent of an export file doesn't allow say a 1 minute resolution and trying to apply say a 60 minute average, won't work.

If you change all the avgxx to simply avg then you will populate the export file (no null data values) but of course the values will be identical.

What you are probably trying to do, the export mechanism is really not the option. There's nothing wrong with your template line when used in other templates, just doesn't conform to the specifics of an .exp
livadea
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: Tue Oct 30, 2018 11:02 am

Re: Export template: Total rain tags, not the value

Post by livadea »

I partially agree with your remarks.
But I started this topic with a different problem that it doesn't have anything to do with average values, I am not able to retrieve following precipitation data:
[rain0total-daysum] - total precipitation for today
[rain0total-ydaysum.1] - total precipitation for yesterday
[rain0total-monthsum] - total precipitation for the current month
[rain0total-yearsum] - total precipitation for the current year.

Even if I deleted all data and were not any more precipitation since then I think I must get zero values, like in LiveData tab, isn't it?
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Export template: Total rain tags, not the value

Post by Mattk »

Ok then refresh things on the precipitation, what type of template, service etc
livadea
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: Tue Oct 30, 2018 11:02 am

Re: Export template: Total rain tags, not the value

Post by livadea »

It is a manual export of the previous day at 1-hour resolution.

The template it is:

Code: Select all


#                DateTime: [YYYY]-[MM]-[DD] [hh]:[mm]:[ss]
#         Temperature Avg: [th0temp-avg.2]
#    Rain Rate Avg ?? min: [rain0rate-avg.1]
#    Rain Rate Avg 60 min: [rain0rate-avg60.1]
#        Rain Total Today: [rain0total-daysum]
#    Rain Total Yesterday: [rain0total-ydaysum.1]
#Total Rain Current Month: [rain0total-monthsum]
#Rain Total Current Year: [rain0total-yearsum]
#__________________________________________________________

[YYYY]-[MM]-[DD] [hh]:[mm]:[ss],[th0temp-avg.2],[rain0rate-avg.1],[rain0rate-avg60.1],[rain0total-daysum.1],[rain0total-ydaysum.1],[rain0total-monthsum.1],[rain0total-yearsum.1]
The export is:
.....
2018-11-02 16:00:00,16.06,0.0,[rain0rate-avg60.1],[rain0total-daysum.1],[rain0total-ydaysum.1],[rain0total-monthsum.1],[rain0total-yearsum.1]
2018-11-02 17:00:00,14.32,0.0,[rain0rate-avg60.1],[rain0total-daysum.1],[rain0total-ydaysum.1],[rain0total-monthsum.1],[rain0total-yearsum.1]
2018-11-02 18:00:00,13.43,0.0,[rain0rate-avg60.1],[rain0total-daysum.1],[rain0total-ydaysum.1],[rain0total-monthsum.1],[rain0total-yearsum.1]
2018-11-02 19:00:00,12.48,0.0,[rain0rate-avg60.1],[rain0total-daysum.1],[rain0total-ydaysum.1],[rain0total-monthsum.1],[rain0total-yearsum.1]
2018-11-02 20:00:00,11.69,0.0,[rain0rate-avg60.1],[rain0total-daysum.1],[rain0total-ydaysum.1],[rain0total-monthsum.1],[rain0total-yearsum.1]
2018-11-02 21:00:00,11.32,0.0,[rain0rate-avg60.1],[rain0total-daysum.1],[rain0total-ydaysum.1],[rain0total-monthsum.1],[rain0total-yearsum.1]
2018-11-02 22:00:00,10.58,0.0,[rain0rate-avg60.1],[rain0total-daysum.1],[rain0total-ydaysum.1],[rain0total-monthsum.1],[rain0total-yearsum.1]
2018-11-02 23:00:00,10.09,0.0,[rain0rate-avg60.1],[rain0total-daysum.1],[rain0total-ydaysum.1],[rain0total-monthsum.1],[rain0total-yearsum.1]

Deliberate I kept -avg and -avg60 selectors for rain0rate.
As you can see, again -avg60 is not working.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Export template: Total rain tags, not the value

Post by Mattk »

What you are trying to do is again not suitable or the intent of an .exp template which is a special type of template exporting more of a sequential timeline which can not be used with certain selectors. The export template is simply not intended to do all you are trying to do and this is why you are getting the sensor-selector combinations that don't conform flashed back.
livadea
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: Tue Oct 30, 2018 11:02 am

Re: Export template: Total rain tags, not the value

Post by livadea »

In your first reply you said:
Mattk wrote: ↑
If I run that line as is I get
2018-11-02 06:10:25,,0.0,0.0,0.0,0.0,902.8
You see you get the total rain figure, this kind of result I am looking for.
The question is why is working on your system and not on mine?
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Export template: Total rain tags, not the value

Post by Mattk »

That's because I simply run your line as an email template not as an export template as I had not noted this was being run as an .exp. What this says is there is nothing wrong with your syntax just the application, this syntax or part there of would work fine with Email, HTTP, HTML, TXT etc but selectors like avg60, ydaysum, monthsum, yearsum etc is just not applicable to an .exp template

.exp format/output applies (generally) more to what occurs within each resolution interval as opposed to say each and every minute resolution having to re-process/sum say an entire years archive for each and every sensor for each and every time period. This really is not the purpose/intent of the export function.

Export selectors more applicable to each time period are singular ones like sum, val, max, avg, act etc if you want to sum up days. months, year of data etc then the export format is not it.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Export template: Total rain tags, not the value

Post by admin »

livadea wrote: Sat Nov 03, 2018 8:57 am [rain0total-daysum] - total precipitation for today
[rain0total-ydaysum.1] - total precipitation for yesterday
[rain0total-monthsum] - total precipitation for the current month
[rain0total-yearsum] - total precipitation for the current year.
When doing mass data exports Meteobridge PRO does not support all the options template variables can provide. When you look at the generic template variable format "sensor-selector=converter.decimals:replacement" then the selector part is restricted on exports. You can make use of "min", "max", "avg" (and "sum" for cumulated readings like raintotal), but not of variants on those that give their own time resolution (avg10, sumday, etc). That is the reason why these variables are not replaced by values. They are not defined in this context.

When you define an export you give a time range and a time resolution. This resolution is then used to determine which maximum or average to look for. For example: When you go for an hourly resolution, each line will be able to report min/max/avg/sum data for the particular hour. These mass exports are realized by looping through the database rows in order to be efficient. While tons of values are extracted, we don't have a more complicated logic applied that also allows to break out of the given stepping through the rows. As a result adding a column that does show cumulated rain of the day is not supported when we stepping through the data in an hourly interval. Sorry, this might be confusing, but I don't know how to say it more simple :)
Post Reply