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

Humidity Unit Tag?

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

Moderator: daj

User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Humidity Unit Tag?

Post by William Grimsley »

Hi Steve,

Yes, I knew you could do that. But, of course that wouldn't be any help for what I was trying to do. ;)

Thanks again,

Will
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Humidity Unit Tag?

Post by laulau »

Hi Will,
Did you notice that you have %% in your banner ? ;)
Laurent

Image
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Humidity Unit Tag?

Post by William Grimsley »

Hi laulau,

No, I didn't notice! Thanks for telling me! :D

EDIT: Fixed the "%%" error in the banner.php file. Also, I have fixed the "%%" error in the ajax-gizmo.php file.
KevinF
Posts: 71
Joined: Sat 14 Apr 2012 5:01 pm
Weather Station: WMR200
Operating System: XP SP3
Location: Lancashire

Re: Humidity Unit Tag?

Post by KevinF »

Don't forget to fix 'dew'

Should read 'DewPt'

KF
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Humidity Unit Tag?

Post by William Grimsley »

I didn't notice that! Thanks for telling me! :D

EDIT: Fixed the "Dew" error and replaced with "Dew Pt" in the banner.php file.
KevinF
Posts: 71
Joined: Sat 14 Apr 2012 5:01 pm
Weather Station: WMR200
Operating System: XP SP3
Location: Lancashire

Re: Humidity Unit Tag?

Post by KevinF »

You're welcome.

KF
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Humidity Unit Tag?

Post by William Grimsley »

Hi Steve,

Ok, I'm trying to add '/hr' after the <#rrate> web tag, like this:

From:

Code: Select all

<#rrate>
To:

Code: Select all

<#rrate>/hr
But, then my website shows 'NaN mm'!

What's going on?

William
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: Humidity Unit Tag?

Post by steve »

My guess would be that you have that in some script/PHP, rather than HTML, so the interpreter is trying to divide by "hr", hence 'not a number'. I'd need to see your change in context.
Steve
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Humidity Unit Tag?

Post by William Grimsley »

steve wrote:I'd need to see your change in context.
Is this what you mean?

Code: Select all

 var rainratehr = convertRain(realtime[8]); // make per hour rate.
		set_ajax_obs("ajaxrainratehr",rainratehr.toFixed(dpRain) + uomRain);
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: Humidity Unit Tag?

Post by steve »

I can't see the <#rrate> web tag there at all, nor any sign of "/hr".
Steve
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Humidity Unit Tag?

Post by William Grimsley »

Steve,

If, you are wanting to see the HTML code, look here:

From:

Code: Select all

<#rrate>
To:

Code: Select all

<#rrate>/hr
If, you are wanting to see the PHP code, look here:

Code: Select all

var rainratehr = convertRain(realtime[8]); // make per hour rate.
      set_ajax_obs("ajaxrainratehr",rainratehr.toFixed(dpRain) + uomRain);
Hope this helps...

William
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: Humidity Unit Tag?

Post by steve »

This is how the standard Cumulus index.htm HTML web page template does it:

Code: Select all

<td><#rrate>&nbsp;<#rainunit>/hr</td>
I have no idea how the HTML you're quoting is related to the PHP you're quoting. If you're using <#rrate>/hr in your realtime.txt file, and that is realtime[8] in your PHP, then what you are doing, I would guess, is passing the the rain rate with "/hr" on the end of it to a function (convertRain) which is expecting a number. What you need to do is put the "/hr" onto your web page, not into your realtime.txt file, and I can't offer any help with that.
Steve
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Humidity Unit Tag?

Post by William Grimsley »

Hi Steve,

Ok, I've tried with PHP and that works.

But, with AJAX I can't get it to work because it's PHP that I'm trying to include in AJAX code. So, I must have to root round my ajaxCUwx.js file in order to accomplish what I want!

Thanks for your help,

William
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: Humidity Unit Tag?

Post by beteljuice »

Code: Select all

var rainratehr = convertRain(realtime[8]); // make per hour rate.
      set_ajax_obs("ajaxrainratehr",rainratehr.toFixed(dpRain) + uomRain);
That is JavaScript and in order for it to work the html must be something like:

Code: Select all

<span id='ajaxrainratehr'></span>
The original Ajax call replaces the contents of the span with rainratevalue unitof(rain)measure. eg. 21.5 mm

To add /hr just put that immediately after the named span in the html
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Humidity Unit Tag?

Post by William Grimsley »

beteljuice wrote:

Code: Select all

var rainratehr = convertRain(realtime[8]); // make per hour rate.
      set_ajax_obs("ajaxrainratehr",rainratehr.toFixed(dpRain) + uomRain);
That is JavaScript and in order for it to work the html must be something like:

Code: Select all

<span id='ajaxrainratehr'></span>
The original Ajax call replaces the contents of the span with rainratevalue unitof(rain)measure. eg. 21.5 mm

To add /hr just put that immediately after the named span in the html
Hi beteljuice,

Ok, your idea works but it doesn't flash when the ajax-dashboard.php file updates with mm! It should flash as mm/hr. The mm only flashes, at the moment.

Thanks for your help,

William
Post Reply