access to historical data

Wishlist
Post Reply
User avatar
aeng
Posts: 21
Joined: Wed Mar 31, 2010 5:44 am

access to historical data

Post by aeng » Sat Apr 17, 2010 6:15 am

I wish this template future:


ask:
data?
time?

then display's:
10-3-2009 13 degrees 60% 1.2UV 1mm 4bft
or graph!

regards

Geert

http://www.hetweerinboskamp.nl

User avatar
admin
Site Admin
Posts: 332
Joined: Sun Feb 07, 2010 9:22 pm

Re: access to historical data

Post by admin » Sat Apr 17, 2010 7:26 am

I think this is already possible (if I understand your request correctly):

template (with comments in brackets at the end of each line):
[20090310000000_day1_th0_temp_0] degrees (returns average temp for sensor th0 in degrees celsius without decimals)
[20090310000000_day1_th0_hum_0]% (returns average humidity without decimals)
[20090310000000_day1_uv0_uvi_1] (returns uv index with 1 decimal)
[20090310000000_day1_rain0_total_0]mm (return total rain for 2009-03-10 in mm without decimals)
[20090310000000_day1_th0_temp_0_3.6]km/h (returns average windspeed in km/h)

Conversion from m/s to Bft cannot be done by Metoplug template mechanism as this is not a linear expression. I converted to km/h instead.

User avatar
admin
Site Admin
Posts: 332
Joined: Sun Feb 07, 2010 9:22 pm

Re: access to historical data

Post by admin » Sat Apr 17, 2010 7:35 am

You can also define a graph/table/csv for a certain day/week/month, which covers all the sensors you like.

When calling the URL to this graph or table simply add "&timeframe=20090310000000-20090310235959" at the end of the URL.
This will overwrite the time frame given in the graph definition. By that you can apply graph definitions to a time frame of your choice when calling the graph.

This is much more powerful than known from Meteohub. The main difference is that Meteohub computes graphs according to a fixed schedule and definition and does upload these to a homepage. Meteoplug offers a URL where the graph gets composed on demand when called. This allows to apply additional parameters to graph generation the moment the graph is requested.

skyewright
Posts: 69
Joined: Tue Mar 16, 2010 12:05 pm
Location: Isle of Skye
Contact:

Re: access to historical data

Post by skyewright » Sat Apr 17, 2010 9:26 am

admin wrote:I think this is already possible (if I understand your request correctly):
If I've understood correctly, I think it would need something like a html page with a <form> to ask the question. Submitting the form would then need to call a cgi script which would compute the timeframe indicated by the <form> then return the output for a particular Meteoplug template for that time frame?

If the unique part of the Meteoplug URL was passed through from the <form> the script could probably be quite 'generic'.

Does that make sense?
David

User avatar
aeng
Posts: 21
Joined: Wed Mar 31, 2010 5:44 am

Re: access to historical data

Post by aeng » Sat Apr 17, 2010 1:58 pm

Yes, thats what i want!
I want a form to fill in the date and time. Then i want to return all data for that moment. And maybe some graphics.

Thats not possible at this moment!

User avatar
admin
Site Admin
Posts: 332
Joined: Sun Feb 07, 2010 9:22 pm

Re: access to historical data

Post by admin » Sat Apr 17, 2010 2:55 pm

Meteoplug can generate data and graphs for a time frame you specify when calling the graph definition. That is 80% of the mileage :-)
Remaining 20 percent is that you build a html page where you have some javasrcipt working that calls a Meteoplug URL according to
date selections made on some drop-down selections.

Maybe I can build something pre-configured for that purpose which spares the user some HTML programming and the need to have a home page at all to present some weather information. At the moment Meteoplug provides a lot of building blocks useful to design an individual weather home page, but an out-of-the-box solution without the need of bothering with HTML might also be worth some thoughts... thanks for inspiring me. :D

skyewright
Posts: 69
Joined: Tue Mar 16, 2010 12:05 pm
Location: Isle of Skye
Contact:

Re: access to historical data

Post by skyewright » Sun Apr 18, 2010 10:34 am

admin wrote:Maybe I can build something pre-configured for that purpose which spares the user some HTML programming and the need to have a home page at all to present some weather information.
Do you mean something like

Code: Select all

...&timeframe=ask
That sort of thing would be neat whatever the syntax (my 'ask' is just an illustration).

PS. I just discovered that Meteoplug's 'relative' time notation works with ...&timeframe in URLS too, e.g.

Code: Select all

https://www.meteoplug.com/cgi-bin/meteochart.cgi?draw=....&timeframe=-2D--1D
for a chart for the day before yesterday (-2D = the start of the day before yesterday, -1D = the start of yesterday). 8-) :D
David

User avatar
admin
Site Admin
Posts: 332
Joined: Sun Feb 07, 2010 9:22 pm

Re: access to historical data

Post by admin » Sun Apr 18, 2010 6:44 pm

I added a new experimental feature that might do something like that.
It is explained in "Graphing" section of the forum.

Basically you select graphically a point in time, a time scale and a type of graph.
Meteoplug then presents your data with predefined chart definitions.

You can freely adapt this to your favorite graphs by copying dashboard file
"www.meteoplug.com/dashboard-1.html" to your Homepage, change according to
your needs and define a template replacement definition in Meteoplug like "__dashboard-1"
which makes use of your dashboard file. This should give extreme flexibility.

User avatar
aeng
Posts: 21
Joined: Wed Mar 31, 2010 5:44 am

Re: access to historical data

Post by aeng » Mon Apr 19, 2010 10:06 am

That looks very nice Boris!

I have another wish:
When i chose "temperature" i see a graph with temp, Hum and dew.
Is it possible to chose between these three? So only a graph with the temperature. Because most viewers on my website are only interested in the temperature (not dew and hum)

regards

Geert

User avatar
admin
Site Admin
Posts: 332
Joined: Sun Feb 07, 2010 9:22 pm

Re: access to historical data

Post by admin » Mon Apr 19, 2010 3:56 pm

To change look and feel of the temperature graph, take the definition of "*t", change it (remove sid1 and sid2 lines) and save it as "*t".
This overwrites the default settings. To make defaults valid again, just delete graph definition "*t". This removes your local file and the general version of "*t" (which is is provided as a template for all users) will be used instead.

Lines can also be deselected interactively from a graph by clicking on the bullet of the corresponding line in the legend.

Post Reply