Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Station Status question

Discussion of Ken True's web site templates

Moderator: saratogaWX

dazza1223
Posts: 276
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: davis vantage vue
Operating System: raspberry pi 3
Location: worthing
Contact:

Re: Station Status question

Postby dazza1223 » Sun Jan 14, 2018 11:49 pm

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');
}

dazza1223
Posts: 276
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: davis vantage vue
Operating System: raspberry pi 3
Location: worthing
Contact:

Re: Station Status question

Postby dazza1223 » Sun Jan 14, 2018 11:51 pm

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');

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

Re: Station Status question

Postby saratogaWX » Mon Jan 15, 2018 5:12 pm

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.

dazza1223
Posts: 276
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: davis vantage vue
Operating System: raspberry pi 3
Location: worthing
Contact:

Re: Station Status question

Postby dazza1223 » Mon Jan 15, 2018 5:16 pm

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


Return to “Saratoga Templates”

Who is online

Users browsing this forum: No registered users and 1 guest