How do you add $timeoflastrainalways to the ajax-dashboard so that it refreshes?

Would someone be so kind to tell me how you do this in general.
Adding stuff to the dashboard so that these parameters refresh themselves.

For example, I’d like to add the last time that it rained.

So far I have succeeded by adding this piece of code.

                <td  class="data1"> Laatste regen:</td>
                <td style="text-align: right;" class="data1">
				  <span class="ajax" id="ajaxtimeoflastrainalways">
                   <?php echo $timeoflastrainalways; ?>

I am not sure about this id, I made that one up by myself.

Each time the page is loaded, this parameter will be loaded.
But I like it to be refreshed without the page loading.
All I know is that you need to add code in the ajaxloader function in ajaxWDwx.js
You have to know the clientraw[??] for $lasttimeofrainalways.

ajaxloader in ajaxWDwx.js

	//Rain ...
		rain = convertRain(clientraw[7]);
		set_ajax_obs("ajaxrain",rain.toFixed(dpRain) + uomRain);
		set_ajax_obs("gizmorain",rain.toFixed(dpRain) + uomRain);

		rainydy = convertRain(clientraw[19]);
		set_ajax_obs("ajaxrainydy",rainydy.toFixed(dpRain)+ uomRain);

		rainmo = convertRain(clientraw[8]);
		set_ajax_obs("ajaxrainmo",rainmo.toFixed(dpRain) + uomRain);

		rainyr = convertRain(clientraw[9]);
		set_ajax_obs("ajaxrainyr",rainyr.toFixed(dpRain) + uomRain);

		rainratehr = convertRain(clientraw[10]) * 60; // make per hour rate.
		set_ajax_obs("ajaxrainratehr",rainratehr.toFixed(dpRain+1) + uomRain);

		rainratemax = convertRain(clientraw[11]) * 60; // make per hour rate
		set_ajax_obs("ajaxrainratemax",rainratemax.toFixed(dpRain+1) + uomRain);

I have been trying but to no avail.
Can someone push me in the right direction or tell me exactely how to do this.

Thanks in advance.

Did you want something like this:

Rain: 1/1/2013
12:39 PM

Last Rain: <?php echo $dateoflastrainalways; ?>
              <?php echo $timeoflastrainalways; ?>

This is only a section of my dashboard code for rainfall, not sure if what I show above would work as a stand alone.

I had something similar, without the date though.
I want it to refresh automatically without reloading the page, you know when data turns green in the dashboard.

It has something to do with the ajaxloader function in ajaxWDwx.js
It is not clear to me how you do that for this example and in general.
I’d like to add more that refreshes automatically (auto update).

The data for time of last rain is not in clientraw.txt so no AJAX update is possible … Sorry.

Best regards,

I see! Too bad.

And $hiRainRateTime, I believe that’s #82?

I’m not aware of a ‘hiRainRateTime’ tag in Weather-Display’s tag listing … could you clarify?
Clientraw[82] is not a rain tag, but a Hr Windspeed 03 tag (the wind speed 3 hours ago)
The clientraw data from 100 to 109 are the Hourly Rain totals from 1hr to 10hrs ago.

You can use to show what is in clientraw.txt and those are the only data available to the AJAX routine.

Best regards,

Sorry Ken :oops:

I must have been working on my computer too long, that day.
I meant maxrainratetime.
Record month rainrate day (time) is #82 in the clientrawextra.txt
I was referring to that one but it is clear to me now that only data from clientraw.txt can get an ajax update.


Another issue I have now is my dateformat in the dashboard and ajax gizmo.
I am not aware that this always has been the case.
I am pretty sure my dateformat was day-month-year and not month-day-year.
I found out or it occurred when adding time of last rain to the dashboard.
All other dateformats on my site are correct which is day-month-year.
I have been checking settings for them in ajaxdashboard.php and settings.php.
I must be overlooking something. #-o #-o

Do you have a suggestion where to look for?