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

Editing <#txbattery>

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

Moderator: daj

Post Reply
User avatar
krmidas
Posts: 215
Joined: Sat 03 Jul 2010 9:03 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10
Location: Lake Zurich, IL; USA
Contact:

Editing <#txbattery>

Post by krmidas »

The webtag for Davis transmitter battery status outputs a piece of text that gives the status of all 8 possible transmitters. Anyone know how can I edit this so it only displays the status of the first 2?

-Tom
Tom Keramidas, Lake Zurich, IL, USA
Image
User avatar
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: Editing <#txbattery>

Post by mcrossley »

Can you post an example of the string this tag outputs?
RayProudfoot
Posts: 3602
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: Editing <#txbattery>

Post by RayProudfoot »

Here you are Mark. Scroll down to the bottom. http://www.cheadlehulmeweather.co.uk/system.htm
Cheers,
Ray, Cheshire.

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

Re: Editing <#txbattery>

Post by steve »

Code: Select all

TX Battery Status: 1-ok 2-ok 3-ok 4-ok 5-ok 6-ok 7-ok 8-ok
It displays "ok" for transmitters which are missing, or are present with good batteries. I can't remember what it displays if a particular battery is low, possibly the string "LOW" instead of "ok".
Steve
User avatar
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: Editing <#txbattery>

Post by mcrossley »

Something like....?

Code: Select all

var val= "<#txbattery>".split(/\d-([a-z]+)/i);

//then...
//val[1] is status of battery #1
//val[3] is status of battery #2
//val[5] is status of battery #3
//val[7] is status of battery #4
//val[9] is status of battery #5
//etc
A bit messy, you could clean it up with two statements, or think of a more clever version!
Last edited by mcrossley on Tue 07 Aug 2012 6:08 pm, edited 1 time in total.
User avatar
krmidas
Posts: 215
Joined: Sat 03 Jul 2010 9:03 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10
Location: Lake Zurich, IL; USA
Contact:

Re: Editing <#txbattery>

Post by krmidas »

Excuse my ignorance, but does that entire string (customized for the transmitters I want to track--namely #1 and #2) replace the webtag?

-Tom
Tom Keramidas, Lake Zurich, IL, USA
Image
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Editing <#txbattery>

Post by steve »

I've added a 'channel' parameter to the <#txbattery> web tag, could you try it, please? It's just the cumulus.exe, zipped up: http://nybbles.co.uk/downloads/Cumulus.zip

Just extract the cumulus.exe file into your existing installation of 1.9.3

Use it like this:

<#txbattery channel=1>

to get the relevant string for channel 1, and so on, up to channel=8. The result is just the string "ok" or whatever the string is for a low battery.
Steve
RayProudfoot
Posts: 3602
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: Editing <#txbattery>

Post by RayProudfoot »

That seems to work okay Steve. I have two transmitters, one for the ISS and another for the anemometer. I presume the ISS is 1 and the ane no 2?

http://www.cheadlehulmeweather.co.uk/system.htm
Cheers,
Ray, Cheshire.

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

Re: Editing <#txbattery>

Post by steve »

RayProudfoot wrote:That seems to work okay Steve.
Thanks.
I have two transmitters, one for the ISS and another for the anemometer. I presume the ISS is 1 and the ane no 2?
It would depend on what you've set them to on the dip switches, they could be either way around.
Steve
User avatar
krmidas
Posts: 215
Joined: Sat 03 Jul 2010 9:03 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10
Location: Lake Zurich, IL; USA
Contact:

Re: Editing <#txbattery>

Post by krmidas »

This sounds great. I'll try it out when I'm home tonight!

Many thanks.
Tom Keramidas, Lake Zurich, IL, USA
Image
RayProudfoot
Posts: 3602
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: Editing <#txbattery>

Post by RayProudfoot »

steve wrote:It would depend on what you've set them to on the dip switches, they could be either way around.
I think from memory the ISS is 1 and the anemometer tx 2 but I will check.
Cheers,
Ray, Cheshire.

Image
User avatar
krmidas
Posts: 215
Joined: Sat 03 Jul 2010 9:03 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10
Location: Lake Zurich, IL; USA
Contact:

Re: Editing <#txbattery>

Post by krmidas »

Capture.JPG
Worked like a charm! Thanks for that lightning quick enhancement!
You do not have the required permissions to view the files attached to this post.
Tom Keramidas, Lake Zurich, IL, USA
Image
Post Reply