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

Extra gauge on website

From Cumulus MX version 3 build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since, and has recently released Cumulus MX version 4. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
G6GUH
Posts: 88
Joined: Sat 23 Mar 2013 9:29 am
Weather Station: Davis VP2 Pro
Operating System: Windows 10
Location: Church Stretton, Shropshire

Extra gauge on website

Post by G6GUH »

I now have an extra temperature sensor in the green house, data is sent via an additional Davis 6332OV transmitter (same as iss transmitter). Data can be seen on the dashboard under extra sensor1, I would like to be able to display that data on my website. Can it be done and if so Help please!.
I and using the latest Cumulus MX release build 4028.

Any help appreciated.

Thanks Pete
User avatar
HansR
Posts: 6926
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Extra gauge on website

Post by HansR »

G6GUH wrote: Tue 03 Sep 2024 12:20 pm I now have an extra temperature sensor in the green house, data is sent via an additional Davis 6332OV transmitter (same as iss transmitter). Data can be seen on the dashboard under extra sensor1, I would like to be able to display that data on my website. Can it be done and if so Help please!.
I and using the latest Cumulus MX release build 4028.
Your title is about an extra gauge (not just display the value) so I will react to that: the gauges library (gauges.js) does not support two of the same gauges on a website/page.

Your webpage would contain a HTML code like below - taken from the interface - and you would call gauges.doTemp(this) to actually show the gauge. But there is no way of knowing for the gauges object to know which temperature gauge (if you would have two) it would need to handle. The gauges were not designed for multiple instances of the same gauge type.

Marks work stands for quite a few years now, but if you you like programming you might redesign the gauges to support multiple gauges of the same type and other features it contains. You would have to study the underlying steelseries libs. It is not an easy task and if I am mistaken no doubt somebody will correct me ;)

I managed to have two sets of wind gauges on one site but they display the same wind data and effectively they are two instances of the same object so that is slightly different. And that also was not trivial.

Code: Select all

                <div class="dash-unit" style="height:310px">
                    <span class="dtitle">Temperature</span>
                    <hr>
                    <div class="cont">
                        <div id="tip_0">
                            <canvas id="canvas_temp" width="221" height="221"></canvas>
                        </div>
                        <input id="rad_temp1" type="radio" name="rad_temp" value="out" onclick="gauges.doTemp(this);" checked ><label id="lab_temp1" for="rad_temp1">Outside</label>
                        <input id="rad_temp2" type="radio" name="rad_temp" value="in" onclick="gauges.doTemp(this);"><label id="lab_temp2" for="rad_temp2">Inside</label>
                    </div>
                </div>
Hans

https://meteo-wagenborgen.nl
CMX build 4070+ ● RPi 4B ● Linux 6.6.62+rpt-rpi-v8 aarch64 (bookworm) ● dotnet 8.0.1
BlueSky: https://bsky.app/profile/wagenborgenwx.bsky.social
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Extra gauge on website

Post by mcrossley »

It can be done - see my gauges page, I added an air quality gauge.

First edit the HTML and add the new structure for the guage:

Code: Select all

<div id="tip_12" class="gauge">
    <canvas id="canvas_aq" class="gaugeSizeStd" width="221" height="221" style="box-shadow: rgba(0, 0, 0, 0.3) 3px 3px 3px; border-radius: 110px;"></canvas>
</div>
Make the outer div "tip_NN", unique.
Make the canvas id unique, and preferably relevant to the content - I used "canvas_aq" above.

Edit gauages.js

Around line 192 the gauge objects are declared. Add aonther one to the list, gaugeAQ in my case:

Code: Select all

        gaugeTemp, gaugeDew, gaugeRain, gaugeRRate,
        gaugeHum, gaugeBaro, gaugeWind, gaugeDir,
        gaugeUV, gaugeSolar, gaugeCloud, gaugeRose,
        gaugeAQ,
Create the new gauge code, I suggest copying something like the Wind gauge as it only has a single value. So locate the "singleWind" function declaration at line 1740. Copy that and rename the copy single<MYVALUE> with a meaningful name.

Change all the lines that refer to '#canvas_wind' to whatever you called the canvas id in the HTML, so '#canvas_aq' in my example above.

Then in that function you need to go through and change things like the default min/max value, set the title and unit.
You will want to look at the temperature "singleTemp" function for some ideas here.

Then in the update() sub function, change the data source values etc, and remove the updateGraph() function.

Now you can go back up to around line 486 and create an instance of the new guage.
Add a line (using my AQ example again:

Code: Select all

guageAQ = single<MYVALUE>.getInstance();
Done, a new working gauge, simples :lol:
User avatar
HansR
Posts: 6926
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Extra gauge on website

Post by HansR »

:lol:
Hans

https://meteo-wagenborgen.nl
CMX build 4070+ ● RPi 4B ● Linux 6.6.62+rpt-rpi-v8 aarch64 (bookworm) ● dotnet 8.0.1
BlueSky: https://bsky.app/profile/wagenborgenwx.bsky.social
Post Reply