Flesh out all available/supported measurements
[infoex-autowx.git] / infoex-autowx.py
index 3d8762c81b58c97eeecc8af10583a835435801c9..78279f2672cdf0d1f0d2eec5d961a906836fb545 100755 (executable)
@@ -2,14 +2,15 @@
 # -*- coding: utf-8 -*-
 
 """
 # -*- coding: utf-8 -*-
 
 """
-InfoEx <-> NRCS Auto Wx implementation
+InfoEx <-> NRCS/MesoWest Auto Wx implementation
 Alexander Vasarab
 Wylark Mountaineering LLC
 
 Alexander Vasarab
 Wylark Mountaineering LLC
 
-Version 1.0.0
+Version 2.0.0
 
 
-This program fetches data from an NRCS SNOTEL site and pushes it to
-InfoEx using the new automated weather system implementation.
+This program fetches data from either an NRCS SNOTEL site or MesoWest
+weather station and pushes it to InfoEx using the new automated weather
+system implementation.
 
 It is designed to be run hourly, and it asks for the last three hours
 of data of each desired type, and selects the most recent one. This
 
 It is designed to be run hourly, and it asks for the last three hours
 of data of each desired type, and selects the most recent one. This
@@ -56,10 +57,12 @@ except:
     log.addHandler(handler)
 
 parser = OptionParser()
     log.addHandler(handler)
 
 parser = OptionParser()
+
 parser.add_option("--config",
     dest="config",
     metavar="FILE",
     help="location of config file")
 parser.add_option("--config",
     dest="config",
     metavar="FILE",
     help="location of config file")
+
 parser.add_option("--dry-run",
     action="store_true",
     dest="dry_run",
 parser.add_option("--dry-run",
     action="store_true",
     dest="dry_run",
@@ -189,10 +192,21 @@ if data['provider'] == 'nrcs':
     iemap['PREC'] = 'precipitationGauge'
     iemap['TOBS'] = 'tempPres'
     iemap['SNWD'] = 'hS'
     iemap['PREC'] = 'precipitationGauge'
     iemap['TOBS'] = 'tempPres'
     iemap['SNWD'] = 'hS'
+    iemap['PRES'] = 'baro'
+    iemap['RHUM'] = 'rH'
+    iemap['WSPD'] = 'windSpeedNum'
+    iemap['WDIR'] = 'windDirectionNum'
+    # unsupported by NRCS:
+    # windGustSpeedNum
 elif data['provider'] == 'mesowest':
     iemap['precip_accum'] = 'precipitationGauge'
     iemap['air_temp'] = 'tempPres'
     iemap['snow_depth'] = 'hS'
 elif data['provider'] == 'mesowest':
     iemap['precip_accum'] = 'precipitationGauge'
     iemap['air_temp'] = 'tempPres'
     iemap['snow_depth'] = 'hS'
+    iemap['pressure'] = 'baro'
+    iemap['relative_humidity'] = 'rH'
+    iemap['wind_speed'] = 'windSpeedNum'
+    iemap['wind_direction'] = 'windDirectionNum'
+    iemap['wind_gust'] = 'windGustSpeedNum'
 
 # floor time to nearest hour
 dt = datetime.datetime.now()
 
 # floor time to nearest hour
 dt = datetime.datetime.now()