lightmaster / Meteobridge-Weather34-Template

Github repository for the Meteobridge version of the weather34 template
Other
18 stars 10 forks source link

Zeros showing up in the mbchart data (add sanity check) #53

Closed spatenchb closed 5 years ago

spatenchb commented 5 years ago

Since, the last major update I have been seeing 0.00 values showing up in my chart files (june.csv and 2019.csv. Specifically, Minimum Temperature, Minimum Dewpoint and Minimum Barometer. The values are reported correctly in the respective Almanacs and in Meteobridge. I have been correcting them, but a sample is shown below.

Thanks,

Chuck Capture

lightmaster commented 5 years ago

These values are the minimum temp, dew, and pressure values. The only times I've seen zeros like that is when someone is having issues with their MB and it gets some invalid numbers that it decides to send out anyway. I'm trying to test out a check to make sure the pressure is not less than 100 MB, however my internet has been knocked out by a storm so my MB can't reliably report to my server and therefore I can't test it. Would you mind testing it to make sure it works good? mb.php.txt

spatenchb commented 5 years ago

Yes. Meteobridge did report the correct values - I have them listed below. In addition, The values were correct in the respective Almanacs. The only place I am seeing the 0 values are in the june.csv and the 2019.csv - which show up in the charts. I have also attached a MBrealtimeupload.txt Capture1

MBrealtimeupload.txt

lightmaster commented 5 years ago

ISP just finished fixing my internet, an issue 10 miles away and I was the only person to bother calling it in, 🙄

The CSV files are only used to power the charts since the normal MBs (any MB besides the Pro and NanoSD) don't have a way to keep a record of day to day mins and maxes. The Almanacs all get their data from the values in the API since all MBs keep the min/maxes of the current day, yesterday, current month, current year, and all-time records. Basically only thing those 0s would mess up is the charts. Fix those 0s by editing the files by hand (guessing you did already from the last screenshot). That hotfix I sent just adds a sanity check to make sure the pressure isn't 0, and therefore if there is a connectivity issue and the MB decides to send out data full of zero, the template will ignore that bad data.

If it isn't bad data and your pressure really is less than 100mb, you've got bigger things to worry about, lol.

lightmaster commented 5 years ago

Also, if you update with git pull, then when I push the update in a little bit, you'll need to issue this command first so the update will go through without git complaining: git checkout -- mbridge/mb.php && git pull

This just resets that file to what git expects it to be, then pulls down the update containing the fixed code.

spatenchb commented 5 years ago

You are lucky, i have seen ISPs take 24 hours to get things rolling again.

I have seen these zeros on a rare occasion after a Meteobridge reboot, but since the last big update it has shown up each day - always the same 3. I have edited the values every morning, since it does skew my charts. I have been looking through my data uploads to WU, Meso etc. but I have not been able to spot any bad data, so far.

Thanks for the warning. I normally just update all files manually.

I will see what it does over the nest few days.

Thanks,

Chuck

lightmaster commented 5 years ago

I don't believe anything has changed with the template that would effect weather or not data with 0s like this got through, until this proposed fix there's no sanity check on the data. Regardless, a simple sanity check on whether the pressure is less than 100mb is a good idea anyway. The few cases I've heard of having 0s in the data its always been these 3, likely for the same reason, receiving erroneous 0s from the MB. Temp can be 0C, but pressure can't be 0mb, so best to check by looking at pressure in my opinion.

lightmaster commented 5 years ago

Should be able to git pull the new update that includes this fix now.