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

Lightning strikes download from Ecowitt

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. 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
LindaFNM
Posts: 168
Joined: Wed 06 Jan 2021 3:01 pm
Weather Station: Ecowitt
Operating System: Raspberry Pi

Lightning strikes download from Ecowitt

Post by LindaFNM »

I’m experimenting with Custom logs for lightning. My number of strikes using the webtag is blank, not 0.

The issue I’m having is that I have an incorrect value in Ecowitt that I can do nothing about, I’ve tried amending today.ini but any time that I have a ‘catch-up’ if the daily strike is 0, it’s being recorded by CMX as -1 which is then being left blank in the log. How can I get round this please, and should the value be -1? Thanks very much.
Mapantz
Posts: 1992
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Lightning strikes download from Ecowitt

Post by Mapantz »

I had this issue when I first started using the lightning detector with CMX.

That number will obviously change when you next get a lightning strike recorded, however, it's normal. The only thing you can do (which I did) is add a little bit of code to format it neater.

For example, I'm using Javascript to obtain all of my 'real time' data from an XML file, including the lightning data.

LightningDistance is being processed from the webtag <#LightningDistance>

And I check to look for -1.0 and -- and then replace it with it ---

Code: Select all

  var LastDistance = x.getElementsByTagName("LightningDistance")[0].childNodes[0].nodeValue;
  if (LastDistance == -1.0 || LastDistance == "--") { lstd = "---"; } else { lstd = LastDistance; }
<#LightningTime> webtag can also error (rarely) it will show NaN Seconds ago

I also added a check for that as well.

Code: Select all

  if (timeSince(LightningTime) == "NaN Second ago") { ltime = "---"; } else { ltime = timeSince(LightningTime); }
  document.getElementById("LightningTime").innerHTML = ltime;
Image
LindaFNM
Posts: 168
Joined: Wed 06 Jan 2021 3:01 pm
Weather Station: Ecowitt
Operating System: Raspberry Pi

Re: Lightning strikes download from Ecowitt

Post by LindaFNM »

Thanks very much for responding, much appreciated!! I thought the post was rubbish and asked for it to be removed :lol: , maybe not.

I’m afraid xml is way beyond me, it may not be after I’ve had the time to start learning more, but I’m very much at idiot level here. Until I can get more advanced, the idea was just to capture the data so at least I can do something. For the minute, I’ll have to leave the gaps with the implication that they’re 0.

With the info you’ve provided, I can start looking at JavaScript. Last winters project was html, this winter it’ll be more advanced queries etc. Your website is very informative.
Mapantz
Posts: 1992
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Lightning strikes download from Ecowitt

Post by Mapantz »

If you're processing webtags and having the data uploaded to a webpage, you could easily do the checks with PHP instead?! That would probably work out a better option for you.
Image
Post Reply