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

CloudBase script for Cumulus Ver CU1.5

Discussion of Ken True's web site templates

Moderator: saratogaWX

n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: CloudBase script for Cumulus Ver CU1.5

Post by n9mfk » Sun 05 Jan 2014 11:42 pm

Hi BCJKiwi,
I noticed that daytime is be reported at night

http://99.148.153.229/weather/test3/clo ... php?html=1
beau
You do not have the required permissions to view the files attached to this post.

BCJKiwi
Posts: 873
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled with Solar
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CloudBase script for Cumulus Ver CU1.5

Post by BCJKiwi » Mon 06 Jan 2014 1:22 am

The day night info comes directly from the cloudbaseT.txt data file through the tag <#isdaylight> so if cloudbase has it wrong, then Cumulus is sending the wrong info (or the script has been changed?). So please check the Cumulus setup (and that the file is being uploaded?).

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: CloudBase script for Cumulus Ver CU1.5

Post by steve » Mon 06 Jan 2014 8:19 am

17:06 would have been before dusk (which is about 17:19 for you now) hence 'isdaylight' would correctly have been 'true'.
Steve

Mark14
Posts: 54
Joined: Thu 23 Aug 2012 8:53 pm
Weather Station: WH 2080
Operating System: Windows 7
Location: Konin, Poland

Re: CloudBase script for Cumulus Ver CU1.5

Post by Mark14 » Sat 19 Jul 2014 12:51 pm

I uploaded CloudBase script and it works fine: http://slesinpogoda.cba.pl/cloudbaseCU.php

Now I would like to replace the Outlook window with WU forecast with CloudBase script, just like here: http://silveracorn.co.nz/weather/
Could you tell me where (what file) I should change the code? Is it to add only "<img src="cloudbaseCU.php" alt="cloudbase" width="100" height="200" />"?

My website: http://slesinpogoda.cba.pl/wxindex.php All upgrades done.

n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: CloudBase script for Cumulus Ver CU1.5

Post by n9mfk » Sat 19 Jul 2014 2:17 pm

That is in ajax-dashboard.php
line 359 and 675 to 681

Beau

Mark14
Posts: 54
Joined: Thu 23 Aug 2012 8:53 pm
Weather Station: WH 2080
Operating System: Windows 7
Location: Konin, Poland

Re: CloudBase script for Cumulus Ver CU1.5

Post by Mark14 » Sun 20 Jul 2014 7:19 am

Done :) Thanks for help. You saved my time.

User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CloudBase script for Cumulus Ver CU1.5

Post by gluepack » Sat 22 Aug 2015 9:33 am

Oops! I am using MX now, so don't know if that is the problem (I thought that I had checked everything since switching) but somehow cloudbaseCU has failed due to a generated request for SH-moon43.gif that a) doesn't exist and b) it is daytime.

Text file is...
24.4 18.1 0.0 15 1010.6 68 5.0 360 755 C mm hPa km/h m 43 7 1 935 0.0 0.0
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau

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: CloudBase script for Cumulus Ver CU1.5

Post by steve » Sat 22 Aug 2015 9:59 am

There seems to be a problem with the parsing of the data file, so it's getting the wrong fields for some of the items. I don't know whether this is because of something that MX is doing differently. It looks like the script is taking your latitude (43) as the moon age, rather than the 7 following it, which is the actual moon age. Similarly, it's looking at the wrong field for 'is daylight'.
Steve

User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CloudBase script for Cumulus Ver CU1.5

Post by gluepack » Sat 22 Aug 2015 10:05 am

Looks like it gets condensed in my post but in the editor there appears to be an additional blank (or non-displayable) between m and 43
cloudbaseCU.txt
You do not have the required permissions to view the files attached to this post.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau

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: CloudBase script for Cumulus Ver CU1.5

Post by steve » Sat 22 Aug 2015 10:15 am

The code in Cumulus (1 and MX) which handles the latitude 'dp' parameter pads the field to a minimum width of dp+3, so in the case of dp=0, there's a leading space. Presumably the script expects a single space as delimiter rather than one or more spaces.
Steve

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: CloudBase script for Cumulus Ver CU1.5

Post by steve » Sat 22 Aug 2015 10:19 am

Assuming it does work OK with a file generated by Cumulus 1, then the floating point formatting routines in Delphi must work differently to those in .Net - Delphi truncates and .Net pads left with spaces.
Steve

User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CloudBase script for Cumulus Ver CU1.5

Post by gluepack » Sat 22 Aug 2015 10:22 am

Not sure what you are suggesting.

Sounds like you are saying that the same situation would have occurred with Cu1, which isn't the case.

Oh, just saw your 2nd response. So... you will do something about it?
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau

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: CloudBase script for Cumulus Ver CU1.5

Post by steve » Sat 22 Aug 2015 10:29 am

I'll have a look at it to see what I can do.
Steve

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: CloudBase script for Cumulus Ver CU1.5

Post by steve » Sat 22 Aug 2015 10:44 am

If you change this line in the script:

Code: Select all

$data = explode(' ',$file[0]);
to

Code: Select all

$data = preg_split('/\s+/',$file[0]);
it will split the string using one or more whitespace characters as delimiters.
Steve

User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CloudBase script for Cumulus Ver CU1.5

Post by gluepack » Sat 22 Aug 2015 10:54 am

Thanks for that.
I was just looking at the code and saw the $data = explode(' ',$file[0]); but was struggling to think how I could change it.
Will give it a try.

Update: Thanks, that worked great!
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau

Post Reply