Ajaxcurrentcond

I am trying to get the text portion to match what my testtags shows Dry and overcast. I do not have a solar sensor and I get my info from my local metar. I do have my own conditions override if rain, wind, fog. Any help would be great.

ajaxWDwx.js portion:

currentcond = clientraw[49];
		currentcond = currentcond.replace(/_/g,' ');
		currentcond = currentcond.replace(/^\/Dry\//g,'');
		currentcond = currentcond.replace(/\\/g,', ');
		currentcond = currentcond.replace(/\//g,', ');
		set_ajax_obs("ajaxcurrentcond",currentcond);

ajaxdashboard portion:

<tr>
	              <td align="center" colspan="2" class="data1" style="text-align: center;border: none">
			  <span class="ajax" id="ajaxcurrentcond">
			  <?php echo $current_summary; ?></span>


$iconnumber = "18";                // icon number

testtags portion before being parsed:

$current_icon = $icon_array[%iconnumber%]; // name of our condition icon
// ----------------------------------------------------------------------------------
//   $current_summary = '%weathercond%' . "
" . '%Currentsolardescription% ';
   $weathercond = '%weathercond%';
   $Currentsolardescription = '%Currentsolardescription% ';
   $current_summary = $Currentsolardescription;
   $current_summary = preg_replace('|^/[^/]+/|','',$current_summary);
   $current_summary = preg_replace('|\\\\|',", ",$current_summary);
   $current_summary = preg_replace('|/|',", ",$current_summary);

testtags portion after being parsed by WD:

$current_icon = $icon_array[18]; // name of our condition icon
// ----------------------------------------------------------------------------------
//   $current_summary = 'Dry' . "
" . 'overcast_ ';
   $weathercond = 'Dry';
   $Currentsolardescription = 'overcast_ ';
   $current_summary = $Currentsolardescription;
   $current_summary = preg_replace('|^/[^/]+/|','',$current_summary);
   $current_summary = preg_replace('|\\\\|',", ",$current_summary);
   $current_summary = preg_replace('|/|',", ",$current_summary);

Chuck

Edit: Also the text does not change when my station overrides the metar for wind, rain, fog.

Chuck,

Both the testtags.php and clientraw.txt just report (with a little duplicate removal if needed) what WD is saying the text description of the weather currently is. It’s determined by the (many) panels for setup and can’t be changed by PHP or JavaScript to report things that WD itself isn’t reporting.

Here are my Solar settings (use Solar during the day, Metar by night).

and my Metar setup

I find these settings are working for me. (I do have a Solar sensor, so since you don’t have one, ignore the Solar setup)

Hope this helps!

Best regards,
Ken

Should the word Dry show up. Ken the one problem I had was when it started raining or gets windy my icon changes but the text does not change. I could be wrong but I remember it used to work where the text changed with the conditions changed by my station.

Chuck

Edit: Here’s what my testtags show now but my text has not changed

$current_icon = $icon_array[18]; // name of our condition icon
// ----------------------------------------------------------------------------------
// $current_summary = ‘Dry’ . "
" . ‘Overcast and gloomy/Dry’;
$weathercond = ‘Dry’;
$Currentsolardescription = 'Overcast and gloomy/Dry ';

I just seen my main page refresh and I seen Overcast and gloomy/Dry just for a second and then Overcast comes up and stays.

Here is what I have for my testtags.txt:

$current_icon = $icon_array[%iconnumber%]; // name of our condition icon
// ----------------------------------------------------------------------------------
// $current_summary = ‘%weathercond%’ . "
" . ‘%Currentsolardescription%’;
$weathercond = ‘%weathercond%’;
$Currentsolardescription = '%Currentsolardescription% ';

I finally got it working. Thanks Ken. I had to change one thing after changing the settings Ken showed me. It was in the ajaxWDwx.js.

From:
set_ajax_obs(“ajaxcurrentcond”,ajaxFixupCondition(currentcond));

To:
set_ajax_obs(“ajaxcurrentcond”,(currentcond);

Chuck

During daytime, my conditions generally show ‘<some cloud condition/Dry’ … When it rains, the ‘Dry’ (meaning not raining) is replaced with ‘Drizzle’, ‘Light Rain’, ‘Rain’, ‘Heavy Rain’ or ‘Stopped Raining’ based on the frequency of bucket tips.

At night, the conditions are prepended with ‘Night time/’.

The JavaScript of ajaxFixupCondition() was supposed to do just that …
It would remove duplicated entries and other foibles based on the clientraw.txt field contents. Here’s a sample from my logs


Udate	WDicon	WDwxcond	WDcursolar	WDwxrpt	CRtime	CRicon	CRwxdesc
07-Apr-2009 9:20am	19	Dry	Mostly Cloudy/Dry 	mostly cloudy	9:24 AM	19	Mostly_Cloudy/Dry
07-Apr-2009 9:25am	21	Moderate drizzle	Mostly Cloudy/Moderate drizzle 	mostly cloudy	9:29 AM	21	Mostly_Cloudy/Moderate_drizzle
07-Apr-2009 9:30am	20	Light rain	Mostly Cloudy/Light rain 	mostly cloudy	9:34 AM	20	Mostly_Cloudy/Light_rain
07-Apr-2009 9:35am	20	Light rain	Mostly Cloudy/Light rain 	mostly cloudy	9:39 AM	20	Mostly_Cloudy/Light_rain
07-Apr-2009 9:40am	20	Light rain	Mostly Cloudy/Light rain 	mostly cloudy	9:44 AM	20	Mostly_Cloudy/Light_rain
07-Apr-2009 9:45am	20	Light rain	Mostly Cloudy/Light rain 	mostly cloudy	9:49 AM	20	Mostly_Cloudy/Light_rain
07-Apr-2009 9:50am	20	Light rain	Mostly Cloudy/Light rain 	mostly cloudy	9:54 AM	21	Overcast/Moderate_drizzle
07-Apr-2009 9:55am	21	Moderate drizzle	Overcast/Moderate drizzle 	mostly cloudy	9:59 AM	20	Overcast/Light_rain
07-Apr-2009 10:00am	21	Moderate drizzle	Overcast/Moderate drizzle 	mostly cloudy	10:04 AM	20	Mostly_Cloudy/Moderate_drizzle
07-Apr-2009 10:05am	20	Moderate drizzle	Mostly Cloudy/Moderate drizzle 	overcast| -  light rain	10:09 AM	20	Mostly_Cloudy/Moderate_drizzle
07-Apr-2009 10:10am	20	Moderate drizzle	Mostly Cloudy/Moderate drizzle 	overcast| -  light rain	10:14 AM	20	Mostly_Cloudy/Moderate_drizzle
07-Apr-2009 10:15am	20	Moderate drizzle	Mostly Cloudy/Moderate drizzle 	overcast| -  light rain	10:19 AM	20	Partly_Cloudy/Moderate_drizzle
07-Apr-2009 10:20am	20	Moderate drizzle	Partly Cloudy/Moderate drizzle 	overcast| -  light rain	10:24 AM	20	Partly_Cloudy/Moderate_drizzle
07-Apr-2009 10:20am	20	Moderate drizzle	Partly Cloudy/Moderate drizzle 	overcast| -  light rain	10:29 AM	2	Partly_Cloudy/Recent_showers
07-Apr-2009 10:30am	2	Recent showers	Partly Cloudy/Recent showers 	overcast| -  light rain	10:34 AM	2	Mostly_Cloudy/Recent_showers
07-Apr-2009 10:35am	2	Recent showers	Mostly Cloudy/Recent showers 	overcast| -  light rain	10:39 AM	19	Mostly_Cloudy/Stopped_raining
07-Apr-2009 10:40am	19	Dry	Mostly Cloudy/Dry 	overcast| -  light rain	10:44 AM	19	Mostly_Cloudy/Dry
07-Apr-2009 10:45am	19	Dry	Mostly Cloudy/Dry 	overcast| -  light rain	10:49 AM	18	Overcast/Dry
07-Apr-2009 10:50am	18	Dry	Overcast/Dry 	overcast| -  light rain	10:54 AM	20	Overcast/Moderate_drizzle
07-Apr-2009 10:55am	20	Moderate drizzle	Overcast/Moderate drizzle 	overcast| -  light rain	10:59 AM	20	Overcast/Light_rain
07-Apr-2009 11:00am	20	Light rain	Overcast/Light rain 	overcast| -  light rain	11:04 AM	20	Mostly_Cloudy/Light_rain
07-Apr-2009 11:05am	20	Light rain	Mostly Cloudy/Light rain 	overcast| -  light rain	11:09 AM	20	Mostly_Cloudy/Light_rain
07-Apr-2009 11:10am	20	Light rain	Mostly Cloudy/Light rain 	overcast| -  light rain	11:14 AM	20	Mostly_Cloudy/Light_rain
07-Apr-2009 11:15am	20	Light rain	Mostly Cloudy/Light rain 	overcast| -  light rain	11:19 AM	20	Mostly_Cloudy/Light_rain
07-Apr-2009 11:20am	20	Moderate drizzle	Mostly Cloudy/Moderate drizzle 	overcast| -  light rain	11:24 AM	20	Mostly_Cloudy/Moderate_drizzle
07-Apr-2009 11:25am	20	Moderate drizzle	Mostly Cloudy/Moderate drizzle 	overcast| -  light rain	11:29 AM	20	Mostly_Cloudy/Moderate_drizzle
07-Apr-2009 11:30am	20	Moderate drizzle	Mostly Cloudy/Moderate drizzle 	overcast| -  light rain	11:34 AM	20	Mostly_Cloudy/Moderate_drizzle
07-Apr-2009 11:35am	20	Moderate drizzle	Mostly Cloudy/Moderate drizzle 	overcast| -  light rain	11:39 AM	20	Mostly_Cloudy/Moderate_drizzle
07-Apr-2009 11:40am	20	Moderate drizzle	Mostly Cloudy/Moderate drizzle 	overcast| -  light rain	11:44 AM	2	Mostly_Cloudy/Recent_showers
07-Apr-2009 11:45am	2	Recent showers	Mostly Cloudy/Recent showers 	overcast| -  light rain	11:49 AM	2	Mostly_Cloudy/Recent_showers
07-Apr-2009 11:50am	2	Recent showers	Mostly Cloudy/Recent showers 	overcast| -  light rain	11:54 AM	19	Mostly_Cloudy/Stopped_raining
07-Apr-2009 11:55am	19	Stopped raining	Mostly Cloudy/Stopped raining 	overcast| -  light rain	11:59 AM	19	Mostly_Cloudy/Dry
07-Apr-2009 12:00pm	19	Dry	Mostly Cloudy/Dry 	overcast| -  light rain	12:04 PM	19	Mostly_Cloudy/Dry
07-Apr-2009 12:05pm	19	Dry	Mostly Cloudy/Dry 	overcast| -  light rain	12:09 PM	19	Mostly_Cloudy/Dry
07-Apr-2009 12:10pm	19	Dry	Mostly Cloudy/Dry 	overcast| -  light rain	12:14 PM	3	Partly_Cloudy/Dry
07-Apr-2009 12:15pm	3	Dry	Partly Cloudy/Dry 	overcast| -  light rain	12:19 PM	3	Partly_Cloudy/Dry
07-Apr-2009 12:20pm	3	Dry	Partly Cloudy/Dry 	overcast| -  light rain	12:24 PM	19	Mostly_Cloudy/Dry
07-Apr-2009 12:25pm	19	Dry	Mostly Cloudy/Dry 	overcast| -  light rain	12:29 PM	19	Mostly_Cloudy/Dry
07-Apr-2009 12:30pm	19	Dry	Mostly Cloudy/Dry 	overcast| -  light rain	12:34 PM	19	Mostly_Cloudy/Dry

You can see how the rain cycle and solar description change the words in %Currentsolardescription% and the corresponding clientraw field (which appears the same with ‘_’ instead of blank). The rows don’t line up due to update cycles and when the cron runs to collect the data (at the 4s and 9s).

Best regards,
Ken

For some reason it is not working again it flashes for a second Night Time/Dry/Overcast and then it goes to overcast_.

Chuck

Your $Currentsolardescription shows as 'Night time, Dry, Overcast ’
Your clientraw[49] shows as ‘overcast_’ so when the page first loads it shows ‘Night time, Dry, Overcast’, then just ‘Overcast’ when the AJAX kicks-in and updates the page.

It’s WD that is not putting the same value in the %Currentsolardescription% used by the PHP/testtags, and clientraw[49] used by AJAX. You’re running Weather Display 10.37N-27 … I’m running 10.37N-22 (just a bit older) and it’s running correctly (PHP and clientraw fields in sync).

Best regards,
Ken

So what you are saying that it is a WD problem because ajax is doing its job.

Chuck

On my summay image it is showing the Night Time/Dry/Overcast. Am I missing a setting to show this for icon 49.

Chuck

Yep… the testtags.php just reports what is in %Currentsolardescription% tag, and AJAX just reports (after a bit of replacing _ with blank) what is in clientraw[49].

Likewise, WD %iconnum% and clientraw[48] are solely determined by WD

Icon numbers go from 1(day clear) to 35(windy/rain) with icon=5 (dry) being the default (as in not-raining) unless your Icon is set from Metar and/or Solar Sensor.

What was funny it was working earlier but for some reason it is not now. So basically without a solar sensor I can not have the type of text with the Nighttime/Dry/Overcast or whatever the conditions are.

Chuck

So for some reason my will not change because now it is starting to rain. My icon is changing but my text is not changing which it should at least I thought.

49 Weather Desc Label overcast_

Chuck

So my question is when you tick your station override metar for rain, wind, fog it is only changing the icon in the clientraw. I thought it use to change the Weather Desc as well. I could be wrong but I thought it used to do that unless I have something ticked that I am not supposed to.

I know the weather conditions is based on Currentsolardescription. I do not have a solar sensor just for info.

Chuck

Hi
I have problems with:
“$Currentsolardescription” on ajax-dashboard

During the day it is ok “cloudless, dry,” but at nighttime there will be only “night” without condition.
It worked last week, solar setups are not changes.

Steffen