Hi all,

I have an extension, LoopData, that can be used to update weewx report web 
pages on each loop packet (of course, JavaScript is needed in the web pages).

I’ve tested it with US, METRIC and METRICWX databases targeting US and metric 
reports.

Alas, I have only tested it with the the RainWise CC3000 and IP100 drivers and 
the simulator.  I suspect there will be issues when other drivers are tried.

It’s been tried by a couple of people on weewx-users, but at this point, I’d 
prefer weewx-developers give it a try.

I would appreciate it if some of you could try it.  Running it just for a 
couple of loop cycles is fine—to see if the loop-data.txt file is being 
produced and to verify the contents of it look good.

The install sets loop_data_dir to/home/weewx/public_html (yes, it should use a 
symbolic here).  Change it as necessary.

The file is named loop-data.txt (by default).

Please note, one user complained, after installing many versions, that one 
version of loopdata broke his installation.  He’s since fixed his weewx.conf.  
I don’t believe the very simple install did that; but I feel it necessary to 
make you aware this.  If you do find this issue. Simply copy over the backup of 
weewx.conf that the install makes and restart.  (And of course, report the 
issue.)

The aim is for loop-data.txt to yield exactly what the JavaScript needs right 
out of the box.  Please let me know what issues you run into.

Install at head from https://github.com/chaunceygardiner/weewx-loopdata. 
Detailed installation instructions are there.

Details of LoopData
(BTW, credit to Gary for his great rtgd work that inspired this.)

To use LoopData, you pick a report to target (e.g., SeasonsReport) and then all 
scalar observations, along with day high (w/ time), low (w/time), average, 
weighted average and sums are available in a form appropriate for the report.  
That is, all of these are automatically converted and formatted to match the 
target report.  As such, if the SeasonsReport is targeted, and one changes 
windSpeed in the SeasonsReport to be in meters per second with three decimal 
places, windSpeed in the loop-data.txt file will also be in meters per second 
with three decimal places.  Formatting with a label is achieved simply by 
prepending FMT_ to the observation.  As such, FMT_SUM_rain would yield 
“FMT_SUM_rain”: “0.03 in” in loop-data.txt if .03 inches of rain fell today 
(even if the database was METRIC).

Of course, if all of this data would make for an enormous loop-data.txt file: 
<obs>, FMT_<obs>, SUM_<obs>, FMT_SUM_<obs>, AVG_<obs>, FMT_AVG_<obs> and so on 
and so forth).  As such, it is possible to only include what you are going to 
use.

For example:
   [[Include]]
        fields = dateTime, windSpeed, COMPASS_windDir, DESC_barometerRate, 
FMT_barometer, FMT_SUM_rain, FMT_dewpoint, FMT_heatindex, FMT_outHumidity, 
FMT_outTemp, FMT_rainRate, FMT_windchill, FMT_windSpeed, FMT_HI_windGust, 
FMT_10mMaxGust, pm2_5_aqi, pm2_5_aqic

Yields a loop-data.txt file containing the following.  This is assuming 
everything in the include is in the loop packet.  Anything not in the loop 
packet will, of course, not be present in loop-data.txt.

{"dateTime": 1593911456, "windSpeed": "4.4", "COMPASS_windDir": "N", 
"DESC_barometerRate": "Falling Slowly", "FMT_barometer": "29.965 inHg", 
"FMT_SUM_rain": "0.00 in", "FMT_dewpoint": "55.4\u00b0F", "FMT_heatindex": 
"88.2\u00b0F", "FMT_outHumidity": "33%", "FMT_outTemp": "88.2\u00b0F", 
"FMT_rainRate": "0.00 in/h", "FMT_windchill": "88.2\u00b0F", "FMT_windSpeed": 
"4.4 mph", "FMT_HI_windGust": "12.6 mph", "FMT_10mMaxGust": "9.1 mph", 
"pm2_5_aqi": "46", "pm2_5_aqic": "11204096"}

Please let me know if you were successful and/or any issues that arose.

Cheers,
John

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/C255B03F-8498-48D9-A7A2-0D5EEACEF6C1%40johnkline.com.

Reply via email to