New user questions

99% of everything is working as desired, but i have a couple questions. Yes, i have searched looking for answers and found answers to most my questions. My site is at Stanley Rapids Weather - Home. But…

  1. Forecast icons, at night, seem to really REALLY like to use a cold icon. So about every night shows the same ‘cold’ icon. Daytime looks good. Can i make it prefer some basis other than temperature, i.e. cloud cover? I do have one night showing light snow as the icon. This is using NWS forecasts, although i saw basically the same thing using aeris forecasts.
  2. Updating information from clientraw is working fine, but i have some data only in testtags.php and it doesn’t seem to update that data unless i do a forced refresh. Am i missing something about automatic updates from the testtags.php file. I have it set in ajaxWSwx.js for 60 seconds, which works fine on clientraw. Nothing from testtags.
  3. I have been looking for an add-on script for my extra sensors. I have 3 extra sensors and there is one i like to monitor in winter time (especially). The temp under my well cover. I have heater systems to keep it from freezing and realy like to know they are working.

Thanks for any advice.

Jim

Testtags usually update every 5 mins, as per recommended upload from WD. The setting in ajaxWDwx.js is for real-time clientraw data.

I set maxupdates to 0 for unlimited and it still stopped after about 5 minutes. So i set it up to 480 and it still paused updates after about 5 minutes. I checked the testtags file it had, in fact been updated and changed.
Hmmmm.
Thanks
Jim

The forecast icons come from the NWS (based on the forecast for your location.
I think that the NWS forecast uses the cold icon when the temperature is 32F or lower and no precipation is forecasted. The Xweather/Aeris forecast would likely use the same logic.

testtags.php should be updated every 5 minutes – use wxstatus.php on your site to check. It will show ‘Not Current’ if it is older than 5m15s.
Use Saratoga-Weather.org - Website Templates - AJAX/PHP - Weather-Display Setup and the override method to have testtags.txt processed and uploaded to testtags.php every 5 minutes

You can add WD tags to your testtags.txt file which will appear in testtags.php
Just be careful to use proper PHP syntax otherwise your site will be blank due to PHP fatal syntax error.

Just FyI, the ajaxWDwx.js script only reads clientraw.txt for more frequent updates to weather values. It is the data from testtags.php (not used by ajaxWDwx.js) that populates all the weather conditions displayed by PHP pages on your site. The AJAX updates only due some of the values displayed since clientraw.txt doesn’t contain all the conditions that are in testtags.php

I hope this helps…

Thank you Ken,
I have testtags being uploaded every five minutes and have confirmed that it is working and uploading. Status shows it as current, yet its data does not refresh until i do a manual refresh. I think i have found a work around. There are some free extensions for chrome that will automagically hit the refresh button on some timed basis. This seems to evade the problem by clicking refresh for me.
I have an AQI sensor i have added to testtags and its working just fine and displaying on my main page. I don’t really care that its not updated with clientraw, but it doesn’t update at all until the new testags is displayed.

While i don’t intend to just leave the page up all the time, ther are some extended periods where i leave it running and prefer not to have to hit refresh when the updates clock out.

Thanks for your help, I am learning a lot and having fun. That is, after all, the bitsostring standard. Are we having fun yet?

This extension also evades a chome “feature”. Chrome refuses to obey no-cache directive on certain image files, like the jpg produced by my yard camera. The only way to get the current image is to wait its timeout period, which is like 8 or 10 hours, or do a hard refresh (control+refresh). This extenstion has a hard refresh option that keeps my yard images up to date. Now if i can just get my 45 year old Triumph car to be obedient to my wishes. :slight_smile:
Thanks again.
Jim

So the easy fix to get the new testtags.php values displayed is to add in the <head> section of the page

<meta http-equiv="Refresh" content="300" />

which will cause the browser to refresh the page every 300 seconds (5 minutes).
You could include that in the <html> part of top.php to have EVERY page on your site autoreload every 5 minutes.
No need for a browser plugin for that.

I see in ajaxWDwx.js you have

var reloadTime = 60000;       // reload AJAX conditions every 5 seconds (= 5000 ms)
var maxupdates = 480;	         // Maxium Number of updates allowed (set to zero for unlimited)

which causes updates via AJAX/clientraw.txt every 60 seconds … that seems a bit long unless you configured WD to upload clientraw.txt every 60 seconds. If that’s the case, I’d suggest using 30000 for the reloadTime (every 30 seconds) so the page is more ‘timely’ with the refresh.

For the image issue, you’ll likely need a separate JavaScript to dynamically reload that image on an interval. Something like

<script type="text/javascript"><!--
//<![CDATA[
function swx_reloadImage() {
    var now = new Date();
    if (document.images.myPull) {
        document.images.myPull.src = '/netcam-thumb.jpg?' + now.getTime();
    }
    setTimeout('swx_reloadImage()',15000);
}

setTimeout('swx_reloadImage()',15000);
//]]>
-->
</script>

Just put

id="myPull"

in the <img … /> statement for your image to reload, and change the /netcam-thumb.jpg to your image.

I hope this helps.

I will give it a try, thanks very much. I have so much to learn. Years ago i used to write things in C++, so i understand the concepts and principles, but java, php etc are all so new compared to my antique knowledge.

Thanks again.
Jim

Perfect! Solved a number of problems and annoyances. I owe you another cup of coffee,

Jim