[weewx-user] Re: weectl import csv KeyError: 'source_field'

2024-04-21 Thread gjr80
I think you will find this is the source of the error in your first post:

[[[inHumidity]]] source_field = inHumid unit = percent [[[windSpeed]]] 
source = windAvg unit = mile_per_hour [[[windDir]]] source_field = windDir 
unit = degree_compass

Gary

-- 
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/376d3d39-bb8b-47fe-9245-fe66804a365bn%40googlegroups.com.


[weewx-user] Re: weectl import csv KeyError: 'source_field'

2024-04-21 Thread tarob...@gmail.com
And I just realized what the issue was with the "Unknow units 
'unix-epoch'". Changed units from 'unix-epoch' to 'unix_epoch' and now it 
seems to be working. My older "csv-import.conf" is now working with the 
weectl import.

On Sunday, April 21, 2024 at 12:57:49 PM UTC-4 tarob...@gmail.com wrote:

> Using my old import-csv.conf file (attached), I get the following error:
>
> sudo weectl import --import-config=/home/piToad/Documents/csv-import.conf 
> --dry-runUsing configuration file /etc/weewx/weewx.conf
>
> This is a dry run. Nothing will actually be done.
> Starting weectl import...
>  Unknown units 'unix-epoch' specified for field 'dateTime' in 
> /home/piToad/Documents/csv-import.conf.
>  Nothing done, exiting.
>
> On Sunday, April 21, 2024 at 12:27:22 PM UTC-4 tarob...@gmail.com wrote:
>
>> Hello,
>>
>> I am trying to import some missing data via CSV file. I've done this 
>> numerous times pre weewx 5.0 and weectl (using wee_import). I've setup a 
>> new import config file using the new layout for [[FieldMap]]. I've attached 
>> the import config I used. However, during the --dry-run I am getting the 
>> below error. I've attached the config file.
>>
>> Column Headings: 
>> ['Timestamp','d5n1Temp', 'd5n1humid', 'd5n1Pres', 'rain5n1', 
>> 'windSpeed5n1',
>>'windAvg', 'windDir', 'UV', 'luminosity', 'd5n1Humid', 'rain',
>>'windSpeed', 'inTemp', 'inHumid', 'LiTemp', 'LiHumid', 'LiStrikes',
>>'LiDistance', 'LiPres', 'GTemp', 'GHumid', 'radiation']
>>
>> It's a source_field error but can't figure out which source_field is 
>> giving the error. I've looked them over but could be missing one.
>>
>> sudo weectl import 
>> --import-config=/home/piToad/Documents/csv-import-weectl.conf --dry-run
>> Using configuration file /etc/weewx/weewx.conf
>> This is a dry run. Nothing will actually be done.
>> Starting weectl import...
>> Traceback (most recent call last):
>>   File "/usr/share/weewx/weectl.py", line 74, in 
>> main()
>>   File "/usr/share/weewx/weectl.py", line 66, in main
>> namespace.func(namespace)
>>   File "/usr/share/weewx/weectllib/__init__.py", line 121, in dispatch
>> namespace.action_func(config_dict, namespace)
>>   File "/usr/share/weewx/weectllib/import_cmd.py", line 82, in import_func
>> weectllib.import_actions.obs_import(config_dict,
>>   File "/usr/share/weewx/weectllib/import_actions.py", line 54, in 
>> obs_import
>> source_obj = 
>> weeimport.weeimport.Source.source_factory(config_dict['config_path'],
>> 
>>  ^
>>   File "/usr/share/weewx/weeimport/weeimport.py", line 316, in 
>> source_factory
>> return get_object(module_class)(config_path,
>>^
>>   File "/usr/share/weewx/weeimport/csvimport.py", line 110, in __init__
>> self.map = self.parse_map(_map,
>>
>>   File "/usr/share/weewx/weeimport/weeimport.py", line 551, in parse_map
>> _mapped_source_fields = [config['source_field'] for field, config in 
>> _map.items()]
>> 
>> ^^
>>   File "/usr/share/weewx/weeimport/weeimport.py", line 551, in 
>> _mapped_source_fields = [config['source_field'] for field, config in 
>> _map.items()]
>>  ~~
>>   File "/usr/lib/python3/dist-packages/configobj/__init__.py", line 554, 
>> in __getitem__
>> val = dict.__getitem__(self, key)
>>   ^^^
>> KeyError: 'source_field'
>>
>

-- 
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/34977516-8d00-4cb9-80ea-5b6d3ee8d333n%40googlegroups.com.


[weewx-user] Re: weectl import csv KeyError: 'source_field'

2024-04-21 Thread tarob...@gmail.com
Using my old import-csv.conf file (attached), I get the following error:

sudo weectl import --import-config=/home/piToad/Documents/csv-import.conf 
--dry-runUsing configuration file /etc/weewx/weewx.conf
This is a dry run. Nothing will actually be done.
Starting weectl import...
 Unknown units 'unix-epoch' specified for field 'dateTime' in 
/home/piToad/Documents/csv-import.conf.
 Nothing done, exiting.

On Sunday, April 21, 2024 at 12:27:22 PM UTC-4 tarob...@gmail.com wrote:

> Hello,
>
> I am trying to import some missing data via CSV file. I've done this 
> numerous times pre weewx 5.0 and weectl (using wee_import). I've setup a 
> new import config file using the new layout for [[FieldMap]]. I've attached 
> the import config I used. However, during the --dry-run I am getting the 
> below error. I've attached the config file.
>
> Column Headings: 
> ['Timestamp','d5n1Temp', 'd5n1humid', 'd5n1Pres', 'rain5n1', 
> 'windSpeed5n1',
>'windAvg', 'windDir', 'UV', 'luminosity', 'd5n1Humid', 'rain',
>'windSpeed', 'inTemp', 'inHumid', 'LiTemp', 'LiHumid', 'LiStrikes',
>'LiDistance', 'LiPres', 'GTemp', 'GHumid', 'radiation']
>
> It's a source_field error but can't figure out which source_field is 
> giving the error. I've looked them over but could be missing one.
>
> sudo weectl import 
> --import-config=/home/piToad/Documents/csv-import-weectl.conf --dry-run
> Using configuration file /etc/weewx/weewx.conf
> This is a dry run. Nothing will actually be done.
> Starting weectl import...
> Traceback (most recent call last):
>   File "/usr/share/weewx/weectl.py", line 74, in 
> main()
>   File "/usr/share/weewx/weectl.py", line 66, in main
> namespace.func(namespace)
>   File "/usr/share/weewx/weectllib/__init__.py", line 121, in dispatch
> namespace.action_func(config_dict, namespace)
>   File "/usr/share/weewx/weectllib/import_cmd.py", line 82, in import_func
> weectllib.import_actions.obs_import(config_dict,
>   File "/usr/share/weewx/weectllib/import_actions.py", line 54, in 
> obs_import
> source_obj = 
> weeimport.weeimport.Source.source_factory(config_dict['config_path'],
> 
>  ^
>   File "/usr/share/weewx/weeimport/weeimport.py", line 316, in 
> source_factory
> return get_object(module_class)(config_path,
>^
>   File "/usr/share/weewx/weeimport/csvimport.py", line 110, in __init__
> self.map = self.parse_map(_map,
>
>   File "/usr/share/weewx/weeimport/weeimport.py", line 551, in parse_map
> _mapped_source_fields = [config['source_field'] for field, config in 
> _map.items()]
> 
> ^^
>   File "/usr/share/weewx/weeimport/weeimport.py", line 551, in 
> _mapped_source_fields = [config['source_field'] for field, config in 
> _map.items()]
>  ~~
>   File "/usr/lib/python3/dist-packages/configobj/__init__.py", line 554, 
> in __getitem__
> val = dict.__getitem__(self, key)
>   ^^^
> KeyError: 'source_field'
>

-- 
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/3ae8edb0-9438-423e-9342-1b6c95735f0an%40googlegroups.com.
# EXAMPLE CONFIGURATION FILE FOR IMPORTING FROM CSV FILES
#
# Copyright (c) 2009-2019 Tom Keffer  and Gary Roderick.
# 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
#   WD - import obs from a one or more WD monthly log files
# Format is:
#   source = (CSV | WU | Cumulus)
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 = /var/tmp/dataCorrection.csv

# The character used to separate fields. Format is:
#   delimiter = 
# Default is , (comma).
delimiter = ','

# 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.
#   co