Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.0.0 (build 4022) - 11 May 2024
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Latest Cumulus MX V4 release 4.0.0 (build 4022) - 11 May 2024
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Ajaxed index-page
Moderator: daj
- meteotortosa
- Posts: 323
- Joined: Thu 04 Dec 2008 12:15 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Windows XP SP3
- Location: Tortosa-Baix Ebre- Catalonia
- Contact:
Re: Ajaxed index-page
Weather in Tortosa (NE Spain), updated every 15'
- meteotortosa
- Posts: 323
- Joined: Thu 04 Dec 2008 12:15 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Windows XP SP3
- Location: Tortosa-Baix Ebre- Catalonia
- Contact:
Re: Ajaxed index-page
Can I have Solar Radiation, ET an UV in realtime?
I've tried this, but not works
I think this isn't right way
I've tried this, but not works
Code: Select all
//Solar Radiation
set_ajax_obs("ajaxsolar", x.responseText.split(' ')[45] + "W/m²");
//Evotranspiration
set_ajax_obs(ajaxet", xresponseText.split(' ')[44] " " + x.responseText.split(' ')[16]);
Weather in Tortosa (NE Spain), updated every 15'
-
- Posts: 112
- Joined: Sat 11 Oct 2008 3:20 pm
- Weather Station: Davis Vantage Pro 2 Plus
- Operating System: Debian Buster
Re: Ajaxed index-page
ajaxsolar, ajaxet, ajaxuv addedmeteotortosa wrote:Can I have Solar Radiation, ET an UV in realtime?
remove the .txt to use it
You do not have the required permissions to view the files attached to this post.
Jozef
- meteotortosa
- Posts: 323
- Joined: Thu 04 Dec 2008 12:15 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Windows XP SP3
- Location: Tortosa-Baix Ebre- Catalonia
- Contact:
Re: Ajaxed index-page
Ok, you're the bestpinto wrote:ajaxsolar, ajaxet, ajaxuv addedmeteotortosa wrote:Can I have Solar Radiation, ET an UV in realtime?
remove the .txt to use it
Weather in Tortosa (NE Spain), updated every 15'
- meteotortosa
- Posts: 323
- Joined: Thu 04 Dec 2008 12:15 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Windows XP SP3
- Location: Tortosa-Baix Ebre- Catalonia
- Contact:
Re: Ajaxed index-page
Now I see that my web is 1 minute updated !! Is this OK ?pinto wrote:ajaxsolar, ajaxet, ajaxuv addedmeteotortosa wrote:Can I have Solar Radiation, ET an UV in realtime?
remove the .txt to use it
Weather in Tortosa (NE Spain), updated every 15'
-
- Posts: 112
- Joined: Sat 11 Oct 2008 3:20 pm
- Weather Station: Davis Vantage Pro 2 Plus
- Operating System: Debian Buster
Re: Ajaxed index-page
sorry forgot: I update at 1 minutemeteotortosa wrote: Now I see that my web is 1 minute updated !! Is this OK ?
you can change the time here:
bottom of the script
Code: Select all
setTimeout("ajaxLoader('realtime.txt?'+new Date())",60000); // get new data after 1 minute
5000 miliseconds = 5 seconds
you can set the speed here as you like
Jozef
- meteotortosa
- Posts: 323
- Joined: Thu 04 Dec 2008 12:15 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Windows XP SP3
- Location: Tortosa-Baix Ebre- Catalonia
- Contact:
Re: Ajaxed index-page
A little problem again I'm sorry
I edit AjaxCumulus.js to show baro trend in spanish
and Beaufort
Before I install the file mentioned here (https://cumulus.hosiene.co.uk/viewtopic.php?p=2966#p2966) it show OK, after install it..I have barotrend in english.
Thanks,
Lluís
I edit AjaxCumulus.js to show baro trend in spanish
Code: Select all
var langBaroTrend = new Array (
"Estable", "Pujant lentament", "Pujant ràpidament", "Baixant lentament", "Baixant ràpidament");
Code: Select all
var langBeaufort = new Array ( /* Beaufort 0 to 12 in array */
"Calma", "Ventolina", "Vent Fluixet", "Vent Fluix", "Vent Moderat", "Vent Fresquet",
"vent Fresc", "vent Fort", "Temporal", "Temporal Fort", "Temporal Molt Fort",
"Temporal Violent", "Huracà"
Thanks,
Lluís
Weather in Tortosa (NE Spain), updated every 15'
-
- Posts: 112
- Joined: Sat 11 Oct 2008 3:20 pm
- Weather Station: Davis Vantage Pro 2 Plus
- Operating System: Debian Buster
Re: Ajaxed index-page
if you don't use UV, try to remove it from AjaxCumulus.js
I have to find a solution for that.
If there is a value inside the AjaxCumulus.js, you don't use on your actual page, it looks like the updates stop at that point.
If I look at your page, all values located below UV in the AjaxCumulus.js do not update in realtime.
I have to find a solution for that.
If there is a value inside the AjaxCumulus.js, you don't use on your actual page, it looks like the updates stop at that point.
If I look at your page, all values located below UV in the AjaxCumulus.js do not update in realtime.
Jozef
- meteotortosa
- Posts: 323
- Joined: Thu 04 Dec 2008 12:15 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Windows XP SP3
- Location: Tortosa-Baix Ebre- Catalonia
- Contact:
Re: Ajaxed index-page
Some like this?pinto wrote:if you don't use UV, try to remove it from AjaxCumulus.js
I have to find a solution for that.
If there is a value inside the AjaxCumulus.js, you don't use on your actual page, it looks like the updates stop at that point.
If I look at your page, all values located below UV in the AjaxCumulus.js do not update in realtime.
or I have to delete it?//UV
//set_ajax_obs("ajaxuv", x.responseText.split(' ')[43]);
Weather in Tortosa (NE Spain), updated every 15'
- meteotortosa
- Posts: 323
- Joined: Thu 04 Dec 2008 12:15 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Windows XP SP3
- Location: Tortosa-Baix Ebre- Catalonia
- Contact:
Re: Ajaxed index-page
This are two AjaxCumulus.js
The first one:
And this one with ET and Solar Radiation:
I think is the same, but isn't !! When I use first one, I have barotrend word in spanish, but if I use second...don't change...I don't undersant what happens !!!
The first one:
Code: Select all
<!--
// Special thanks to: Kevin Reed http://www.tnetweather.com
// Special thanks to: Pinto http://www.joske-online.be
// Pinto wrote the basic AJAX code for this page!
//
// 25 oktober 2008 first try to write this script for Cumulus (http://sandaysoft.com)
//
// by Pinto
//
/////////////////////IMPORTAND NOTICE////////////////////////////////////////////////////////////////
//heat index is still pointing to outside temperature until steve releases a new version of cumulus
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
// --- added flash-change on data update functions from Ken at http://www.saratoga-weather.org
// -- begin settings
//
//
var flashcolor = '#FF0000'; // color to flash for changed observations
var flashtime = '2000'; // miliseconds to keep flash color on (2000 = 2 seconds);
// -- end of settings
var ie4=document.all;
function getElementsByName_iefix(tag, name) {
var elem = document.getElementsByTagName(tag);
var arr = new Array();
for(i = 0,iarr = 0; i < elem.length; i++) {
att = elem[i].getAttribute("name");
if(att == name) {
arr[iarr] = elem[i];
iarr++;
}
}
return arr;
}
function reset_ajax_color( ) {
// reset all the <span name="ajax"...> styles to have no color override
if (ie4) {
elements = getElementsByName_iefix("span","ajax");
} else {
elements = document.getElementsByName("ajax");
}
numelements = elements.length;
for (var index=0;index!=numelements;index++) {
element = elements[index];
element.style.color='';
}
}
function set_ajax_obs( name, value ) {
// store away the current value in both the doc and the span as lastobs="value"
// change color if value != lastobs
element = document.getElementById(name);
lastobs = element.getAttribute("lastobs");
element.setAttribute("lastobs",value);
if (value != lastobs) {
element.style.color=flashcolor;
}
element.innerHTML = value;
}
// --- end of flash-change functions
//
// --- begin of functions to convert values
//
var langBaroTrend = new Array (
"Estable", "Pujant lentament", "Pujant ràpidament", "Baixant lentament", "Baixant ràpidament");
function ajax_get_barotrend(btrnd) {
// routine from Anole's wxsticker PHP (adapted to JS by Ken True)
// input: trend in hPa or millibars
// Barometric Trend(3 hour)
// Change Rates
// Rapidly: =.06 inHg; 1.5 mm Hg; 2 hPa; 2 mb
// Slowly: =.02 inHg; 0.5 mm Hg; 0.7 hPa; 0.7 mb
// 5 conditions
// Rising Rapidly
// Rising Slowly
// Steady
// Falling Slowly
// Falling Rapidly
// Page 52 of the PDF Manual
// http://www.davisnet.com/product_documents/weather/manuals/07395.234-VP2_Manual.pdf
// figure out a text value for barometric pressure trend(1 hour)
if ((btrnd >= -0.23) && (btrnd <= 0.23)) { return(langBaroTrend[0]); }
if ((btrnd > 0.23) && (btrnd < 0.66)) { return(langBaroTrend[1]); }
if (btrnd >= 0.66) { return(langBaroTrend[2]); }
if ((btrnd < -0.23) && (btrnd > -0.66)) { return(langBaroTrend[3]); }
if (btrnd <= -0.66) { return(langBaroTrend[4]); }
return(btrnd);
}
function windrunUnit(windUnit) {
if (windUnit == "m/s") { return " km"; }
if (windUnit == "km/h") { return " km"; }
if (windUnit == "mph") { return " miles"; }
if (windUnit == "kts") { return " nm"; }
return(windUnit);
}
var langBeaufort = new Array ( /* Beaufort 0 to 12 in array */
"Calma", "Ventolina", "Vent Fluixet", "Vent Fluix", "Vent Moderat", "Vent Fresquet",
"Vent Fresc", "Vent Fort", "Temporal", "Temporal Fort", "Temporal Molt Fort",
"Temporal Violent", "Huracà"
);
//
// --- end of functions to convert values
//
function ajaxLoader(url) {
if (document.getElementById) {
var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x) {
x.onreadystatechange = function() {
if (x.readyState == 4 && x.status == 200) {
//updating text instead of " <#interval> minutes"
set_ajax_obs("ajaxintervaltext", "5 segons");
//Temp
temp = (x.responseText.split(' ')[2]+ " °" + x.responseText.split(' ')[14]);
set_ajax_obs("ajaxtemp", temp);
temptrend = (x.responseText.split(' ')[25]+ " °" + x.responseText.split(' ')[14] + "/hr");
set_ajax_obs("ajaxtemptrend", temptrend);
//Time
set_ajax_obs("ajaxtime", "actualitzat a les " + x.responseText.split(' ')[1] + " del " + x.responseText.split(' ')[0]);
//Windchill
set_ajax_obs("ajaxchill", x.responseText.split(' ')[24] + " °" + x.responseText.split(' ')[14]);
//Humidity ...
set_ajax_obs("ajaxhum", x.responseText.split(' ')[3] + "%");
//Dewpt
set_ajax_obs("ajaxdewpt", x.responseText.split(' ')[4] + " °" + x.responseText.split(' ')[14]);
//heat index
set_ajax_obs("ajaxheatindex", x.responseText.split(' ')[2] + " °" + x.responseText.split(' ')[14]);
//dayrain
set_ajax_obs("ajaxrfall", x.responseText.split(' ')[9] + " " + x.responseText.split(' ')[16]);
//rainrate
set_ajax_obs("ajaxrrate", x.responseText.split(' ')[8] + " " + x.responseText.split(' ')[16] + "/hr");
//rain month
set_ajax_obs("ajaxrmonth", x.responseText.split(' ')[19] + " " + x.responseText.split(' ')[16]);
//rain year
set_ajax_obs("ajaxryear", x.responseText.split(' ')[20] + " " + x.responseText.split(' ')[16]);
//wind latest
set_ajax_obs("ajaxwlatest", x.responseText.split(' ')[6] + " " + x.responseText.split(' ')[13]);
//wind speed
set_ajax_obs("ajaxwspeed", x.responseText.split(' ')[5] + " " + x.responseText.split(' ')[13]);
//windrun
set_ajax_obs("ajaxwindrun", x.responseText.split(' ')[17] + windrunUnit(x.responseText.split(' ')[13]));
//wind bearing
set_ajax_obs("ajaxavgbearing", x.responseText.split(' ')[7] + "° " + x.responseText.split(' ')[11]);
//Beaufort
set_ajax_obs("ajaxbeaufort", "Beaufort F" + x.responseText.split(' ')[12]);
//Beaufort word
set_ajax_obs("ajaxbeaudesc", langBeaufort[x.responseText.split(' ')[12]]);
//Barometer
set_ajax_obs("ajaxpress", x.responseText.split(' ')[10] + " " + x.responseText.split(' ')[15]);
//Barometer trend value and units
set_ajax_obs("ajaxpresstrendval", x.responseText.split(' ')[18] + " " + x.responseText.split(' ')[15] + "/hr");
//Barometer trend word
if (x.responseText.split(' ')[15] == "in") {
return set_ajax_obs("ajaxpresstrend", ajax_get_barotrend(x.responseText.split(' ')[18] * 33.86388158));
}
else {
return set_ajax_obs("ajaxpresstrend", ajax_get_barotrend(x.responseText.split(' ')[18]));
}
}
}
x.open("GET", url, true);
x.send(null);
setTimeout("reset_ajax_color()",2000); // change text back to default color after 2 secs
setTimeout("ajaxLoader('realtime.txt?'+new Date())", 6000); // get new data after 6 secs
}
}
// -->
Code: Select all
<!--
// Special thanks to: Kevin Reed http://www.tnetweather.com
// Special thanks to: Pinto http://www.joske-online.be
// Pinto wrote the basic AJAX code for this page!
//
// 25 oktober 2008 first try to write this script for Cumulus (http://sandaysoft.com)
//
// by Pinto
//
//added et, solar and UV november 2008
/////////////////////IMPORTAND NOTICE////////////////////////////////////////////////////////////////
//heat index is still pointing to outside temperature until steve releases a new version of cumulus
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
// --- added flash-change on data update functions from Ken at http://www.saratoga-weather.org
// -- begin settings
//
//
var flashcolor = '#FF0000'; // color to flash for changed observations
var flashtime = '2000'; // miliseconds to keep flash color on (2000 = 2 seconds);
// -- end of settings
var ie4=document.all;
function getElementsByName_iefix(tag, name) {
var elem = document.getElementsByTagName(tag);
var arr = new Array();
for(i = 0,iarr = 0; i < elem.length; i++) {
att = elem[i].getAttribute("name");
if(att == name) {
arr[iarr] = elem[i];
iarr++;
}
}
return arr;
}
function reset_ajax_color( ) {
// reset all the <span name="ajax"...> styles to have no color override
if (ie4) {
elements = getElementsByName_iefix("span","ajax");
} else {
elements = document.getElementsByName("ajax");
}
numelements = elements.length;
for (var index=0;index!=numelements;index++) {
element = elements[index];
element.style.color='';
}
}
function set_ajax_obs( name, value ) {
// store away the current value in both the doc and the span as lastobs="value"
// change color if value != lastobs
element = document.getElementById(name);
lastobs = element.getAttribute("lastobs");
element.setAttribute("lastobs",value);
if (value != lastobs) {
element.style.color=flashcolor;
}
element.innerHTML = value;
}
// --- end of flash-change functions
//
// --- begin of functions to convert values
//
var langBaroTrend = new Array (
"Estable", "Pujant lentament", "Pujant ràpidament", "Baixant lentament", "Baixant ràpidament");
function ajax_get_barotrend(btrnd) {
// routine from Anole's wxsticker PHP (adapted to JS by Ken True)
// input: trend in hPa or millibars
// Barometric Trend(3 hour)
// Change Rates
// Rapidly: =.06 inHg; 1.5 mm Hg; 2 hPa; 2 mb
// Slowly: =.02 inHg; 0.5 mm Hg; 0.7 hPa; 0.7 mb
// 5 conditions
// Rising Rapidly
// Rising Slowly
// Steady
// Falling Slowly
// Falling Rapidly
// Page 52 of the PDF Manual
// http://www.davisnet.com/product_documents/weather/manuals/07395.234-VP2_Manual.pdf
// figure out a text value for barometric pressure trend(1 hour)
if ((btrnd >= -0.23) && (btrnd <= 0.23)) { return(langBaroTrend[0]); }
if ((btrnd > 0.23) && (btrnd < 0.66)) { return(langBaroTrend[1]); }
if (btrnd >= 0.66) { return(langBaroTrend[2]); }
if ((btrnd < -0.23) && (btrnd > -0.66)) { return(langBaroTrend[3]); }
if (btrnd <= -0.66) { return(langBaroTrend[4]); }
return(btrnd);
}
function windrunUnit(windUnit) {
if (windUnit == "m/s") { return " km"; }
if (windUnit == "km/h") { return " km"; }
if (windUnit == "mph") { return " miles"; }
if (windUnit == "kts") { return " nm"; }
return(windUnit);
}
var langBeaufort = new Array ( /* Beaufort 0 to 12 in array */
"Calma", "Ventolina", "Vent Fluixet", "Vent Fluix", "Vent Moderat", "Vent Fresquet",
"vent Fresc", "vent Fort", "Temporal", "Temporal Fort", "Temporal Molt Fort",
"Temporal Violent", "Huracà"
);
//
// --- end of functions to convert values
//
function ajaxLoader(url) {
if (document.getElementById) {
var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x) {
x.onreadystatechange = function() {
if (x.readyState == 4 && x.status == 200) {
//updating text instead of " <#interval> minutes"
set_ajax_obs("ajaxintervaltext", "5 segons");
//Temp
temp = (x.responseText.split(' ')[2]+ " °" + x.responseText.split(' ')[14]);
set_ajax_obs("ajaxtemp", temp);
temptrend = (x.responseText.split(' ')[25]+ " °" + x.responseText.split(' ')[14] + "/hr");
set_ajax_obs("ajaxtemptrend", temptrend);
//Time
set_ajax_obs("ajaxtime", "Actualitzat a les: " + x.responseText.split(' ')[1] + " del " + x.responseText.split(' ')[0]);
//Windchill
set_ajax_obs("ajaxchill", x.responseText.split(' ')[24] + " °" + x.responseText.split(' ')[14]);
//Humidity ...
set_ajax_obs("ajaxhum", x.responseText.split(' ')[3] + "%");
//Dewpt
set_ajax_obs("ajaxdewpt", x.responseText.split(' ')[4] + " °" + x.responseText.split(' ')[14]);
//heat index
set_ajax_obs("ajaxheatindex", x.responseText.split(' ')[2] + " °" + x.responseText.split(' ')[14]);
//dayrain
set_ajax_obs("ajaxrfall", x.responseText.split(' ')[9] + " " + x.responseText.split(' ')[16]);
//rainrate
set_ajax_obs("ajaxrrate", x.responseText.split(' ')[8] + " " + x.responseText.split(' ')[16] + "/hr");
//rain month
set_ajax_obs("ajaxrmonth", x.responseText.split(' ')[19] + " " + x.responseText.split(' ')[16]);
//rain year
set_ajax_obs("ajaxryear", x.responseText.split(' ')[20] + " " + x.responseText.split(' ')[16]);
//wind latest
set_ajax_obs("ajaxwlatest", x.responseText.split(' ')[6] + " " + x.responseText.split(' ')[13]);
//wind speed
set_ajax_obs("ajaxwspeed", x.responseText.split(' ')[5] + " " + x.responseText.split(' ')[13]);
//windrun
set_ajax_obs("ajaxwindrun", x.responseText.split(' ')[17] + windrunUnit(x.responseText.split(' ')[13]));
//wind bearing
set_ajax_obs("ajaxavgbearing", x.responseText.split(' ')[7] + "° " + x.responseText.split(' ')[11]);
//Beaufort
set_ajax_obs("ajaxbeaufort", "Escala Beaufort F" + x.responseText.split(' ')[12]);
//Beaufort word
set_ajax_obs("ajaxbeaudesc", langBeaufort[x.responseText.split(' ')[12]]);
//Solar
set_ajax_obs("ajaxsolar", x.responseText.split(' ')[45] + " W/m²");
//ET
set_ajax_obs("ajaxet", x.responseText.split(' ')[44] + " " + x.responseText.split(' ')[16]);
//Barometer
set_ajax_obs("ajaxpress", x.responseText.split(' ')[10] + " " + x.responseText.split(' ')[15]);
//Barometer trend value and units
set_ajax_obs("ajaxpresstrendval", x.responseText.split(' ')[18] + " " + x.responseText.split(' ')[15] + "/hr");
//Barometer trend word
if (x.responseText.split(' ')[15] == "in") {
return set_ajax_obs("ajaxpresstrend", ajax_get_barotrend(x.responseText.split(' ')[18] * 33.86388158));
}
else {
return set_ajax_obs("ajaxpresstrend", ajax_get_barotrend(x.responseText.split(' ')[18]));
}
}
}
x.open("GET", url, true);
x.send(null);
setTimeout("reset_ajax_color()",2000); // change text back to default color after 2 secs
setTimeout("ajaxLoader('realtime.txt?'+new Date())", 5000); // get new data after 5 secs
}
}
// -->
Weather in Tortosa (NE Spain), updated every 15'
-
- Posts: 112
- Joined: Sat 11 Oct 2008 3:20 pm
- Weather Station: Davis Vantage Pro 2 Plus
- Operating System: Debian Buster
Re: Ajaxed index-page
nothing wrong with that second one, it's on my page now, I remove it 10 december local time.
You can see the code here
You can see the code here
Jozef
- meteotortosa
- Posts: 323
- Joined: Thu 04 Dec 2008 12:15 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Windows XP SP3
- Location: Tortosa-Baix Ebre- Catalonia
- Contact:
Re: Ajaxed index-page
I haven't UV sensor, only Radiation Solar sensor. Can be this the problem?pinto wrote:nothing wrong with that second one, it's on my page now, I remove it 10 december local time.
You can see the code here
Weather in Tortosa (NE Spain), updated every 15'
- meteotortosa
- Posts: 323
- Joined: Thu 04 Dec 2008 12:15 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Windows XP SP3
- Location: Tortosa-Baix Ebre- Catalonia
- Contact:
Re: Ajaxed index-page
Weather in Tortosa (NE Spain), updated every 15'
-
- Posts: 112
- Joined: Sat 11 Oct 2008 3:20 pm
- Weather Station: Davis Vantage Pro 2 Plus
- Operating System: Debian Buster
Re: Ajaxed index-page
it's more a caching issue, try to delete the cache from your browser
screenshot attached (it is your page)
screenshot attached (it is your page)
You do not have the required permissions to view the files attached to this post.
Jozef