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
UV colour depending on the number ie None Low Medium High Very High
Moderator: daj
- dazza1223
- Posts: 867
- Joined: Sun 25 Jan 2015 8:41 pm
- Weather Station: Davis Vantage Pro 2 plus
- Operating System: Raspberry pi 4 (4gb)
- Location: Worthing
- Contact:
UV colour depending on the number ie None Low Medium High Very High
im playing with a bit off js to get the UV band to chance colour depending on the number ie None Low Medium High Very High etc
var uv = rawdata[45];
if (uv=="0"){var uvword="None";} else
if (uv=="3"){var uvword="<span style=\"border: solid 1px; color: black; background-color: #A4CE6a;\"> Low </span>";} else
if (uv=="6"){var uvword="<span style=\"border: solid 1px; color: black; background-color: #FBEE09;\"> Medium </span>";} else
if (uv=="8"){var uvword= "<span style=\"border: solid 1px; color: black; background-color: #FD9125;\"> High </span>";} else
if (uv=="11"){var uvword="<span style=\"border: solid 1px; color: #FFFFFF; background-color: #F63F37;\"> Very High </span>";} else
{ var uvword="";}
$("#UVone").html(uvword);
but it seems to not work when i put this on test page
<td><span id="UVone"></span>
so i was wounding if some one can spot the error in this bit off code
thank you
var uv = rawdata[45];
if (uv=="0"){var uvword="None";} else
if (uv=="3"){var uvword="<span style=\"border: solid 1px; color: black; background-color: #A4CE6a;\"> Low </span>";} else
if (uv=="6"){var uvword="<span style=\"border: solid 1px; color: black; background-color: #FBEE09;\"> Medium </span>";} else
if (uv=="8"){var uvword= "<span style=\"border: solid 1px; color: black; background-color: #FD9125;\"> High </span>";} else
if (uv=="11"){var uvword="<span style=\"border: solid 1px; color: #FFFFFF; background-color: #F63F37;\"> Very High </span>";} else
{ var uvword="";}
$("#UVone").html(uvword);
but it seems to not work when i put this on test page
<td><span id="UVone"></span>
so i was wounding if some one can spot the error in this bit off code
thank you
- ConligWX
- Posts: 1645
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 24.04 LTS
- Location: Bangor, NI
- Contact:
Re: UV colour depending on the number ie None Low Medium High Very High
sorry cant help there but noticed on your site the website isn't updating correctly or your file checks are looking at the wrong data.
https://www.davisworthing.co.uk/uploadstatus.php
https://www.davisworthing.co.uk/uploadstatus.php
Regards Simon
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
-
- Posts: 1256
- Joined: Mon 09 Jul 2012 8:40 pm
- Weather Station: Davis VP2 Cabled
- Operating System: Windows 10 Pro
- Location: Auckland, New Zealand
- Contact:
Re: UV colour depending on the number ie None Low Medium High Very High
Both the Saratoga and MXUI templates have this feature managed by the ajaxCUwx.js and ajaxCUmx.js files respectively.
(MXUI borrows heavily from the original Saratoga ajax but also removes a lot and adds a lot more!)
If you view those templates that may help but just as likely confuse (as it did me!).
There are also Heat colour words in the Saratoga template.
(MXUI borrows heavily from the original Saratoga ajax but also removes a lot and adds a lot more!)
If you view those templates that may help but just as likely confuse (as it did me!).
There are also Heat colour words in the Saratoga template.
- dazza1223
- Posts: 867
- 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: UV colour depending on the number ie None Low Medium High Very High
Oh thank you I will take a look at that but thank you for spotting it outConligWX wrote: ↑Tue 31 May 2022 9:52 pm sorry cant help there but noticed on your site the website isn't updating correctly or your file checks are looking at the wrong data.
https://www.davisworthing.co.uk/uploadstatus.php
- dazza1223
- Posts: 867
- 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: UV colour depending on the number ie None Low Medium High Very High
Yh that where i found the piece of the code and modified it to my own JS file but it seem that it should work but there maybe a small little error somewhere I can't see but I know there's a lot more brainy people on here here can actually spot it out straight away?BCJKiwi wrote: ↑Tue 31 May 2022 10:18 pm Both the Saratoga and MXUI templates have this feature managed by the ajaxCUwx.js and ajaxCUmx.js files respectively.
(MXUI borrows heavily from the original Saratoga ajax but also removes a lot and adds a lot more!)
If you view those templates that may help but just as likely confuse (as it did me!).
There are also Heat colour words in the Saratoga template.
- mcrossley
- Posts: 12836
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: UV colour depending on the number ie None Low Medium High Very High
Code: Select all
var uv = rawdata[45];
if (uv=="0"){var uvword="None";} else
if (uv=="3"){var uvword="<span style=\"border: solid 1px; color: black; background-color: #A4CE6a;\"> Low </span>";} else
if (uv=="6"){var uvword="<span style=\"border: solid 1px; color: black; background-color: #FBEE09;\"> Medium </span>";} else
if (uv=="8"){var uvword= "<span style=\"border: solid 1px; color: black; background-color: #FD9125;\"> High </span>";} else
if (uv=="11"){var uvword="<span style=\"border: solid 1px; color: #FFFFFF; background-color: #F63F37;\"> Very High </span>";} else
{ var uvword="";}
$("#UVone").html(uvword);
- dazza1223
- Posts: 867
- 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: UV colour depending on the number ie None Low Medium High Very High
OK thanks mark will u be so kindly to adjust it so it will work?
- dazza1223
- Posts: 867
- 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: UV colour depending on the number ie None Low Medium High Very High
Code: Select all
var uv = rawdata[45];
if (uv=="0"){ uvword="None";} else
if (uv=="3"){ uvword="<span style=\"border: solid 1px; color: black; background-color: #A4CE6a;\"> Low </span>";} else
if (uv=="6"){ uvword="<span style=\"border: solid 1px; color: black; background-color: #FBEE09;\"> Medium </span>";} else
if (uv=="8"){ uvword= "<span style=\"border: solid 1px; color: black; background-color: #FD9125;\"> High </span>";} else
if (uv=="11"){ uvword="<span style=\"border: solid 1px; color: #FFFFFF; background-color: #F63F37;\"> Very High </span>";} else
{ uvword="";}
$("#UVone").html(uvword);
ok ive tried that but it seem to not being working?
-
- Posts: 2493
- Joined: Wed 08 Jun 2011 11:19 am
- Weather Station: Davis Vantage Pro 2 + Ecowitt
- Operating System: GNU/Linux Ubuntu 22.04 LXC
- Location: Alcaston, Shropshire, UK
- Contact:
Re: UV colour depending on the number ie None Low Medium High Very High
Do you need to declare uvword before the first if statement? Sorry, I'm not very au fait with javascript.
- mcrossley
- Posts: 12836
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: UV colour depending on the number ie None Low Medium High Very High
Yes it would be best to do that...
Code: Select all
var uv = rawdata[45];
var uvword;
if (uv=="0"){ uvword="None";} else
if (uv=="3"){ uvword="<span ...
- HansR
- Posts: 5994
- Joined: Sat 20 Oct 2012 6:53 am
- Weather Station: GW1100 (WS80/WH40)
- Operating System: Raspberry OS/Bookworm
- Location: Wagenborgen (NL)
- Contact:
Re: UV colour depending on the number ie None Low Medium High Very High
All true but I don't think it is the cause of failing.mcrossley wrote: ↑Tue 07 Jun 2022 2:11 pmYes it would be best to do that...
Code: Select all
var uv = rawdata[45]; var uvword; if (uv=="0"){ uvword="None";} else if (uv=="3"){ uvword="<span ...
Maybe @dazza could elaborate on what exactly fails? Does it show anything in the UVone element or does it show erroneous something?
As you compare strings is that truly the content of the rawdata or is it e.g. "0 " with as result the if statements all fail and you get an empty string in the html element. If uncertain add a console.log statement after each if-clause to see something.
Or go to stackoverflow.
Hans
https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
- HansR
- Posts: 5994
- Joined: Sat 20 Oct 2012 6:53 am
- Weather Station: GW1100 (WS80/WH40)
- Operating System: Raspberry OS/Bookworm
- Location: Wagenborgen (NL)
- Contact:
Re: UV colour depending on the number ie None Low Medium High Very High
Javascript is an invitation to bad programming
Hans
https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
-
- Posts: 2493
- Joined: Wed 08 Jun 2011 11:19 am
- Weather Station: Davis Vantage Pro 2 + Ecowitt
- Operating System: GNU/Linux Ubuntu 22.04 LXC
- Location: Alcaston, Shropshire, UK
- Contact:
Re: UV colour depending on the number ie None Low Medium High Very High
that's why I only touch it when necessary
You do not have the required permissions to view the files attached to this post.
- dazza1223
- Posts: 867
- Joined: Sun 25 Jan 2015 8:41 pm
- Weather Station: Davis Vantage Pro 2 plus
- Operating System: Raspberry pi 4 (4gb)
- Location: Worthing
- Contact: