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

Lost sensor contact webtag

Discussion specific to Fine Offset and similar rebadged weather stations
werribee_au
Posts: 338
Joined: Mon 08 Jun 2009 6:25 am
Weather Station: WH-1081 (Jaycar Digitech XC0348)
Operating System: XP SP3
Location: Wyndham Vale, Vic, Australia.
Contact:

Lost sensor contact webtag

Post by werribee_au »

<#sensorcontactlost> webtag is listed as all lower case in the help file and the "webtag" page, but in the wiki "realtime.txt" page it is listed as <#SensorContactLost> (Note the upper case S, C & L).

The Wiki realtime.txt page lists the description as;
"If the station has lost contact with its remote sensors "Fine Offset only", a Flag number is given (1 = Yes, 0 = No)"
So i would expect a "1" for ok or "0" for lost.

In the help file:
"1 if the station has lost contact with its remote sensors (Fine Offset only)"

And the Wiki webtags page:
"1 if the station has lost contact with its remote sensors "Fine Offset only" 0 if contact has been established"

I can't get<#sensorcontactlost> to work where as <#SensorContactLost> does work and produces zero normally.

Are there 2 webtags or is there only the one, which I suspect as being <#SensorContactLost>
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Lost sensor contact webtag

Post by Synewave »

The correct tag is <#SensorContactLost>.

Read it as a question, i.e. Sensor Contact Lost? 1=yes, 0=no.

So normal conditions it will be 0.
werribee_au
Posts: 338
Joined: Mon 08 Jun 2009 6:25 am
Weather Station: WH-1081 (Jaycar Digitech XC0348)
Operating System: XP SP3
Location: Wyndham Vale, Vic, Australia.
Contact:

Re: Lost sensor contact webtag

Post by werribee_au »

Thanks Paul,

I thought that was the case just needed some confirmation.
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Lost sensor contact webtag

Post by Synewave »

You're welcome. I like your site by the way.

I see you've used some Javascript to translate the Sensor Contact Lost status into words. You could always replace that with an image, for example a green dot for OK and a red dot for not OK.

Just name two images sensor_1.jpg (a red one) and sensor_0.jpg (a green one) or whatever pic format you want to use. Then upload them to your images folder.

Then replace the Javascript with this:

Code: Select all

<script type="text/javascript">
var sensor = <#SensorContactLost>;
if (sensor==0){
	var imagen = "sensor_0.jpg";
	}
if (sensor==1){
	var imagen = "sensor_1.jpg";
	}
document.write('<img src="images/'+imagen+'"/>');
</script>
But you probably know all this anyway. ;)
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: Lost sensor contact webtag

Post by steve »

To be honest, I wasn't actually sure whether the web tags were case sensitive or not; in general, Delphi is not a case-sensitive language. As a result I've been inconsistent in my naming of the tags; some are all lower case, and some are PascalCase. I can confirm, that this particular one is "SensorContactLost" in the code. I'll see if I can easily make them all case insensitive.
Steve
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Lost sensor contact webtag

Post by beteljuice »

Codingwise ... as an aside.

1/ a simple non-JavaScript option is available.

2/ There is (in this case) no need to declare a variable to a variable.

Code: Select all

<!-- sensor_0.jpg = Station On-Line -->
<!-- sensor_1.jpg = External Sensors lost -->

<!-- Non JavaScript -->

<img src = "images/sensor_<#SensorContactLost>.jpg" />

<!-- JavaScript with mouseOver -->
<script type="text/javascript">
if (<#SensorContactLost> == 1){
   var imagen = "sensor_1.jpg";
   var msg = "External Sensors NOT responding !";
} else {
   var imagen = "sensor_0.jpg";
   var msg = "Station functioning OK";
}
document.write('<img src=\"images/' +imagen+ ' title=\"' +msg+ '\" alt= \"' +msg+ '\" />');
</script>

Of course there are several ways the JavaScript could be written :? and in both cases it would be better to state <img ..... height=xx width=xx />
Image
......................Imagine, what you will KNOW tomorrow !
werribee_au
Posts: 338
Joined: Mon 08 Jun 2009 6:25 am
Weather Station: WH-1081 (Jaycar Digitech XC0348)
Operating System: XP SP3
Location: Wyndham Vale, Vic, Australia.
Contact:

Re: Lost sensor contact webtag

Post by werribee_au »

Thanks for the replies,

Ah, the same webtag but case sensitive, No wonder I was not getting a result.

As for the coding suggestions, you know I'm going to pick your brains until they hurt. :bash: Don't you :lol:

I'll look at doing something after the weekend (got a wing ding (combined 69th & 50th) to set up for Sunday so I'm busy doing things)

Thanks
Gerard
werribee_au
Posts: 338
Joined: Mon 08 Jun 2009 6:25 am
Weather Station: WH-1081 (Jaycar Digitech XC0348)
Operating System: XP SP3
Location: Wyndham Vale, Vic, Australia.
Contact:

Re: Lost sensor contact webtag

Post by werribee_au »

Got it done, thanks for your suggestions and advice.
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Lost sensor contact webtag

Post by Synewave »

Looks good. We all have different ways of achieving an end result. Beteljuice has much more experience than me and always provides the easiest solution. My solution was logical but maybe not the tidyest.

Don't worry about picking our brains, that's what this wonderful forum is for.
werribee_au
Posts: 338
Joined: Mon 08 Jun 2009 6:25 am
Weather Station: WH-1081 (Jaycar Digitech XC0348)
Operating System: XP SP3
Location: Wyndham Vale, Vic, Australia.
Contact:

Re: Lost sensor contact webtag

Post by werribee_au »

Tidy html? I wouldn't know it if it fell on me. :lol:

I sort of get by, self taught from the C64 days:
10 PRINT "Hello"
20 GOTO 10
:lol:

Actually it took me a while to get the beteljuice document.write to work, finally worked it out.

document.write('<img src=\"images/' +imagen+ ' title=\"' +msg+ '\" alt= \"' +msg+ '\" />');
________________________________________^__________________________________
Missing close quote, took me 1/2 an hour to notice it :bash: Worked a treat after that.

Maybe beteljuice was testing me ;)
neil
Posts: 71
Joined: Sat 10 Jan 2009 8:36 pm
Weather Station: Maplin N96FY (WH1081)
Operating System: Windows 10
Location: Broadstairs, Kent
Contact:

Re: Lost sensor contact webtag

Post by neil »

Nice site
I noticed you are having problems with the guestbook
try looking up the following
http://www.dbscripts.net/guestbook/
I use it on my site & so far I have had no problems
Neil
Thanetweather home page http://www.thanetweather.co.uk
werribee_au
Posts: 338
Joined: Mon 08 Jun 2009 6:25 am
Weather Station: WH-1081 (Jaycar Digitech XC0348)
Operating System: XP SP3
Location: Wyndham Vale, Vic, Australia.
Contact:

Re: Lost sensor contact webtag

Post by werribee_au »

Thanks Neil,

I'll have a look at the url. :)
scoobs
Posts: 82
Joined: Mon 23 Mar 2009 2:50 pm
Weather Station: WH3080
Operating System: Windows server
Location: Skegness

Re: Lost sensor contact webtag

Post by scoobs »

Duno if its just me or maybe you have missed something in html.

If i look at your page with ff i get 20.6 °C &nbsp-1.5/hr shown on the temp.

If i use IE it shows ok but when i move the mouse over everything gets underlined.

Only on the index.html
Image
werribee_au
Posts: 338
Joined: Mon 08 Jun 2009 6:25 am
Weather Station: WH-1081 (Jaycar Digitech XC0348)
Operating System: XP SP3
Location: Wyndham Vale, Vic, Australia.
Contact:

Re: Lost sensor contact webtag

Post by werribee_au »

I also noticed this yesterday when I used FF. I forgot the ";" at the end of "nbsp" :oops: , it is there now.

Thanks for the reminder scoobs :)

Isn't it interesting that GC knew what I meant but FF showed exactly as it should have.
scoobs
Posts: 82
Joined: Mon 23 Mar 2009 2:50 pm
Weather Station: WH3080
Operating System: Windows server
Location: Skegness

Re: Lost sensor contact webtag

Post by scoobs »

seems ok in FF now still getting everything underlined in IE :D
Image
Post Reply