Ich habe ein Update auf die Version 5.1.0 gemacht und anschließend den Import mit deiner csv-wswin5.conf ausgeführt.
Code: Alles auswählen
sudo weectl import --config /etc/weewx1/weewx.conf --import-config /etc/weewx/import/csv-wswin5.conf --verbose
Using configuration file /etc/weewx1/weewx.conf
Starting weectl import...
A CSV import from source file '/etc/weewx/daten.csv' has been requested.
The following options will be used:
config=/etc/weewx1/weewx.conf, import-config=/etc/weewx/import/csv-wswin5.conf
source=/etc/weewx/daten.csv, from=None, to=None
dry-run=False, calc_missing=True, ignore_invalid_data=True
tranche=250, interval=5, date/time_string_format=%d.%m.%Y %H:%M
delimiter='[]', rain=discrete, wind_direction=[1.0, 360.0]
UV=True, radiation=True
Using database binding 'wx_binding', which is bound to database 'weewx_eco.sdb'
Destination table 'archive' unit system is '0x11' (METRICWX).
The following imported field-to-WeeWX field map will be used:
source field 'Date' in units 'unix_epoch' --> WeeWX field 'dateTime'
source field '133' in units 'mbar' --> WeeWX field 'barometer'
source field '1' in units 'degree_C' --> WeeWX field 'inTemp'
source field '2' in units 'degree_C' --> WeeWX field 'outTemp'
source field '17' in units 'percent' --> WeeWX field 'inHumidity'
source field '18' in units 'percent' --> WeeWX field 'outHumidity'
source field '35' in units 'km_per_hour' --> WeeWX field 'windSpeed'
source field '36' in units 'degree_compass' --> WeeWX field 'windDir'
source field '45' in units 'km_per_hour' --> WeeWX field 'windGust'
source field '96' in units 'degree_compass' --> WeeWX field 'windGustDir'
source field '34' in units 'mm' --> WeeWX field 'rain'
(source field '34' will be treated as a cumulative value)
source field '40' in units 'mm' --> WeeWX field 'ET'
source field '41' in units 'uv_index' --> WeeWX field 'UV'
source field '42' in units 'watt_per_meter_squared' --> WeeWX field 'radiation'
source field '43' in units 'degree_C' --> WeeWX field 'dewpoint'
source field '44' in units 'degree_C' --> WeeWX field 'windchill'
source field '46' in units 'percent' --> WeeWX field 'rxCheckPercent'
source field '3' in units 'degree_C' --> WeeWX field 'extraTemp1'
source field '19' in units 'percent' --> WeeWX field 'extraHumid1'
source field '13' in units 'degree_C' --> WeeWX field 'soilTemp1'
source field '14' in units 'degree_C' --> WeeWX field 'soilTemp2'
source field '15' in units 'degree_C' --> WeeWX field 'soilTemp3'
source field '16' in units 'degree_C' --> WeeWX field 'soilTemp4'
source field '29' in units 'centibar' --> WeeWX field 'soilMoist1'
source field '30' in units 'centibar' --> WeeWX field 'soilMoist2'
source field '31' in units 'centibar' --> WeeWX field 'soilMoist3'
source field '32' in units 'centibar' --> WeeWX field 'soilMoist4'
source field '9' in units 'degree_C' --> WeeWX field 'leafTemp1'
source field '10' in units 'degree_C' --> WeeWX field 'leafTemp2'
source field '26' in units 'count' --> WeeWX field 'leafWet1'
source field '27' in units 'count' --> WeeWX field 'leafWet2'
source field '37' in units 'minute' --> WeeWX field 'sunshineDur'
source field '39' in units 'minute' --> WeeWX field 'rainDur'
Imported records will not overwrite existing database records.
Missing derived observations will be calculated.
Starting import ...
Obtaining raw import data for period 1 ...
Traceback (most recent call last):
File "/usr/share/weewx/weectl.py", line 75, in <module>
main()
File "/usr/share/weewx/weectl.py", line 67, in main
namespace.func(namespace)
File "/usr/share/weewx/weectllib/__init__.py", line 90, in dispatch
namespace.action_func(config_dict, namespace)
File "/usr/share/weewx/weectllib/import_cmd.py", line 85, in import_func
weectllib.import_actions.obs_import(config_dict,
File "/usr/share/weewx/weectllib/import_actions.py", line 58, in obs_import
source_obj.run()
File "/usr/share/weewx/weeimport/weeimport.py", line 367, in run
_raw_data = self.get_raw_data(period)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/weewx/weeimport/csvimport.py", line 264, in get_raw_data
_csv_reader = csv.DictReader(_clean_data, delimiter=self.delimiter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/csv.py", line 86, in __init__
self.reader = reader(f, dialect, *args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: "delimiter" must be a 1-character string
Ich habe in der csv-wswin5.conf verschiedene delimiter Einstellungen ausprobiert.
# The character used to separate fields. Format is:
# delimiter = <single character>
# Default is , (comma).
#delimiter = ;
delimiter = ,
Alles auskommentiert ,
delimiter = ; gesetzt und in der zu impotierenden daten.csv alle Kommas durch Semikolons ersetzt
Die Reihenfolge der Daten ist in DB's unterschiedlich.
- weewx-DBs.png (83.47 KiB) 383 mal betrachtet
d.h. auch die Reihenfolge der Daten in der zu importierenden daten.csv ist nicht identisch mit der DB in die importiert wird.
Was bedeutet in der csv-wswin5.conf der Eintrag
source_field = 133 ?
Wird damit vielleicht dem Feld Nr. 133 der Wert die Einheit mbar zugeordnet und davon ausgegangen das es sich bei diesem Feld
um den [[barometer]] Wert handelt?
Müsste ich nicht die Zuordnung auf meinen speziellen Fall anpassen?