Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Humidex Tag

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
6719jason
Posts: 519
Joined: Wed 08 Apr 2009 12:38 pm
Weather Station: La-Crosse WS3502
Operating System: Windows 7
Location: Holland On Sea, Essex UK

Humidex Tag

Post by 6719jason »

Good Afternoon Steve,

I was wondering if, you could modify the Humidex Tag, that is added to a webpage and then updated by Cumulus, so it uses the following Descriptions instead of a number:

Humidex Range Degree of Comfort
20-29 comfortable
30-39 some discomfort
40-45 great discomfort; avoid exertion
above 45 dangerous
above 54 heat stroke imminent

Or something along those lines?

Many thanks
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Humidex Tag

Post by steve »

I think that instead of modifying the existing tag, it would be better to add a new one with the descriptive text. Of course, you can always create the description from the value using a bit of javascript.
Steve
6719jason
Posts: 519
Joined: Wed 08 Apr 2009 12:38 pm
Weather Station: La-Crosse WS3502
Operating System: Windows 7
Location: Holland On Sea, Essex UK

Re: Humidex Tag

Post by 6719jason »

Thanks for the quick reply steve.

How would I go about doing what you have suggested?

Would you be able to help me do it?

Many thanks

Jason
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Humidex Tag

Post by steve »

I knew you were going to ask that :)

I'm afraid I haven't a clue, I don't really do javascript. Hopefully some clever person will be along shortly to tell us how to do it.
Steve
6719jason
Posts: 519
Joined: Wed 08 Apr 2009 12:38 pm
Weather Station: La-Crosse WS3502
Operating System: Windows 7
Location: Holland On Sea, Essex UK

Re: Humidex Tag

Post by 6719jason »

You know me too well! :)

No problem Steve. Its a feature I can live without.
The trouble now is, I can seem to stop tinkering with my website.

Take a look if you want Steve, let me know your thoughs.
http://www.weeleyweatherstation.info

Regards

Jason
User avatar
garytx
Posts: 52
Joined: Sun 22 Jun 2008 3:00 pm
Weather Station: Davis VantagePro 2 Plus w/FARS
Operating System: Windows 7
Location: Central Texas, USA
Contact:

Re: Humidex Tag

Post by garytx »

Jason - Since no "clever people" weighed in, I'll give it a go. Try this. Just insert it into wherever you want the data to appear on your web page.

<script language="javascript">
var hdx = <#humidex>
if (hdx >= 20)
{comf = "Comfortable"}
if (hdx >= 30)
{comf = "Some discomfort"}
if (hdx >= 40)
{comf = "Discomfort, avoid exertion"}
if (hdx >= 45)
{comf = "Dangerous"}
if (hdx >= 50)
{comf= "Heat stroke imminent"}
document.write(comf)
</script>
6719jason
Posts: 519
Joined: Wed 08 Apr 2009 12:38 pm
Weather Station: La-Crosse WS3502
Operating System: Windows 7
Location: Holland On Sea, Essex UK

Re: Humidex Tag

Post by 6719jason »

Thanks my friend. Will give it a try after the apprentice.

Have a great evening.

Jason
6719jason
Posts: 519
Joined: Wed 08 Apr 2009 12:38 pm
Weather Station: La-Crosse WS3502
Operating System: Windows 7
Location: Holland On Sea, Essex UK

Re: Humidex Tag

Post by 6719jason »

It has worked a treat my good friend!

Thankyou Garytx

http://www.weeleyweatherstation.info

Regards

Jason
User avatar
garytx
Posts: 52
Joined: Sun 22 Jun 2008 3:00 pm
Weather Station: Davis VantagePro 2 Plus w/FARS
Operating System: Windows 7
Location: Central Texas, USA
Contact:

Re: Humidex Tag

Post by garytx »

I'm glad it worked for you. Javascript can do tons of things. I got the hang of it fairly quickly and now use it for all sorts of things. I make heavy use of Javascript on this page (along with PHP), showing current fire weather conditions: http://www.wilcowx.com/firemet.php

Note: data on that page comes from WxSolution software rather than Cumulus. I use four different weather software packages from a single Vantage Pro II through the use of Virtual VP.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Humidex Tag

Post by beteljuice »

Humidex is a Canadian measure, in my ajax I use the Heat Index which NOAA has definitions for.
However, these measures only relate to Heat and dew point / humidity, a different set of values apply for cold !

BUT, AFAIK all wx stations 'lie' and give 'normal' temperature values to both Heat Index and Windchill when they don't apply rather than giving null values. (windchill and HI are mutually exclusive)

SO here is a CumulusT.htm work around so that you can give a 'Comfort text' accross all the 'range' and produce a 'feelslike' temperature. ;)

Code: Select all

<script type="text/javascript" >
// beteljuice comfort text and feelslike temperature
// script should be placed in the <head> section of CumulusT.htm
// modify <body onload="comfort()">
// usage: simply put <span id="betel_feelslike"></span> and / or
//       <span id="betel_comfort"></span> in your html where you want the values
// each value may only be used ONCE per page


var langComfort = new Array ( /* Comfort text from  Extreme Cold => Extreme Hot */
	"SEVERE DANGER", "Extremely Cold", "Uncomfortably Cold", "Cold", "Cool", "Comfortable",
	"Warm", "Uncomfortably Hot", "SEVERE DANGER");

function comfort() {


// ------ Temperature Units ----------------------------------------------------------------------------

// better find out units we are getting from file ;-)
		if("<#tempunit>" == "&deg;C") {	// data temperatures are Celcius
				temp_C = <#temp>;
				windchill_C = <#windchill>
				heatidx_C = <#heatindex>;
		} else {
				temp_C = (<#temp> - 32) / 1.8;
				windchill_C = (<#windchill> - 32) /1.8;
				heatidx_C = (<#heatindex> - 32) / 1.8;				
		}				


// ------ FeelsLike ------------------------------------------------------------------------------
		if(document.getElementById("betel_feelslike")) { // existence check !
			if (temp_C <= 16.0 ) {		 // note.. using temps in C and converting for F
		 		feelslike_C = windchill_C; //use WindChill
			} else if (temp_C >=27.0 && humidity >= 40) {
		 		feelslike_C = heatidx_C;   // use HeatIndex
			} else {
				feelslike_C = temp_C
			}
			("<#tempunit>" == "&deg;C" ? feelslike = feelslike_C : feelslike = (feelslike_C * 1.8 + 32).toFixed(1) );

			document.getElementById("betel_feelslike").innerHTML=feelslike + "<#tempunit>";
		}
// END feels like


		
//------------ Create Comfort Index Text - various reasoning ! -------------
		if(document.getElementById("betel_comfort")) { // existence check !
			CI_text = "";				// default if reasoning fails !

			if ((temp_C >= 15) && (temp_C < 25)) {
				CI_text = langComfort[5];  // comfortable
			}
			if ((temp_C >= 25) && (temp_C < 38)) {	// I know this looks high, but its to cover a low Heat Index
				CI_text = langComfort[6];
			}
			if ((temp_C >= 32) && (heatidx_C < 38)){
				CI_text = langComfort[7];
			}
			if (heatidx_C >= 38) {
				CI_text = langComfort[8];
			}
			if (windchill_C < 15) {
				CI_text = langComfort[4];
				if (windchill_C < 5) {
					CI_text = langComfort[3];
				}
				if (windchill_C < 0) {
					CI_text = langComfort[2];
				}
				if (windchill_C < -20) {
					CI_text = langComfort[1];
				}
				if (windchill_C < -35) {
					CI_text = langComfort[0];
				}
			}

			document.getElementById("betel_comfort").innerHTML=CI_text;
		}
// END comfort index text
}
// END function comfort()
</script>
I haven't checked this for F, but I think I've done the right changes :roll:

BTW, the beteljuice has added an 'unoffical' description of "Cold" between 0 => 5 C, NOAA goes from cool to uncomfortably cold.
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply