Author Topic: wflexp.json and wflexpj.json rain numbers  (Read 1047 times)

0 Members and 1 Guest are viewing this topic.

Offline danielgwood

  • Member
  • *
  • Posts: 3
wflexp.json and wflexpj.json rain numbers
« on: June 09, 2022, 03:10:50 AM »
Hi everyone,

First off a quick thank-you - the wifilogger is a neat little device that has a lot of potential, love how easy it is to install and get going.

That said though I think I've found a bug. I'm attempting to use the wflexp.json (or the newer wflexpj.json) files to get realtime data from my Davis Vantage Vue. Based on posts in this forum and code on github, I've worked out what's what and it all matches what I can see on the console, and on the "Real Time Data" screen of WFL.

Except the "rainmon" and "rainyear" fields, which seem to be wrong. My assumption is these are supposed to represent Rain MTD and Rain YTD, the same as elsewhere. But, whilst my console says 52.60 for both of these, and the Real Time Data screen on WFL agrees, in the json exports it says "2.07086".

Are these supposed to be the totals for month/year, or something different?

Edit: I'm using a wifilogger v2, firmware updated to 2.41.

Offline WiFiLogger

  • Forecaster
  • *****
  • Posts: 731
Re: wflexp.json and wflexpj.json rain numbers
« Reply #1 on: June 09, 2022, 05:00:59 AM »
I have just checked my test unit with VUE console. All is fine, also in code I have checked that variables are proper.
Please note, that rain in JSON is also recalculated to INCHes.
Davis console is keeping rain as number of tips from tipping bucket. Then user is setting if on tip is 0.2mm, or 0.01inch. This is measuring volume of rain.
After that we have also setting for units, we can display this rain volume  in mm, or inch.
To the finish. I am recalculating any rain volume to inches, then I am preparing this JSON. There always can be bug in this recalculation, but I did not find any yet.

wflexpj.json - proper JSON format, numbers are numbers.
Code: [Select]
rainr":0.00000,"storm":0.00000,"rain15":0.00000,"rain1h":0.00000,"raind":0.00000,"rain24":0.00787,"rainmon":0.44094,"rainyear":42.29125,"etday":0.016,"etmon":0.31,"etyear":4.41
wflexp.json - old JSON format, numbers are strings(text).
Code: [Select]
"rainr":"0.00000","storm":"0.00000","rain15":"0.00000","rain1h":"0.00000","raind":"0.00000","rain24":"0.00787","rainmon":"0.44094","rainyear":"42.29125","etday":"0.016","etmon":"0.31","etyear":"4.41"

Offline danielgwood

  • Member
  • *
  • Posts: 3
Re: wflexp.json and wflexpj.json rain numbers
« Reply #2 on: June 09, 2022, 06:20:59 AM »
Obviously you are right, how incredibly dumb of me not to have thought of that. 2.07 inches converted to mm is of course 52.6. I guess when I had changed the settings in WFL to various metric units, I assumed the export data would be in the same units, but you know what they say about assuming.

Thank you for looking into it so quickly, and the really detailed response. Sorry for wasting your time!

Offline WiFiLogger

  • Forecaster
  • *****
  • Posts: 731
Re: wflexp.json and wflexpj.json rain numbers
« Reply #3 on: June 09, 2022, 06:31:46 AM »
Obviously you are right, how incredibly dumb of me not to have thought of that. 2.07 inches converted to mm is of course 52.6. I guess when I had changed the settings in WFL to various metric units, I assumed the export data would be in the same units, but you know what they say about assuming.

Thank you for looking into it so quickly, and the really detailed response. Sorry for wasting your time!

Exports from WiFilogger via JSONs are always in °F, mph, inch.
It is very easy to recalculate it to other units.
It is very hard to recognize what unit is on console, then hard to recognize what unit was exported.
If units are fixed to native console units, then everything is clear.

Please imagine you have website with database etc. Then you are connecting clients with differenets units. How you recognize those units? :-k

Offline danielgwood

  • Member
  • *
  • Posts: 3
Re: wflexp.json and wflexpj.json rain numbers
« Reply #4 on: June 09, 2022, 06:35:24 AM »
Yes, indeed! I am not criticising your decision at all, just explaining why I got it wrong :-)

Offline WiFiLogger

  • Forecaster
  • *****
  • Posts: 731
Re: wflexp.json and wflexpj.json rain numbers
« Reply #5 on: June 09, 2022, 06:36:56 AM »
I just wanted to say, why flexibility can make hard life :)
Fixed = stable

 

anything