Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

Sun Plot

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

Moderator: daj

User avatar
laulau
Posts: 521
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 » Thu 28 Jul 2016 1:56 pm

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

Image

f4phlyer
Posts: 30
Joined: Sun 13 Feb 2011 7:12 pm
Weather Station: Davis Vantage Pro 2
Operating System: RaspBerry Pi Win 10 OSx
Location: Gulf Breeze, Fl., USA
Contact:

Re: Sun Plot

Post by f4phlyer » Thu 28 Jul 2016 2:21 pm

That would be simply delightful!
Steve
The Squeaky Sands Inn
CumulusMX on Raspberry π 3
WeatherUnderground KFLGULFB1
http://www.squeakysands-inn.net/index.php

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Sun Plot

Post by beteljuice » Thu 28 Jul 2016 7:45 pm

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

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

Re: Sun Plot

Post by mcrossley » Fri 29 Jul 2016 4:05 pm

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

User avatar
Mapantz
Posts: 525
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz » Sat 30 Jul 2016 10:30 pm

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
Image

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

Re: Sun Plot

Post by mcrossley » Sat 30 Jul 2016 11:00 pm

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: 135
Joined: Tue 19 Jun 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10 : Win XP
Location: Berwick-upon-Tweed, England.
Contact:

Re: Sun Plot

Post by jdc » Sun 31 Jul 2016 8:39 am

Another very clever & useful script, Mark. ;)

User avatar
Mapantz
Posts: 525
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz » Sun 31 Jul 2016 11:23 am

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
Image

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

Re: Sun Plot

Post by mcrossley » Sun 31 Jul 2016 1:25 pm

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: 5234
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley » Sun 31 Jul 2016 1:28 pm

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

User avatar
Mapantz
Posts: 525
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz » Sun 31 Jul 2016 4:11 pm

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
Image

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

Re: Sun Plot

Post by mcrossley » Sun 31 Jul 2016 4:18 pm

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

User avatar
Mapantz
Posts: 525
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz » Sun 31 Jul 2016 5:55 pm

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
Image

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

Re: Sun Plot

Post by steve » Sun 31 Jul 2016 5:59 pm

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

User avatar
Mapantz
Posts: 525
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz » Sun 31 Jul 2016 6:10 pm

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
Image

Post Reply