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
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
wbtag <#IsRaining>, where can I change the output value ?
-
wetterfrosch1971
- Posts: 123
- Joined: Sun 06 Apr 2014 1:15 pm
- Weather Station: wh1080
- Operating System: windows7
- Location: south-west-germany
wbtag <#IsRaining>, where can I change the output value ?
Hi,
webtag "<#IsRaining>"
is it possible to change the output value "1" into the word "it´s raining" and the output value "0" into the word "it´s dry" ?
when it is possible, where I can find the values ?
Thank you for help.
Frank
webtag "<#IsRaining>"
is it possible to change the output value "1" into the word "it´s raining" and the output value "0" into the word "it´s dry" ?
when it is possible, where I can find the values ?
Thank you for help.
Frank
- mcrossley
- Posts: 14388
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: wbtag <#IsRaining>, where can I change the output value
You could do it JavaScript in the client browser, or in PHP if you use that server side.
pecked out on my phone!
Code: Select all
<script>document.write(<#IsRaining>==0 ? "it's dry" : "it's raining");</script>
-
wetterfrosch1971
- Posts: 123
- Joined: Sun 06 Apr 2014 1:15 pm
- Weather Station: wh1080
- Operating System: windows7
- Location: south-west-germany
Re: wbtag <#IsRaining>, where can I change the output value
I want post on my Homepage:
"it´s raining" or "it´s dry"
or can I use the rain-rate webtag?
for post:
"no rain"
"little rain"
"strong rain"
"very stron rain"
etc...
I can not php or Java, becaus I´m only a user.
"it´s raining" or "it´s dry"
or can I use the rain-rate webtag?
for post:
"no rain"
"little rain"
"strong rain"
"very stron rain"
etc...
I can not php or Java, becaus I´m only a user.
- steve
- Cumulus Author
- Posts: 26672
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: wbtag <#IsRaining>, where can I change the output value
Note that the <#IsRaining> web tag only works if you have an RG11 rain sensor (as mentioned in the wiki) and it is set to 'it's raining' mode (apologies if you knew this and do have an RG-11). Otherwise, you will need to use the rain rate, as you suggest. So, for a simple yes/no, you could use:
For a more complicated version with several outcomes, you would need to use an if/else if/... construct.
Code: Select all
<script>document.write(<#rrate>==0 ? "it's dry" : "it's raining");</script>Steve
-
wetterfrosch1971
- Posts: 123
- Joined: Sun 06 Apr 2014 1:15 pm
- Weather Station: wh1080
- Operating System: windows7
- Location: south-west-germany
Re: wbtag <#IsRaining>, where can I change the output value
Code: Select all
<script>document.write(<#rrate>==0 ? "it's dry" : "it's raining");</script>I tried to change the script into
Code: Select all
<script>document.write(<#rrate>==0,0 ? "it's dry" : "it's raining");</script>what must I do?
Thank you for help.
Frank
- steve
- Cumulus Author
- Posts: 26672
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: wbtag <#IsRaining>, where can I change the output value
Ah, yes, good point. Javascript comparisons baffle me at times, and Javascript doesn't understand decimal commas. We really need Mark to give us the definitive answer, but this might work:
Code: Select all
<script>document.write('<#rrate>'==='0,0' ? "it's dry" : "it's raining");</script>Steve
-
wetterfrosch1971
- Posts: 123
- Joined: Sun 06 Apr 2014 1:15 pm
- Weather Station: wh1080
- Operating System: windows7
- Location: south-west-germany
Re: wbtag <#IsRaining>, where can I change the output value
yes, it works.
thank you.
thank you.
-
wetterfrosch1971
- Posts: 123
- Joined: Sun 06 Apr 2014 1:15 pm
- Weather Station: wh1080
- Operating System: windows7
- Location: south-west-germany
Re: wbtag <#IsRaining>, where can I change the output value
another question:
how must I write the script if I want only print "it´s raining" without "it´s dry"?
Thank you
how must I write the script if I want only print "it´s raining" without "it´s dry"?
Thank you
- mcrossley
- Posts: 14388
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: wbtag <#IsRaining>, where can I change the output value
Yes, that will be OK in this case.steve wrote:Ah, yes, good point. Javascript comparisons baffle me at times, and Javascript doesn't understand decimal commas. We really need Mark to give us the definitive answer, but this might work:
Code: Select all
<script>document.write('<#rrate>'==='0,0' ? "it's dry" : "it's raining");</script>
If you want a more general solution that will work with either dot or comma decimals I would use...
Code: Select all
<script>document.write('<#rrate>'.replace(',','.')==='0.0' ? "it's dry" : "it's raining");</script>Code: Select all
<script>document.write(parseFloat('0<#rrate>'.replace(',','.'))===0 ? "it's dry" : "it's raining");</script>- mcrossley
- Posts: 14388
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: wbtag <#IsRaining>, where can I change the output value
Try...wetterfrosch1971 wrote:another question:
how must I write the script if I want only print "it´s raining" without "it´s dry"?
Thank you
Code: Select all
if (parseFloat('0<#rrate>'.replace(',','.')) > 0) {document.write("it's raining");}-
wetterfrosch1971
- Posts: 123
- Joined: Sun 06 Apr 2014 1:15 pm
- Weather Station: wh1080
- Operating System: windows7
- Location: south-west-germany
Re: wbtag <#IsRaining>, where can I change the output value
Code: Select all
<script>document.write('<#rrate>'==='0,0' ? "it's dry" : "it's raining");</script>I will post a Image instead of the words "it´s raining" and "it´s dry"
the Images are on my webspace (for example http://www.webspaceXYZ.de/image-dry.jpg" and http://www.webspaceXYZ.de/image-rain.jpg").
how do I change the code?
many thanks for help
EDIT:
question has been done