Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.9.1 (build 3096) - 31 October 2020 (please see announcement regarding releases since 3.5.0)
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of the NOAA report and Snow Index drop-down menus to 2030)

Use this Wiki link to Download the Software (Cumulus MX / Cumulus 1 and other related items).

This day last year page

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

bigmac
Posts: 159
Joined: Wed 13 May 2009 9:35 am
Weather Station: Davis Vantage Pro 2 Wireless
Operating System: Raspbian wheezy
Location: Nr Ilkley, West Yorks, UK
Contact:

This day last year page

Post by bigmac »

I have seen on a few peoples websites, a "this day last year" page. Having looked through the forum and failed to find reference to it, I wasn't sure if this was something people have done off their own back or if it was adapted from other code. Does anyone know if this was covered in a forum topic or can give me a starting point to develop this myself?

Thanks.

User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: This day last year page

Post by steve »

Can you give a link to an example of that? One of the things I was going to add was a set of web tags with daily stats (the sort of stuff that goes into dayfile.txt) that would be accessible via a "day=n" parameter (and "month=n" etc), so you could get a particular value for n days ago, up to a year ago (e.g. <#dailyhightemp day=365>); rather like the 'recent history' tags I introduced in build 1033. There have often been complaints that Cumulus was lacking in that sort of data compared to other software, and it took quite a bit of work to finally provide it. But it doesn't look like anyone was interested in it after all, so I put the "daily" version on hold.
Steve

bigmac
Posts: 159
Joined: Wed 13 May 2009 9:35 am
Weather Station: Davis Vantage Pro 2 Wireless
Operating System: Raspbian wheezy
Location: Nr Ilkley, West Yorks, UK
Contact:

Re: This day last year page

Post by bigmac »

[quote="steve"]There have often been complaints that Cumulus was lacking in that sort of data compared to other software[\quote]

Steve, one thing you can never be accused of is lacking in anything (Cumulus wise!). To paraphrase your own description of Cumulus, it is something you do in your spare time and you don't make a living from it, ergo, nothing is lacking, it simply is not a feature that has yet been implemented into an already fantastic piece of "hobby" software, and I don't mean hobby software disrespectfully!

Anyway, to answer your question, here is a typical example I like from Helens website: http://www.lalocherie.com/weather/todayprevyears.php

This isn't something I really expect you to implement Steve, I'm sure it is something the community have already resolved, I simply haven't been able to find the correct posting for it!

Thanks anyway Steve.

User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: This day last year page

Post by steve »

Yes, that type of page is exactly the sort of thing that would be made easier with the web tags I was proposing. I suspect Helen is using an SQL database made from the contents of dayfile.txt. That's a superb web site, it really makes me pleased to see things like that done with the data Cumulus supplies.
Steve

User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: This day last year page

Post by nitrx »

steve wrote:Can you give a link to an example of that? One of the things I was going to add was a set of web tags with daily stats (the sort of stuff that goes into dayfile.txt) that would be accessible via a "day=n" parameter (and "month=n" etc), so you could get a particular value for n days ago, up to a year ago (e.g. <#dailyhightemp day=365>); rather like the 'recent history' tags I introduced in build 1033. There have often been complaints that Cumulus was lacking in that sort of data compared to other software, and it took quite a bit of work to finally provide it. But it doesn't look like anyone was interested in it after all, so I put the "daily" version on hold.
I can remember I asked for something like that your anwwer was that 365 days shouldt ask a lot of memory https://cumulus.hosiene.co.uk/viewtopic.php?f=20&t=7348

User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: This day last year page

Post by steve »

nitrx wrote:I can remember I asked for something like that your anwwer was that 365 days shouldt ask a lot of memory https://cumulus.hosiene.co.uk/viewtopic.php?f=20&t=7348
That's not the same thing. I'm not talking about giving all of the 'current' values back over a 365 day period, I'm talking about the daily highs and lows etc. One set of data for each day.
Steve

User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: This day last year page

Post by nitrx »

steve wrote:That's not the same thing. I'm not talking about giving all of the 'current' values back over a 365 day period, I'm talking about the daily highs and lows etc. One set of data for each day.
Aha sorry, so we can't see a feature like you mentioned ?

User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: This day last year page

Post by steve »

nitrx wrote:Aha sorry, so we can't see a feature like you mentioned ?
It's possible, yes.
Steve

User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: This day last year page

Post by nitrx »

That should be great :!:

User avatar
duke
Posts: 838
Joined: Sun 03 Jul 2011 6:23 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 - 64 bit
Location: Eastleigh, Hampshire, UK
Contact:

Re: This day last year page

Post by duke »

steve wrote:
nitrx wrote:Aha sorry, so we can't see a feature like you mentioned ?
It's possible, yes.
I don't know how Steve ever gets the time for all he does. Are the days longer up there :P .
Last edited by duke on Sun 01 Jul 2012 11:11 am, edited 1 time in total.
Duke

Nightingale Weather
Eastleigh, Hampshire, UK
------------------------------------------------------
Validate your pages - often!

User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: This day last year page

Post by nitrx »

Today (sunday july 1st) 1 second longer :D

Hillbilly
Posts: 112
Joined: Tue 26 Jan 2010 8:54 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Vista Home Premium SP2
Location: Mayenne, Pays De La Loire, France
Contact:

Re: This day last year page

Post by Hillbilly »

Hi
Anyway, to answer your question, here is a typical example I like from Helens website: http://www.lalocherie.com/weather/todayprevyears.php
Glad you like the page.
I suspect Helen is using an SQL database made from the contents of dayfile.txt.
- Steve is dead right that is exactly what I set up using an SQL database as set up by DAJ http://wiki.sandaysoft.com/a/ImportCumulusFile This was very clearly set out and apart from a minor headache trying to get my own brain round it I cannot fault David's clear instructions.

Following that I had to try and contrive a bit of SQL to get the data out again. But I had no idea how to do it, so after some research, have ended up with MYSQL code that works and provides the desired results for display on a PHP page. So to make this work, you need to be using/be able to use PHP on your website.

I have attached the relevant query, but have to declare up front that I make no claims about the efficiency of the code (indeed I am absolutely sure that the coding experts on the forum would shudder at the sight of it ;) ) or whether I have used the correct commands. I am happy to learn how to improve this if anyone has any better methods. All I can say is it does the job...

But of course if Steve were to develop the web tags he mentions
One of the things I was going to add was a set of web tags with daily stats (the sort of stuff that goes into dayfile.txt)
this would make life much easier for everyone. I too have no idea how Steve finds time to produce what he does already but I am sure such web tags would provide a real benefit to many people :D

To provide data for two years ago I replace INTERVAL 1 YEAR with INTERVAL 2 YEAR
I use the php variables created at the required points on the PHP page. The method for connecting to the database is taken directly from David's SQL guidance on displaying the dayfile data on a History page.

Hope this helps.

Edited to move code to text file
You do not have the required permissions to view the files attached to this post.
Last edited by Hillbilly on Mon 02 Jul 2012 6:20 pm, edited 1 time in total.
Many thanks
Helen

La Locherie Weather

tobyspond
Posts: 252
Joined: Fri 24 Jun 2011 5:57 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10
Location: Lamoine, Maine, USA

Re: This day last year page

Post by tobyspond »

Helen,

Thank you for sharing. I have long admired your data rich site.

Kerry

bigmac
Posts: 159
Joined: Wed 13 May 2009 9:35 am
Weather Station: Davis Vantage Pro 2 Wireless
Operating System: Raspbian wheezy
Location: Nr Ilkley, West Yorks, UK
Contact:

Re: This day last year page

Post by bigmac »

This is excellent Helen, many thanks.
I had cobbled together a simple SQL query and even managed to get a number outputted that was correct, but it was based on hard coding a particular date in. The bit you've included about the day and year query helps enourmously.

Like you I have used David's excellent instructions and have now started trying to learn the SQL side of things to get the data I want, let's just say it has been a steep and frustrating learning curve, but your post has given me renewed vigour!

Coupled with what I have already learnt, your SQL query makes a lot more sense about how I achieve things.

Hopefully I can return the favour to others one day.

Cheers again.

Hillbilly
Posts: 112
Joined: Tue 26 Jan 2010 8:54 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Vista Home Premium SP2
Location: Mayenne, Pays De La Loire, France
Contact:

Re: This day last year page

Post by Hillbilly »

Kerry, thanks for the kind words.

Bigmac, pleased you have already set up your database and glad to be of assistance in helping you move to the next stage. Good luck, have fun. 8-)
Many thanks
Helen

La Locherie Weather

Post Reply