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 4019) - 03 April 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

RG-11 "Its Raining" Indicator

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
Fkinell
Posts: 13
Joined: Fri 31 Jan 2014 9:55 pm
Weather Station: WMR88
Operating System: WIN7, Linux, Windows server 2013
Location: Gloucestershire
Contact:

RG-11 "Its Raining" Indicator

Post by Fkinell »

Hi,
Is there a simple way of indicating the RG-11 "It's Raining" function, with in the SS Gauges layout, or in the current conditions web page?

I am sure I saw some where on the forum about conditional web page code, but can't find it. Or was it an .ini edit to display something? Even a Red radio button as on the Cumulus program would (sort of) suffice.

I would like to add some text/image to the current conditions page for when its raining, and also have an indicator on the SS-Gauge page.

I have looked and looked through the forum for hours to find an answer.

Please help
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: RG-11 "Its Raining" Indicator

Post by sfws »

Fkinell
Posts: 13
Joined: Fri 31 Jan 2014 9:55 pm
Weather Station: WMR88
Operating System: WIN7, Linux, Windows server 2013
Location: Gloucestershire
Contact:

Re: RG-11 "Its Raining" Indicator

Post by Fkinell »

Thanks sfws...

Next time I will spend hours looking through the Wiki :lol:

Should be able to get my RG-11 doing something with that lot.
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: RG-11 "Its Raining" Indicator

Post by mcrossley »

You could enable the 'userLed' on the rainfall rate or total rainfall gauge. (Without the RG-11 you could just use a non-zero value of rainfall rate to trigger the threshold LED on the rate gauge).

Anyway, you need to add the RG-11 value to the realtimegauges.txt file, then enable the userLed on the gauge of your choice, set it's colour (default Green) (both in the gauge initialisation), then set it's on/off status in the gauge update code. Some hints...

Enabling the userLed and setting the colour:

Code: Select all

drawRain function... 
                params.userLedVisible = true;
                params.userLedColor = steelseries.LedColor.RED_LED;
Setting the state:

Code: Select all

doRain function...
            _gaugeRain.setUserLedOnOff(<variable_holding_RG11_value>);

optionally you could make the LED blink as well...

            _gaugeRain.blinkUserLed(true);
Fkinell
Posts: 13
Joined: Fri 31 Jan 2014 9:55 pm
Weather Station: WMR88
Operating System: WIN7, Linux, Windows server 2013
Location: Gloucestershire
Contact:

Re: RG-11 "Its Raining" Indicator

Post by Fkinell »

Mark, thanks for that. I have managed to enable the led on the rain gauge, and have an entry (IsRaining) in the realtimeguages.text that changes from a 0 to a 1 when it rains.

I have tried to get the led to turn on and off, in the doRain function, but cannot figure out how. Does it need to be held in an if statement ? I tried it as a separate line, but that messes up the windrose etc.

I even tried to force it on by entering
_gaugeRain.setUserLedOnOff(1)

But let's be honest... I am totally out of my depth here. I have been trying to get it working since you replied earlier to be honest.

Any additional help for a total Java noob would be gratefully appreciated.
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: RG-11 "Its Raining" Indicator

Post by mcrossley »

Do you have a link to a test page with code in it?
Fkinell
Posts: 13
Joined: Fri 31 Jan 2014 9:55 pm
Weather Station: WMR88
Operating System: WIN7, Linux, Windows server 2013
Location: Gloucestershire
Contact:

Re: RG-11 "Its Raining" Indicator

Post by Fkinell »

er... I was actually trying to update my webpages live ... like the amateur that I am :oops:

From gauges.js I was trying to enter your "function" somewhere into

doRain = function () {
_rain.value = extractDecimal(data.rfall);

if (data.rainunit === 'mm') { // 10, 20, 30...
_rain.maxValue = Math.max(Math.ceil(_rain.value / 10) * 10, 10);
} else { .......
..... etc


The gauges web page is here http://www.skinell.webspace.virginmedia ... ges-ss.htm
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: RG-11 "Its Raining" Indicator

Post by mcrossley »

OK, I tried running _gaugeRain.setUserLedOnOff(true) and that switched on your LED, so the problem is you are supplying a 0 or 1 rather than a true/false value. Try this...

Code: Select all

            _gaugeRain.setValueAnimated(_rain.value);
            _gaugeRain.setUserLedOnOff(data.IsRaining==1);
Fkinell
Posts: 13
Joined: Fri 31 Jan 2014 9:55 pm
Weather Station: WMR88
Operating System: WIN7, Linux, Windows server 2013
Location: Gloucestershire
Contact:

Re: RG-11 "Its Raining" Indicator

Post by Fkinell »

Mark :clap: thank you so very much.

The RG-11 does indeed return a 0 or 1.

The led now works a treat. I love it.

At the risk or trying your patience, and pushing my luck. Is it easy to add a label to the LED as a hover or on the dial itself?


As it stands, its just great, and I am most pleased. :D

Thanks

Oh and thanks to sfws - I have an indicator on my index page too now :D
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: RG-11 "Its Raining" Indicator

Post by mcrossley »

Not easily. The gauge library does not support either of those options.
Post Reply