Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.9.5 (build 3100) - 14 January 2021 (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).

Sun Plot

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

Moderator: daj

User avatar
laulau
Posts: 640
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Sun Plot

Post by laulau »

mcrossley wrote:
Any interest in me releasing this script?
YES! :D
Laurent

Image

f4phlyer
Posts: 45
Joined: Sun 13 Feb 2011 7:12 pm
Weather Station: Davis Vantage Pro 2
Operating System: RaspBerry Pi Win 10 OSx
Location: Spring, Texas USA
Contact:

Re: Sun Plot

Post by f4phlyer »

That would be simply delightful!
Steve
retreat at augusta pines weather
CumulusMX on Raspberry π 3
http://augusta-pines-weather.com / Cumulus 3.9.2 beta1 (build: b3097)
WeatherUnderground KTXSPRIN538

User avatar
beteljuice
Posts: 3100
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Sun Plot

Post by beteljuice »

Mark, your suggestions and scripts are ALWAYS well received :P
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
mcrossley
Posts: 7516
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

beteljuice wrote:Mark, your suggestions and scripts are ALWAYS well received :P
:oops: Not sure about that, some are more trouble than they are worth! :lol:

Anyway, I've put a new page on my site to start collecting some of these scripts together. The sunplot should now be downloadable from there (if I've got the .htaccess file right!).
http://weather.wilmslowastro.com/scripts.php

Mapantz
Posts: 902
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64
Location: Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz »

Does the sunshine have to come from the realtime sql upload, or can the monthly one be used?

Edit: I see 'IsSunny' in the file, so I guess that is in the realtime?!

I don't upload that at the moment, but I will do it now. I'm not sure about the retention string bit - after reading a post by Steve, I see it is optional?
Image

User avatar
mcrossley
Posts: 7516
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

Sunshine has to come from a real time table, you need the minute by minute state, the daily value is just the total hours for the day and isn't created until midnight (or 9am).

The plot will work without the sunshine data though.

User avatar
jdc
Posts: 142
Joined: Tue 19 Jun 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10
Location: Portsoy,.
Contact:

Re: Sun Plot

Post by jdc »

Another very clever & useful script, Mark. ;)

Mapantz
Posts: 902
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64
Location: Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz »

I've got it up and running without the sunshine enabled. :D

It seems my server doesn't like 'Europe/London' in the timezone setting when dealing with sql, it comes up with an error. I tried +00:00 and +01:00 but it makes the plot go a bit strange.
Image

User avatar
mcrossley
Posts: 7516
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

Sounds like your MySQL instance doesn't have the time zone information imported.

http://dev.mysql.com/doc/refman/5.7/en/ ... o-sql.html

User avatar
mcrossley
Posts: 7516
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

jdc wrote:Another very clever & useful script, Mark. ;)
Thanks John.

Mapantz
Posts: 902
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64
Location: Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz »

I'm also one of those who can import the timezones, due to restrictions. :?

I did this instead: $tz = '+1:00';

I don't know if this is making the graphs odd, or whether it is correct?

http://www.warehamwx.co.uk/cumulus/sunplot.php
Image

User avatar
mcrossley
Posts: 7516
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

Try just commenting out the setting of the time zone in MySQL

Mapantz
Posts: 902
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64
Location: Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz »

I've got that solved. I sent a ticket explaining that I'm unable to load the timezones myself, and they have done it for me!

Now that's working, I need to add a retention string to CMX, so that it deletes the realtime data every 24hrs, otherwise it'll just fill up too quickly.

I though this would work: DELETE * FROM Realtime WHERE LogDateTime >= now() + INTERVAL 1 DAY;

I get an error though..
Image

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: Sun Plot

Post by steve »

Are you using the standard realtime.txt MySQL update? If so, you just need to specify the interval - see the announcement for build 3025 where I give some examples.
Steve

Mapantz
Posts: 902
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64
Location: Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz »

steve wrote:Are you using the standard realtime.txt MySQL update? If so, you just need to specify the interval - see the announcement for build 3025 where I give some examples.
Ah bingo! Thank you Steve!
I tested it at 1 minute, and it did the job! I should've realised that, there was me trying to add in full syntax :oops:

So if I make it delete the table every 24 hours, will it be from time I click save in CMX?
Image

Post Reply