Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.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

Trend arrow Javascript

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

Moderator: daj

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

Re: Trend arrow Javascript

Post by steve »

Yes, that too. My slightly autistic nature only lets me process one problem at a time :lol:
Steve
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Trend arrow Javascript

Post by mcrossley »

Ditto - I hadn't spotted the decimal issue! :lol:
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Trend arrow Javascript

Post by steve »

steve wrote:You can use the web tags which replace the comma with a decimal point,
Actually, there doesn't seem to be one for temperature trend. The standard gauges page uses <#temptrendtext> and <#temptrendtextenglish>
Steve
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Trend arrow Javascript

Post by mcrossley »

Which is why is it easier to reanme the images steady.png, rising.png, falling.png and then just use...

Code: Select all

<img src="xxxxx\<#temptrendtextenglish>.png" alt="<#temptrendextenglish>" />
(typing on a wobbly train - apologies for mistakes)
corsair
Posts: 5
Joined: Tue 09 Nov 2010 10:38 am
Weather Station: Davis Vantage Pro 2
Operating System: Win Seven

Re: Trend arrow Javascript

Post by corsair »

mcrossley wrote:Which is why is it easier to reanme the images steady.png, rising.png, falling.png and then just use...

Code: Select all

<img src="xxxxx\<#temptrendtextenglish>.png" alt="<#temptrendextenglish>" />
(typing on a wobbly train - apologies for mistakes)
Did the rename to www, no luck! Sorry but I don't understand this... How can I use it? Strange thing that I use same syntax from Station Sensor Led, few lines below, that works perfect...
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Trend arrow Javascript

Post by steve »

Because of this (my very first answer).

var temp = +1,5;
Steve
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Trend arrow Javascript

Post by Synewave »

Corsair,

As Mark and Steve have said, it is probably better to use the <#temptrendtext> as the comma as the decimal seperator will cause it to fail. You could write some Javascript to replace the , with a . but this way will be much easier:

Locate this line in your indexT.htm file:

Code: Select all

<td><#temp>&nbsp;<#tempunit></td>
and replace it with:

Code: Select all

<td><#temp>&nbsp;<#tempunit> <img src="images/<#temptrendtext>.png" alt="<#temptrendext>" /></td>
You will also need to rename your up and down arrow images as follows:

up.png becomes Rising.png
down.png becomes Falling.png

These images will need to be in your images folder on your website.
corsair
Posts: 5
Joined: Tue 09 Nov 2010 10:38 am
Weather Station: Davis Vantage Pro 2
Operating System: Win Seven

Re: Trend arrow Javascript

Post by corsair »

THANK YOU, all for your instructions... With Paul's step by step info, I manage it! Thank you Paul! BTW, excellent site! Great job for Great College!! :clap: :clap: If you don't mind, I will ask you for more info about History data in your page!
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Trend arrow Javascript

Post by Synewave »

Corsair,

Glad to see you've got it working. Just had a look at your images folder, although I didn't say so before, you will also need a Steady.png file in your images folder.

Thanks for the compliment about my website.
corsair
Posts: 5
Joined: Tue 09 Nov 2010 10:38 am
Weather Station: Davis Vantage Pro 2
Operating System: Win Seven

Re: Trend arrow Javascript

Post by corsair »

Thank you again Paul. Was there but with small "s"... :lol: Good morning from sunny :evil: Athens
mitmania
Posts: 37
Joined: Tue 07 Feb 2012 11:51 am
Weather Station: WS2350 & Davis VP2
Operating System: Win 7
Location: Italy
Contact:

Re: Trend arrow Javascript

Post by mitmania »

Hi .... wonder where he constantly make mistakes ... I rewrote the same code 10 times but I do not see anything on Safari or Chrome .... thanks!

<!-- Temperatura_1_linea -->
<tr class="td_temperature_data">
<td><font size="2">Temperatura esterna</font></td>
<td><#temp>&nbsp;<#tempunit><script type="text/javascript">
var temp = <#temptrend>;
if (temp==0){var imagen = "steady.bmp";}
if (temp>0){var imagen = "up.bmp";}
if (temp<0){var imagen = "down.bmp";}
document.write('<img src="http://piavemeteo.altervista.org/images/'+imagen+'"/>');
</script></td>
<td><font size="2">Dew point</font></td>
<td><#dew>&nbsp;<#tempunit></td>
</tr>
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: Trend arrow Javascript

Post by beteljuice »

Because of all the comments above !!!!!

Currently your Cumulus processed script says:
var temp = -1,7;

COMMA decimal delimiter .....
So the maths comparrisons do not work correctly.

As above, use #temptrendenglish method instead.
Image
......................Imagine, what you will KNOW tomorrow !
mitmania
Posts: 37
Joined: Tue 07 Feb 2012 11:51 am
Weather Station: WS2350 & Davis VP2
Operating System: Win 7
Location: Italy
Contact:

Re: Trend arrow Javascript

Post by mitmania »

Ok !!!!!!!!
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Trend arrow Javascript

Post by dazza1223 »

Can i use them so it auto refresh the icon with out refresh the page to get the icon to up date
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
Post Reply