Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

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 drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Station Status question

Discussion of Ken True's web site templates

Moderator: saratogaWX

User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Station Status question

Post by dazza1223 »

du u mine this ken ?


// Standard checks for weather software updates
//
// check the appropriate realtime file first
if($SITE['WXsoftware'] == 'WD' and isset($SITE['clientrawfile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['clientrawfile'],15,'file');
}
if($SITE['WXsoftware'] == 'MH' and isset($SITE['clientrawFile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['clientrawFile'],60+30,'file');
}
if($SITE['WXsoftware'] == 'VWS' and isset($SITE['wflashdir'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['wflashdir'].'wflash.txt',15,'file');
}
if($SITE['WXsoftware'] == 'VWS' and isset($SITE['wflashdir'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime").' 2',$SITE['wflashdir'].'wflash2.txt',60+15,'file');
}
if($SITE['WXsoftware'] == 'CU' and isset($SITE['realtimefile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['realtimefile'],15,'file');
}
if($SITE['WXsoftware'] == 'WL' and isset($SITE['WLrealtime'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['WLrealtime'],90,'file'); // weatherlink updates at 90 second intervals
}
if($SITE['WXsoftware'] == 'WCT' and isset($SITE['WCTrealtime'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['WCTrealtime'],90,'file'); // weatherlink updates at 90 second intervals
}

// check the weather tags themselves
if($SITE['WXsoftware'] == 'WSN') { // Only WeatherSnoop does not upload the WXtags file
do_check($SITE['WXsoftwareLongName']." ".langtransstr("FTP"),'weather.json',60*5+15,'file');
} elseif ($SITE['WXsoftware'] == 'WLCOM') {
# no FTP check for WCOM
} else {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("FTP"),$SITE['WXtags'],60*5+15,'file');
}
// check the internal date of the tags file
$chkdate = fixup_date($date) . ' ' . fixup_time($time); // handle all formats to make standard
print "<!-- ".$SITE['WXtags']." internal update date time='$date $time' fixed='$chkdate' -->\n";
do_check($SITE['WXsoftwareLongName']." ".langtransstr("weather data"),strtotime($chkdate),60*5+15,'application');


// checks for optional NOAA-style report updates
if($SITE['WXsoftware'] == 'CU' and isset($WX['LatestNOAAMonthlyReport']) and
file_exists($SITE['NOAAdir'].$WX['LatestNOAAMonthlyReport'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("NOAA report"),
$SITE['NOAAdir'].$WX['LatestNOAAMonthlyReport'],24*60*60+10*60,'file');
}

if($SITE['WXsoftware'] == 'VWS' and file_exists($SITE['NOAAdir'].'noaamo.txt')) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("NOAA report"),
$SITE['NOAAdir'].'noaamo.txt',60*65+15,'file');
}

if($SITE['WXsoftware'] == 'WD' and
file_exists($SITE['HistoryFilesDir'].'dailynoaareport.htm')) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("NOAA report"),
$SITE['HistoryFilesDir'].'dailynoaareport.htm',24*60*60+15*60,'file');
}

$MYYYYfile = date('FY') . '.htm'; // generates the <Monthname><YYYY>.htm filename used by WD
if($SITE['WXsoftware'] == 'WD' and file_exists($SITE['HistoryFilesDir'].$MYYYYfile)) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("Month report"),
$SITE['HistoryFilesDir'].$MYYYYfile,24*60*60+15*60,'file');
}

if($SITE['WXsoftware'] == 'WL' and file_exists($SITE['NOAACurDir'].'NOAAMO.TXT')) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("NOAA report"),
$SITE['NOAACurDir'].'NOAAMO.TXT',60*5+15,'file');
}
if($SITE['WXsoftware'] == 'WLCOM') {
$uoms = $SITE['uomTemp'].$SITE['uomBaro'].$SITE['uomWind'].$SITE['uomRain'].
$SITE['uomSnow'].$SITE['uomDistance'].$SITE['uomPerHour'];
$from = array('/',' ','&deg;','.php');
$to = '';
$testFile = $SITE['cacheFileDir'].
str_replace ($from, $to,
'weatherlinkcom-yday-'.$SITE['WLCOMdid'].'_'.$uoms.'.txt'); // add uoms to filename


do_check($SITE['WXsoftwareLongName']." ".langtransstr("Yesterday Data").
' [ <a href="'.$SITE['cacheFileDir'].'LOG_saveYesterday.php.txt">'.langtransstr('View Log').']</a> ]',
$testFile,1440*60+15,'file');
}
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Station Status question

Post by dazza1223 »

yh i am learning bit by bit ken


am i on the right trackes

// check the appropriate realtime file first
if($SITE['WXsoftware'] == 'WD' and isset($SITE['clientrawfile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['clientrawfile'],15,'file');
}
if($SITE['WXsoftware'] == 'MH' and isset($SITE['clientrawFile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['clientrawFile'],60+30,'file');
}
if($SITE['WXsoftware'] == 'VWS' and isset($SITE['wflashdir'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['wflashdir'].'wflash.txt',15,'file');
}
if($SITE['WXsoftware'] == 'VWS' and isset($SITE['wflashdir'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime").' 2',$SITE['wflashdir'].'wflash2.txt',60+15,'file');
}
if($SITE['WXsoftware'] == 'CU' and isset($SITE['realtimefile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['realtimefile'],15,'file');
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Station Status question

Post by saratogaWX »

Ummm... posting the unmodified code from my include-wxstatus.php is not helpful. YOU will have to read, understand, and modify the code to make it work on your non-template website. As I said before, that code (unmodified) requires parts from Settings.php, Settings-weather.php (for your PWS weather software), common.php to fully operate. That is what you need to either include or replace all the $SITE['...'] variables with data regarding your PWS.

I'm not going to write the modifications for you.. it's your hobby, so you get to write it and debug it.
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Station Status question

Post by dazza1223 »

ok ken i will spend some time with it and try and do it buddy but thank u ken
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
Post Reply