weewx  rpm
Name        : weewx 
Version     : 4.5.1 
Release     : 1.el8

os fedora 34

atlas-config.conf attached
wee_import --import-config atlas-import.conf --dry-run
i get this error

Using WeeWX configuration file /etc/weewx/weewx.conf
Starting wee_import...
A CSV import from source file '/tmp/data.csv' has been requested.
Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
Destination table 'archive' unit system is '0x01' (US).
Missing derived observations will be calculated.
All WeeWX radiation fields will be set to None.
This is a dry run, imported data will not be saved to archive.
Starting dry run import ...
Traceback (most recent call last):
  File "/usr/share/weewx/wee_import", line 903, in <module>
    main()
  File "/usr/share/weewx/wee_import", line 833, in main
    source_obj.run()
  File "/usr/share/weewx/weeimport/weeimport.py", line 402, in run
    _mapped_data = self.mapRawData(_raw_data, self.archive_unit_sys)
  File "/usr/share/weewx/weeimport/weeimport.py", line 920, in mapRawData
    weewx.units.obs_group_dict[_field])
  File "/usr/lib64/python3.9/collections/__init__.py", line 941, in 
__getitem__
    return self.__missing__(key)            # support subclasses that 
define __missing__
  File "/usr/lib64/python3.9/collections/__init__.py", line 933, in 
__missing__
    raise KeyError(key)
KeyError: 'luminosity'

if i add luminosity to units.py with group_illuminance it works
if i change luminosity to illuminance in the config file it works but then 
have to change the database too
i don't thing wee_import is using the in use schema

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" 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-user/18563921-fee0-4d9b-a727-26285eda90can%40googlegroups.com.
# EXAMPLE WEE_IMPORT CONFIGURATION FILE
#
# Copyright (c) 2009-2016 Tom Keffer <[email protected]>
# See the file LICENSE.txt for your rights.

##############################################################################

# Specify the source. Available options are:
#   CSV - import obs from a single CSV format file
#   WU - import obs from a Weather Underground PWS history
#   Cumulus - import obs from a one or more Cumulus monthly log files
# Format is:
#   source = (CSV | WU | Cumulus | WD)
source = CSV

##############################################################################

[CSV]
    # Parameters used when importing from a CSV file

    # Path and name of our CSV source file. Format is:
    #   file = full path and filename
    file = /tmp/data.csv

    # If there is no mapped interval field how will the interval field be
    # determined for the imported records. Available options are:
    #   derive - Derive the interval field from the timestamp of successive
    #            records. This setting is best used when the imported records
    #            are equally spaced in time and there are no missing records.
    #   conf   - Use the interval setting from weewx.conf. This setting is
    #            best used if the records to be imported have been produced by
    #            WeeWX using the same archive interval as set in weewx.conf on
    #            this machine.
    #   x      - Use a fixed interval of x minutes for every record. This
    #            setting is best used if the records to be imported are
    #            equally based in time but there are some missing records.
    #
    # Note: If there is a mapped interval field then this setting will be
    #       ignored.
    # Format is:
    #   interval = (derive | conf | x)
    interval = 5

    # Should the [StdQC] max/min limits in weewx.conf be applied to the
    # imported data. This may be useful if the source has extreme values that
    # are clearly incorrect for some observations. Available options are:
    #   True  - weewx.conf [StdQC] max/min limits are applied.
    #   False - weewx.conf [StdQC] max/min limits are not applied.
    # Format is:
    #   qc = (True | False)
    qc = True

    # Should any missing derived observations be calculated from the imported
    # data if possible. Available options are:
    #   True  - Any missing derived observations are calculated.
    #   False - Any missing derived observations are not calculated.
    # Format is:
    #   calc_missing = (True | False)
    calc_missing = True

    # Imported records are written to archive in transactions of tranche
    # records at a time. Increase for faster throughput, decrease to reduce
    # memory requirements. Format is:
    #   tranche = x
    # where x is an integer
    tranche = 250

    # Specify whether a UV sensor was used to produce any UV observations.
    # Available options are:
    #   True  - UV sensor was used and UV data will be imported.
    #   False - UV sensor was not used and any UV data will not be imported.
    #           UV fields will be set to None/NULL.
    # For a CSV import UV_sensor should be set to False if a UV sensor was
    # NOT present when the import data was created. Otherwise it may be set to
    # True or omitted. Format is:
    #   UV_sensor = (True | False)
    UV_sensor = True

    # Specify whether a solar radiation sensor was used to produce any solar
    # radiation observations. Available options are:
    #   True  - Solar radiation sensor was used and solar radiation data will
    #           be imported.
    #   False - Solar radiation sensor was not used and any solar radiation
    #           data will not be imported. radiation fields will be set to
    #           None/NULL.
    # For a CSV import solar_sensor should be set to False if a solar radiation
    # sensor was NOT present when the import data was created. Otherwise it may
    # be set to True or omitted. Format is:
    #   solar_sensor = (True | False)
    solar_sensor = False

    # Date-time format of CSV field from which the WeeWX archive record
    # dateTime field is to be extracted. wee_import first attempts to interpret
    # date/time info in this format, if this fails it then attempts to
    # interpret it as a timestamp and if this fails it then raises an error.
    # Uses Python strptime() format codes.
    # raw_datetime_format = Python strptime() format string
    raw_datetime_format = %Y/%m/%d %I:%M %p

    # Does the imported rain field represent the total rainfall since the last
    # record or a cumulative value. Available options are:
    #   discrete   - rain field represents total rainfall since last record
    #   cumulative - rain field represents a cumulative rainfall reset at
    #                midnight
    # rain = (discrete | cumulative)
    rain = cumulative

    # Lower and upper bounds for imported wind direction. It is possible,
    # particularly for a calculated direction, to have a value (eg -45) outside
    # of the WeeWX limits (0 to 360 inclusive). Format is:
    #
    # wind_direction = lower,upper
    #
    # where :
    #   lower is the lower limit of acceptable wind direction in degrees
    #   (may be negative)
    #   upper is the upper limit of acceptable wind direction in degrees
    #
    # Imported values from lower to upper will be normalised to the range 0 to
    # 360. Values outside of the parameter range will be stored as None. Default
    # is -360,360.
    wind_direction = -360,360

    # Map CSV record fields to WeeWX archive fields. Format is:
    #
    #   weewx_archive_field_name = csv_field_name, weewx_unit_name
    #
    # where:
    #   weewx_archive_field_name - An observation name in the WeeWX database
    #                              schema.
    #   csv_field_name           - The name of a field from the CSV file.
    #   weewx_unit_name          - The name of the units, as defined in WeeWX,
    #                              used by csv_field_name. This value represents
    #                              the units used for this field in the CSV
    #                              file, wee_import will do the necessary
    #                              conversions to the unit system used by the
    #                              WeeWX archive.
    # For example,
    #   outTemp = Temp, degree_C
    # would map the CSV field Temp, in degrees C, to the archive field outTemp.
    #
    # If a field mapping exists for the WeeWX usUnits archive field then the
    # units option may be omitted for each mapped field.
    #
    # WeeWX archive fields that do not exist in the CSV data may be omitted. Any
    # omitted fields that are derived (eg dewpoint) may be calculated during
    # import using the equivalent of the WeeWX StdWXCalculate service through
    # setting the calc-missing parameter above.
    [[FieldMap]]
        dateTime    = Timestamp, unix_epoch

        outTemp     = Temperature ( F ), degree_F
        outHumidity = Humidity ( RH ), percent
        dewpoint    = Dew Point ( F ), degree_F
        heatindex   = Heat Index ( F ), degree_F
        appTemp     = Feels Like ( F ), degree_F
        windchill   = Wind Chill ( F ), degree_F
        barometer   = Barometric Pressure ( INHG ), inHg
        rain        = Accumulated Rain ( IN ), inch
        windSpeed   = Wind Speed ( MPH ), mile_per_hour
        windDir     = Wind Direction, degree_compass
        UV          = UV Index, uv_index
        luminosity  = Light Intensity ( LUX ), lux
        lightning_strike_count = Lightning Strike Count, count
        lightning_distance = Lightning Closest Strike Distance ( MI ), mile

############# notes to self ###########################
# change luminosity to illuminance here and database luminosity to illuminance
# or just add luminosity to units.py

#        rainRate    = rate, inch_per_hour
#        illuminance = Light Intensity ( LUX ), lux
#        usUnits     =
#        luminosity = Light Intensity ( LUX ), lux
#        measuredlight = Measured Light ( SEC )

##############################################################################

Reply via email to