On 04/03/2022, gjr80 <gjroder...@gmail.com> wrote: > Glenn, > > Have you had a chance to try the revised wee_import? I am working on a > number of other changes to the same piece of wee_import code and I would > prefer to do them all at once if possible.
Whoops. Sorry about that. It slid down the Todo list a little too far. ie;- I got somewhat sidetracked. Re-visiting this and I find I've either forgotten something critical, or it just plain doesn't work... I'm stll using the weewx.451 installation where I was developing this. I've fetched and replaced weeimport/weeimport.py as per your instructions. sudo bin/wee_import --import-config=/home/weewx/csv.conf --config=/home/weewx/weewx.conf --verbose --dry-run and I get the following error (with dry-run and without) ... Using WeeWX configuration file /home/weewx/weewx.conf Starting wee_import... A CSV import from source file '/var/tmp/weewxaddnotes.csv' has been requested. The following options will be used: config=/home/weewx/weewx.conf, import-config=/home/weewx/csv.conf source=/var/tmp/weewxaddnotes.csv, from=None, to=None dry-run=True, calc_missing=True, ignore_invalid_data=True tranche=250, interval=conf, date/time_string_format=%Y-%m-%d %H:%M:%S delimiter=',', rain=cumulative, wind_direction=[-360.0, 360.0] UV=False, radiation=False Using database binding 'wx_binding', which is bound to database 'weewx.sdb' Destination table 'archive' unit system is '0x10' (METRIC). Missing derived observations will be calculated. All WeeWX UV fields will be set to None. 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 ... Obtaining raw import data for period 1 ... Traceback (most recent call last): File "bin/wee_import", line 899, in <module> main() File "bin/wee_import", line 829, in main source_obj.run() File "/home/weewx451/bin/weeimport/weeimport.py", line 372, in run _raw_data = self.getRawData(period) File "/home/weewx451/bin/weeimport/csvimport.py", line 246, in getRawData self.map = self.parseMap('CSV', _csv_reader, self.csv_config_dict) File "/home/weewx451/bin/weeimport/weeimport.py", line 635, in parseMap and _val['units'] not in weewx.units.USUnits.values() \ AttributeError: 'ListOfDicts' object has no attribute 'values' The database field is named ANComment, the field I'm importing is named ANComment The attached files will show the full details. weewx.conf is unedited, it's a throw away installation. And, I've just cloned the wee_import_text branch - gives the same error. -- Cheers Glenn rorpi - read only raspberry pi & various weewx addons https://github.com/glennmckechnie -- 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 weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAAraAzj2c4S2ELHB8BrCLkR1poRLu_zCpg7K3pu8COOv76Bw-w%40mail.gmail.com.
sqlite> .headers on sqlite> .schema archive CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY, `usUnits` INTEGER NOT NULLnterval` INTEGER NOT NULL, `altimeter` REAL, `ANComment` TEXT, `appTemp` REAL, `appTemp1` REAL, ometer` REAL, `batteryStatus1` REAL, `batteryStatus2` REAL, `batteryStatus3` REAL, `batteryStatuREAL, `batteryStatus5` REAL, `batteryStatus6` REAL, `batteryStatus7` REAL, `batteryStatus8` REALloudbase` REAL, `co` REAL, `co2` REAL, `consBatteryVoltage` REAL, `dewpoint` REAL, `dewpoint1` R `ET` REAL, `extraHumid1` REAL, `extraHumid2` REAL, `extraHumid3` REAL, `extraHumid4` REAL, `extmid5` REAL, `extraHumid6` REAL, `extraHumid7` REAL, `extraHumid8` REAL, `extraTemp1` REAL, `extrp2` REAL, `extraTemp3` REAL, `extraTemp4` REAL, `extraTemp5` REAL, `extraTemp6` REAL, `extraTempEAL, `extraTemp8` REAL, `extraRain1` REAL, `extraRain2` REAL, `forecast` REAL, `hail` REAL, `haiteryStatus` REAL, `hailRate` REAL, `heatindex` REAL, `heatindex1` REAL, `heatingTemp` REAL, `heaVoltage` REAL, `humidex` REAL, `humidex1` REAL, `inDewpoint` REAL, `inHumidity` REAL, `inTemp` R `inTempBatteryStatus` REAL, `leafTemp1` REAL, `leafTemp2` REAL, `leafWet1` REAL, `leafWet2` REAlightning_distance` REAL, `lightning_disturber_count` REAL, `lightning_energy` REAL, `lightning_e_count` REAL, `lightning_strike_count` REAL, `luminosity` REAL, `maxSolarRad` REAL, `nh3` REAL,2` REAL, `noise` REAL, `o3` REAL, `outHumidity` REAL, `outTemp` REAL, `outTempBatteryStatus` REApb` REAL, `pm10_0` REAL, `pm1_0` REAL, `pm2_5` REAL, `pressure` REAL, `radiation` REAL, `rain` R `rainBatteryStatus` REAL, `rainRate` REAL, `referenceVoltage` REAL, `rxCheckPercent` REAL, `sig` REAL, `signal2` REAL, `signal3` REAL, `signal4` REAL, `signal5` REAL, `signal6` REAL, `signal7AL, `signal8` REAL, `snow` REAL, `snowBatteryStatus` REAL, `snowDepth` REAL, `snowMoisture` REALnowRate` REAL, `so2` REAL, `soilMoist1` REAL, `soilMoist2` REAL, `soilMoist3` REAL, `soilMoist4`L, `soilTemp1` REAL, `soilTemp2` REAL, `soilTemp3` REAL, `soilTemp4` REAL, `supplyVoltage` REAL,BatteryStatus` REAL, `UV` REAL, `uvBatteryStatus` REAL, `windBatteryStatus` REAL, `windchill` RE`windDir` REAL, `windGust` REAL, `windGustDir` REAL, `windrun` REAL, `windSpeed` REAL); sqlite>
ANComment-csv.conf
Description: Binary data
ANComment-weewx.conf
Description: Binary data
ANComment-weeimport.output
Description: Binary data
datetime, extratemp1, extratemp2, ANComment 1645966800.0,11.0,11.5,"test of wee_import text updates - backdated 2022-02-28 "