Page 1 of 1
Lightning strikes download from Ecowitt
Posted: Sat 17 Jun 2023 11:50 am
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.
Re: Lightning strikes download from Ecowitt
Posted: Sat 17 Jun 2023 12:07 pm
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;
Re: Lightning strikes download from Ecowitt
Posted: Sat 17 Jun 2023 12:17 pm
by LindaFNM
Thanks very much for responding, much appreciated!! I thought the post was rubbish and asked for it to be removed

, 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.
Re: Lightning strikes download from Ecowitt
Posted: Sat 17 Jun 2023 10:04 pm
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.