Author Topic: Add Soil Temp to Ajax Script  (Read 1818 times)

0 Members and 1 Guest are viewing this topic.

Offline Villain

  • Member
  • *
  • Posts: 12
Add Soil Temp to Ajax Script
« on: June 10, 2009, 06:33:16 AM »
Hi,

I have www.carlowweather.com and I want to add Soil Temp to the main Ajax dashboard, anyone got any ideas how to code it?

Thanks

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: Add Soil Temp to Ajax Script
« Reply #1 on: June 10, 2009, 08:14:18 AM »
I just did a similar thing on my ajax page (added pool sensor), mine is VWS, but the principles are the same.   The base version of the ajax scripts does not have any "extra" temp sensors parsed out of clientraw (or in my case the wflash files....

So first you would need to edit your

ajaxWDwx.js
Add a section, near the //temperature entry like this....

//Soil Temperature ...
  soiltemp = clientraw[20];
  set_ajax_obs("ajaxsoiltemp",soiltemp);

Extra soil sensors are listed as 20 through 25, used the parser script at TNetweather to figure that out.  So once you figure out which one is your soil sensor use that, in place of the "20"
http://www.tnetweather.com/wd-parser.php

Then you would need to put an ajax tag "ajaxsoiltemp" in your page you want it displayed.
Code: [Select]
<span class="ajax" id="ajaxsoiltemp">   </span>

Anyway, that is my stab at it, Ken will probably comment.  Hope I am close (and as usual, backup your js file, etc before attmepting. 

Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline Villain

  • Member
  • *
  • Posts: 12
Re: Add Soil Temp to Ajax Script
« Reply #2 on: June 10, 2009, 09:31:13 AM »
Great info.

Think it looks ok, have a look and let me know what you think: http://www.carlowweather.com

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: Add Soil Temp to Ajax Script
« Reply #3 on: June 10, 2009, 11:20:37 AM »
Cool, glad it worked. (slightly but happily surprised... )
I see that it was actually field 14.....

Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64