$ws['rainYear'] = wsConvertRainfall($wx['rainYear'], $from); $ws['rainDayMnth'] = $wx['rainDayMnth'] * 1.0; $ws['rainDayYear'] = $wx['rainDayYear'] * 1.0; $ws['rainDaysWithNo'] = $wx['rainDaysWithNo'] * 1.0; # ------------------------------------------ EVAPOTRANSPIRATION -------- $ws['etToday'] = wsConvertRainfall($wx['etToday'], $from); $ws['etYday'] = wsConvertRainfall($wx['etYday'], $fromYday); # ------------------------------------------ wind --------------------- $from = trim(strtolower($wx['fromwind'])); // =' km/h', =' kts', =' m/s', =' mph' $fromYday = $wx['fromwindYday']; $ws['windAct'] = wsConvertWindspeed($wx['windAct'], $from); $ws['windActDsc'] = $wx['windActDsc']; $ws['windActDir'] = $wx['windActDir']; $ws['windAvgDir'] = $wx['windAvgDir']; $ws['windBeafort'] = wsBeaufortNumber($wx['windAct'], $from); $ws['gustAct'] = wsConvertWindspeed($wx['gustAct'], $from); $ws['gustMaxToday'] = wsConvertWindspeed($wx['gustMaxToday'], $from); $ws['gustMaxTodayTime'] = wview_time($wx['gustMaxTodayTime']); $ws['gustMaxYday'] = wsConvertWindspeed($wx['gustMaxYday'], $fromYday); $ws['gustMaxYdayTime'] = $wx['gustMaxYdayTime']; $ws['gustMaxMonth'] = wsConvertWindspeed($wx['gustMaxMonth'], $from); $ws['gustMaxMonthTime'] = wview_ymd($wx['gustMaxMonthTime']); $ws['gustMaxYear'] = wsConvertWindspeed($wx['gustMaxYear'], $from); $ws['gustMaxYearTime'] = wview_ymd($wx['gustMaxYearTime']); $ws['gustMaxAll'] = wsConvertWindspeed($wx['gustMaxAll'], $from); $ws['gustMaxAllTime'] = wview_ymd($wx['gustMaxAllTime']); if ($ws['gustAct'] < $ws['windAct']) { $ws['gustAct'] = $ws['windAct']; } # ------------------------------------------ UV ---------------------
function myWind($array = '') { global $SITE, $windIcons, $windlimit; if (!is_array($array)) { return '<td>' . langtransstr('Wind') . '</td>'; } $windspeed = $array['windSpeed']; $windDir = trim($array['windDir']); $windBftNr = wsBeaufortNumber($windspeed, $SITE['uomWind']); $windBftText = wsBeaufortText($windBftNr); $windBftColor = wsBeaufortColor($windBftNr); if (is_numeric($windDir)) { $windDir = wsConvertWinddir($windDir); } $windTekst = '<span style="margin: 0 0 5px 0; width: 100%; font-size: 90%; background-color: ' . $windBftColor . ';">' . round($windspeed) . $SITE['uomWind']; if ($windBftNr >= $windlimit) { $windTekst = '<span style="border: solid 1px; color: black; background-color: ' . $windBftColor . ';"> ' . langtransstr($windBftText) . ' </span><br />' . $windTekst; } $windTekst .= '</span></td>'; $return = '<td style="min-width: 60px;"><img style="height: 32px; width: 32px;" src="' . $windIcons . $windDir . '.png" alt=""/><br />' . $windTekst; # $tip = '<td style="text-align: right;">'.langtransstr('Wind').': </td><td>'.langtransstr($windDir).' '.round($windspeed).$SITE['uomWind'].'</td>'; $tip = '<td style="text-align: right;">' . langtransstr('Wind') . ': </td><td>' . langtransstr($windDir) . '<br />' . langtransstr($windBftText) . '-' . round($windspeed) . $SITE['uomWind'] . '</td>'; return array($return, $tip); }
// <et_day>0.007</et_day> $ws['etMonth'] = wsConvertRainfall((string) $xml->et_month, $from); // <et_month>0.46</et_month> $ws['etYear'] = wsConvertRainfall((string) $xml->et_year, $from); // <et_year>22.55</et_year> # ------------------------------------------ wind --------------------- $to = $SITE['uomWind']; $from = 'mph'; $ws['windActDeg'] = (string) $davis->wind_degrees; // <wind_degrees>184</wind_degrees> $ws['windAvgDir'] = $ws['windActDir'] = $ws['windActDeg']; #$ws['windActDsc'] = (string) $davis -> wind_dir; // <wind_dir>South</wind_dir> $ws['windActDsc'] = wsConvertWinddir($ws['windActDeg']); $ws['windAct'] = wsConvertWindspeed((string) $xml->wind_ten_min_avg_mph, $from); // <wind_ten_min_avg_mph>1</wind_ten_min_avg_mph> $ws['windBeafort'] = wsBeaufortNumber((string) $xml->wind_ten_min_avg_mph, $from); #$ws['gustAct'] = wsConvertWindspeed((string)$xml->wind_kt, 'kts'); // <wind_kt>1</wind_kt> $ws['gustAct'] = wsConvertWindspeed((string) $xml->wind_mph, $from); // <wind_mph>1</wind_mph> $ws['gustMaxToday'] = wsConvertWindspeed((string) $xml->wind_day_high_mph, $from); // <wind_day_high_mph>9</wind_day_high_mph> $ws['gustMaxMonth'] = wsConvertWindspeed((string) $xml->wind_month_high_mph, $from); // <wind_month_high_mph>22</wind_month_high_mph> $ws['gustMaxYear'] = wsConvertWindspeed((string) $xml->wind_year_high_mph, $from); // <wind_year_high_mph>27</wind_year_high_mph> $ws['gustMaxTodayTime'] = wdDate((string) $xml->relative_humidity_in_day_high_time); // <wind_day_high_time>12:38am</wind_day_high_time> if ($ws['gustAct'] <= $ws['windAct']) { $ws['gustAct'] = $ws['windAct']; } # ------------------------------------------ UV ---------------------
$conditionicon = '<img class="colImgCCN" src="' . $ccnIconUrl . '" alt="' . $condDescAlt . '" title="' . $condDescAlt . '"/>'; $conditioniconM = '<img class="colimg" src="' . $ccnIconUrl . '" alt="' . $condDescAlt . '" title="' . $condDescAlt . '" style ="width: 26px; height: 26px;"/>'; $string1 .= "\r\najaxVars['ajaxconditionicon'] = '" . $conditionicon . "';\r\najaxVars['ajaxconditioniconMobi'] = '" . $conditioniconM . "';\r\najaxVars['ajaxcurrentcond'] = '" . $condDesc . "';\r\najaxVars['ajaxcurrentcondalt'] = '" . $condDescAlt . "';"; # --------------------------- Rain items $unit = ' ' . langtransstr(trim($uomRain)); $decPrecip = $SITE['decPrecip']; $string1 .= "\r\najaxVars['ajaxrain'] = '" . wsNumber($ws['rainToday'], $decPrecip) . $unit . "';\r\najaxVars['ajaxrainNoU'] = '" . wsNumber($ws['rainToday'], $decPrecip) . "';\r\najaxVars['ajaxrainrateNoU'] = '" . wsNumber($ws['rainRateAct'], $decPrecip) . "';"; if (isset($ws['rainHour'])) { $string1 .= "\r\najaxVars['ajaxrainratehrNoU'] = '" . wsNumber($ws['rainHour'], $decPrecip) . "';\t\r\najaxVars['ajaxrainratehr'] = '" . wsNumber($ws['rainHour'], $decPrecip) . $unit . "';"; } else { $string1 .= "\r\najaxVars['ajaxrainratehrNoU'] = '" . wsNumber($ws['rainRateAct'], $decPrecip) . "';\t\r\najaxVars['ajaxrainratehr'] = '" . wsNumber($ws['rainRateAct'], $decPrecip) . $unit . "';"; } $string1 .= "\r\najaxVars['ajaxrainmo'] = '" . wsNumber($ws['rainMonth'], $decPrecip) . $unit . "';\r\najaxVars['ajaxrainyr'] = '" . wsNumber($ws['rainYear'], $decPrecip) . $unit . "';"; # --------------------------- wind items if ($ws['windBeafort'] == '') { $ws['windBeafort'] = wsBeaufortNumber($ws['windAct'], $SITE['uomWind']); } $beaufortText = langtransstr(wsBeaufortText($ws['windBeafort'])); $convertText = $beaufortText; if ($ws['windAct'] + $ws['gustAct'] < 0.1 || $ws['windActDsc'] == '---') { $wrDsc = 'calm'; // use calm $wrtext = $convertText; } else { $wrDsc = $ws['windActDsc']; $wrtext = langtransstr('Wind from') . " " . langtransstr($ws['windActDsc']); } $wr1 = $SITE['imgAjaxDir'] . 'wr-' . $SITE['lang'] . '-' . $wrDsc . '.png'; $wr2 = $SITE['imgAjaxDir'] . 'wind-' . $wrDsc . '.gif'; $text1 = '<img class="colImgWind" src="' . $wr1 . '" title="' . $wrtext . '" alt="' . $wrtext . '"/>'; $text2 = '<img src="' . $wr2 . '" style="height: 14px; width: 14px;" title="' . $wrtext . '" alt="' . $wrtext . '"/>';
function load_realtime_file($realtime_all, &$error_display) { global $SITE, $ws, $wsDebug, $fileTimeUpload; # if ($SITE['realtime'] != 'none') { if (!isset($SITE['realtime_file'])) { $error_display = 'realtime = ' . $SITE['realtime'] . ' but: no realtime-file specified. '; ws_message($realtime_all . '(' . __LINE__ . '): ' . $error_display . '- continue -->'); return; } if (!is_file($SITE['realtime_file'])) { $error_display = 'realtime = ' . $SITE['realtime'] . ' but: no ' . $SITE['realtime_file'] . ' found. '; ws_message($realtime_all . '(' . __LINE__ . '): ' . $error_display . '- continue -->'); return; } if (isset($SITE['realtime_file2']) && !is_file($SITE['realtime_file2'])) { $error_display = 'realtime file 2 = ' . $SITE['realtime_file2'] . ' but: no ' . $SITE['realtime_file2'] . ' found. '; ws_message($realtime_all . '(' . __LINE__ . '): ' . $error_display . '- continue -->'); } } ws_message($realtime_all . '(' . __LINE__ . '): ' . $SITE['realtime_file'] . ' try to load. -->'); $string = file_get_contents($SITE['realtime_file']); $filetime = filemtime($SITE['realtime_file']); if (isset($fileTimeUpload)) { if (30 + $filetime < $fileTimeUpload) { ws_message($realtime_all . '(' . __LINE__ . '): realtime file to old Tagfile = ' . $fileTimeUpload . ' realtimefile = ' . $filetime . ' -->'); return; } } # switch ($SITE['realtime']) { case 'wflash': $pos = strpos(substr($string, 0, 10), 'F='); if (!$pos === false) { $string = substr($string, $pos + 2); } $arr_rt = explode(",", $string); $fromTemp = 'F'; // ='°C', ='°F' $fromWind = 'mPh'; // =' km/h', =' kts', =' m/s', =' mph' $fromRain = 'in'; // =' mm', =' in' $fromBaro = 'inHg'; // =' hPa', =' mb', =' inHg' # $ws['rtTime'] = wdDate(trim($arr_rt[1])); $ws['tempAct'] = (string) wsConvertTemperature($arr_rt[9], $fromTemp); $ws['tempActInside'] = (string) wsConvertTemperature($arr_rt[8], $fromTemp); # $ws['tempDelta'] = (string)wsConvertTemperature($arr_rt[37], $fromTemp); $temp1hourAgo = (string) wsConvertTemperature($arr_rt[9], $fromTemp, $fromTemp) - (string) wsConvertTemperature($arr_rt[37], $fromTemp, $fromTemp); $ws['tempDelta'] = $ws['tempAct'] - wsConvertTemperature($temp1hourAgo, $fromTemp); $ws['dewpAct'] = (string) wsConvertTemperature($arr_rt[24], $fromTemp); $ws['appTemp'] = (string) wsConvertTemperature($arr_rt[29], $fromTemp); # ?? $ws['chilAct'] = (string) wsConvertTemperature($arr_rt[21], $fromTemp); $ws['heatAct'] = (string) wsConvertTemperature($arr_rt[23], $fromTemp); $ws['windAct'] = (string) wsConvertWindspeed($arr_rt[4], $fromWind); $ws['windActDir'] = 1.0 * $arr_rt[3]; $ws['gustAct'] = (string) wsConvertWindspeed($arr_rt[5], $fromWind); $ws['windBeafort'] = (string) wsBeaufortNumber($ws['windAct'], $SITE['uomWind']); $ws['windActDir'] = (string) round($arr_rt[3]); $ws['baroAct'] = (string) wsConvertBaro($arr_rt[25], $fromBaro); $ws['baroDelta'] = (string) wsConvertBaro($arr_rt[53], $fromBaro); $ws['humiAct'] = (string) round($arr_rt[7]); $ws['humiInAct'] = (string) round($arr_rt[6]); $ws['uvAct'] = (string) round($arr_rt[19], 1); # $ws['uvMaxToday'] = (string)round($arr_rt[46],1); $ws['solarAct'] = (string) round($arr_rt[20], 1); # process wflash2.txt if (isset($SITE['realtime_file2'])) { ws_message($realtime_all . '(' . __LINE__ . '): ' . $SITE['realtime_file2'] . ' try to load. -->'); $string = file_get_contents($SITE['realtime_file2']); $pos = strpos(substr($string, 0, 10), 'S='); if (!$pos === false) { $string = substr($string, 9); } $arr_rt = explode(",", substr($string, 2)); $rtdate = wdDate(trim($arr_rt[0])); if ($rtdate > $ws['rtTime']) { $ws['rtTime'] = $rtdate; } $ws['tempMinToday'] = (string) wsConvertTemperature($arr_rt[92], $fromTemp); $ws['tempMaxToday'] = (string) wsConvertTemperature($arr_rt[36], $fromTemp); $ws['dewpMinToday'] = (string) wsConvertTemperature($arr_rt[107], $fromTemp); $ws['dewpMaxToday'] = (string) wsConvertTemperature($arr_rt[51], $fromTemp); $ws['chilMinToday'] = (string) wsConvertTemperature($arr_rt[104], $fromTemp); $ws['heatMaxToday'] = (string) wsConvertTemperature($arr_rt[50], $fromTemp); $ws['gustMaxToday'] = (string) wsConvertWindspeed($arr_rt[32], $fromWind); $ws['windAvgDir'] = (string) $arr_rt[2]; $ws['baroMinToday'] = (string) wsConvertBaro($arr_rt[108], $fromBaro); $ws['baroMaxToday'] = (string) wsConvertBaro($arr_rt[52], $fromBaro); $ws['rainToday'] = (string) wsConvertRainfall($arr_rt[254], $fromRain); $ws['rainRateAct'] = (string) wsConvertRainfall($arr_rt[257], $fromRain); $ws['rainRateToday'] = (string) wsConvertRainfall($arr_rt[150], $fromRain); $ws['humiMinToday'] = (string) round($arr_rt[90]); $ws['humiMaxToday'] = (string) round($arr_rt[34]); $ws['windAvgDir'] = (string) round($arr_rt[2]); $ws['solarMaxToday'] = (string) $arr_rt[47]; $ws['uvMaxToday'] = (string) round($arr_rt[46], 1); } // eo realtimefile 2 break; case 'json': $oldDegree = iconv('UTF-8', 'windows-1252//TRANSLIT', '°'); // clean for nonjson characters $from = array('°', '°', $oldDegree); $string = str_replace($from, '', $string); # if ($SITE['WXsoftware'] == 'WC') { // uses decimal , no point $string = str_replace(',', '.', $string); $string = str_replace('|', ',', $string); } $arr_rt = json_decode($string, true); $fromTemp = str_replace('°', '', $arr_rt['tempunit']); $fromWind = $arr_rt['windunit']; $fromRain = $arr_rt['rainunit']; $fromBaro = $arr_rt['pressunit']; $ws['rtTime'] = wdDate($arr_rt['date']); $ws['tempAct'] = (string) wsConvertTemperature($arr_rt['temp'], $fromTemp); // "temp":"4,6", $ws['tempActInside'] = (string) wsConvertTemperature($arr_rt['intemp'], $fromTemp); // "intemp":"18,7", $ws['dewpAct'] = (string) wsConvertTemperature($arr_rt['dew'], $fromTemp); // "dew":"3,3", $ws['appTemp'] = (string) wsConvertTemperature($arr_rt['apptemp'], $fromTemp); $ws['chilAct'] = (string) wsConvertTemperature($arr_rt['wchill'], $fromTemp); $ws['windAct'] = (string) wsConvertWindspeed($arr_rt['wlatest'], $fromWind); $ws['windBeafort'] = (string) wsBeaufortNumber($ws['windAct'], $SITE['uomWind']); $ws['gustAct'] = (string) wsConvertWindspeed($arr_rt['wgust'], $fromWind); $ws['windActDir'] = (string) $arr_rt['bearing']; $ws['windAvgDir'] = (string) $arr_rt['avgbearing']; $ws['baroAct'] = (string) wsConvertBaro($arr_rt['press'], $fromBaro); $ws['rainToday'] = (string) wsConvertRainfall($arr_rt['rfall'], $fromRain); $ws['rainRateAct'] = (string) wsConvertRainfall($arr_rt['rrate'], $fromRain); $ws['humiAct'] = (string) $arr_rt['hum']; $ws['humiInAct'] = (string) $arr_rt['inhum']; $ws['uvAct'] = (string) $arr_rt['UV']; if ($ws['uvAct'] > $ws['uvMaxToday']) { $ws['uvMaxToday'] = $ws['uvAct']; } $ws['solarAct'] = (string) $arr_rt['SolarRad']; if ($ws['solarAct'] > $ws['solarMaxToday']) { $ws['solarMaxToday'] = $ws['solarAct']; } break; case 'cltrw': $oldDegree = iconv('UTF-8', 'windows-1252//TRANSLIT', '°'); $from = array('°', '°', $oldDegree); $string = trim(str_replace($from, '', $string)); $string = preg_replace("/[\r\n]+[\\s\t]*[\r\n]+/", "\n", $string); $arr_rt = explode(" ", $string); if ($arr_rt[0] != '12345') { $errorfile = substr($string, 0, 20); ws_message($realtime_all . '(' . __LINE__ . '): This file (' . $SITE['realtime_file'] . ') seems not to be a ' . $SITE['realtime'] . ' type file ' . $errorfile . ' -->'); return; } $fromTemp = 'c'; $fromWind = 'kts'; $fromRain = 'mm'; $fromBaro = 'hpa'; $arr = explode('-', $arr_rt['32']); $last = count($arr) - 1; $time = trim(str_replace('_', ' ', $arr[$last])); $ws['rtTime'] = wdDate($time); $ws['tempAct'] = (string) wsConvertTemperature($arr_rt['4'], $fromTemp); $ws['tempActInside'] = (string) wsConvertTemperature($arr_rt['12'], $fromTemp); $ws['dewpAct'] = (string) wsConvertTemperature($arr_rt['72'], $fromTemp); $ws['appTemp'] = (string) wsConvertTemperature($arr_rt['130'], $fromTemp); $ws['chilAct'] = (string) wsConvertTemperature($arr_rt['44'], $fromTemp); $ws['windAct'] = (string) wsConvertWindspeed($arr_rt['1'], $fromWind); $ws['windBeafort'] = (string) wsBeaufortNumber($ws['windAct'], $SITE['uomWind']); $ws['gustAct'] = (string) wsConvertWindspeed($arr_rt['2'], $fromWind); $ws['windActDir'] = (string) $arr_rt['3']; $ws['windAvgDir'] = (string) $arr_rt['117']; $ws['baroAct'] = (string) wsConvertBaro($arr_rt['6'], $fromBaro); $ws['rainToday'] = (string) wsConvertRainfall($arr_rt['7'], $fromRain); $ws['rainRateAct'] = (string) wsConvertRainfall($arr_rt['10'], $fromRain); $ws['humiAct'] = (string) $arr_rt['5']; $ws['uvAct'] = (string) $arr_rt['79']; $ws['solarAct'] = (string) $arr_rt['127']; break; case 'http': $pos = strpos(substr($string, 0, 20), '|', 0); if (!$pos) { $split_char = ','; } else { $split_char = '|'; } $arr_rt = explode($split_char, $string); # $arr_rt[nr] # 0 1 2 3 4 5 6 7 8 9 # [hh]:[mm],[th0temp-act],[th0temp-dmin],[th0temp-dmax],[thb0temp-act],[th0dew-act],[th0dew-dmin],[th0dew-dmax],[wind0chill-act],[wind0chill-dmin], # 10 11 12 13 14 15 16 17 18 19 # [wind0wind-act],[wind0avgwind-act],[wind0wind-max10],[wind0wind-dmax],[wind0dir-act],[wind0dir-avg10:--],[thb0seapress-act],[thb0seapress-dmin],[thb0seapress-dmax],[thb0seapress-ymin], # 20 21 22 23 24 25 26 27 28 29 # [thb0seapress-ymax],[rain0total-daysum],[rain0rate-act],[rain0rate-dmax],[th0hum-act],[th0hum-dmin],[th0hum-dmax],[thb0hum-act],[th0temp-val60:--],[th0temp-dmintime], # 30 31 32 33 34 35 36 37 38 39 # [th0temp-dmaxtime],[th0dew-dmintime],[th0dew-dmaxtime],[wind0chill-dmin],[rain0rate-dmaxtime],[th0hum-dmintime],[th0hum-dmaxtime],[thb0seapress-dmintime],[thb0seapress-dmaxtime],[thb0seapress-val60:--], # 40 41 42 43 44 45 46 47 48 49 # [wind0wind-act=bft.0],[wind0wind-dmaxtime],[wind0avgwind-dmax],[uv0index-act:--],[sol0rad-act:--],[sol0rad-hmax:--],[sol0rad-dmax:--],[mbsystem-swversion],[mbsystem-buildnum],[YYYY]:[MM]:[DD]:[Uhh]:[Umm]:[Uss] # 50 #[forecast-text] $ws['rtTime'] = wdDate(trim($arr_rt['0'])); $ws['tempAct'] = (string) wsConvertTemperature($arr_rt[1], 'c'); $ws['dewpAct'] = (string) wsConvertTemperature($arr_rt[5], 'c'); $ws['chilAct'] = (string) wsConvertTemperature($arr_rt[8], 'c'); $ws['chilMinToday'] = (string) wsConvertTemperature($arr_rt[9], 'c'); $ws['windAct'] = (string) wsConvertWindspeed($arr_rt[11], 'm/s'); $ws['windBeafort'] = (string) wsBeaufortNumber($ws['windAct'], $SITE['uomWind']); $ws['gustAct'] = (string) wsConvertWindspeed($arr_rt[12], 'm/s'); $ws['windActDir'] = (string) $arr_rt[14]; $ws['windAvgDir'] = (string) $arr_rt[15]; $ws['baroAct'] = (string) wsConvertBaro($arr_rt[16], 'hpa'); $ws['rainToday'] = (string) wsConvertRainfall($arr_rt[21], 'mm'); $ws['rainRateAct'] = (string) wsConvertRainfall($arr_rt[22], 'mm'); $ws['humiAct'] = (string) $arr_rt[24]; $ws['humiInAct'] = (string) $arr_rt[27]; $ws['uvAct'] = (string) $arr_rt[43]; $ws['solarAct'] = (string) $arr_rt[44]; break; case 'weatherlink': #echo $string; exit; $arr = explode("\n", $string); # var_dump ($arr); exit; $end = count($arr); for ($n = 0; $n < $end; $n++) { $line = trim($arr[$n]); if ($line == '') { continue; } $substr = substr($line, 1, 5); if ($substr == '-----') { continue; } if (substr($line, 0, 1) != '|') { continue; } list($skip, $name, $content) = explode('|', $line . '|'); $name = trim($name); $content = trim($content); # if ($content == '' ) {ws_message ( $startEcho.$tagsScript.'('.__LINE__.'):empty line '.$n.' name '.$name .$endEcho.PHP_EOL;continue; } $arr_rt[$name] = $content; } # var_dump ($arr_rt); exit; $oldDegree = iconv('UTF-8', 'windows-1252//TRANSLIT', '°'); $from = array('°', '°', $oldDegree); $arr_rt['tempunit'] = str_replace($from, '', $arr_rt['tempunit']); $arr_rt['windunit'] = str_replace('r', '', $arr_rt['windunit']); $fromTemp = $arr_rt['tempunit']; $fromWind = $arr_rt['windunit']; $fromRain = $arr_rt['rainunit']; $fromBaro = $arr_rt['pressunit']; $ws['rtTime'] = wdDate($arr_rt['date']); $ws['rtVersion'] = $arr_rt['rtVersion']; $ws['tempAct'] = (string) wsConvertTemperature($arr_rt['temp'], $fromTemp); // "temp":"4,6", $ws['tempActInside'] = (string) wsConvertTemperature($arr_rt['intemp'], $fromTemp); // "intemp":"18,7", $ws['dewpAct'] = (string) wsConvertTemperature($arr_rt['dew'], $fromTemp); // "dew":"3,3", $ws['chilAct'] = (string) wsConvertTemperature($arr_rt['wchill'], $fromTemp); $ws['windAct'] = (string) wsConvertWindspeed($arr_rt['wlatest'], $fromWind); $ws['windBeafort'] = (string) wsBeaufortNumber($ws['windAct'], $SITE['uomWind']); $ws['gustAct'] = (string) wsConvertWindspeed($arr_rt['wgust'], $fromWind); $ws['windActDir'] = (string) $arr_rt['bearing']; $ws['windAvgDir'] = (string) $arr_rt['avgbearing']; $ws['baroAct'] = (string) wsConvertBaro($arr_rt['press'], $fromBaro); $ws['rainToday'] = (string) wsConvertRainfall($arr_rt['rfall'], $fromRain); $ws['rainRateAct'] = (string) wsConvertRainfall($arr_rt['rrate'], $fromRain); $ws['humiAct'] = (string) $arr_rt['hum']; $ws['uvAct'] = (string) $arr_rt['UV']; if ($ws['uvAct'] > $ws['uvMaxToday']) { $ws['uvMaxToday'] = $ws['uvAct']; } $ws['solarAct'] = (string) $arr_rt['SolarRad']; if ($ws['solarAct'] > $ws['solarMaxToday']) { $ws['solarMaxToday'] = $ws['solarAct']; } break; default: ws_message($realtime_all . '(' . __LINE__ . '): unknown realtime type ' . $SITE['realtime'] . ' found -->'); } }