Re: [weewx-user] Accessing Database From Service Extension

2024-04-21 Thread Carter Humphreys
Ah that looks like it should do the trick! I’ll give it a try and reach back out if I have any issues. Thanks Tom!CarterOn Apr 21, 2024, at 11:40, Tom Keffer  wrote:Take a look at the section Programming interface in the documentation and see if that answers your question.On Sun, Apr 21, 2024 at 9:17 AM carter.hu...@gmail.com  wrote:I have PM 2.5 data being feed into WeeWx via a custom service extension. What I want to do is calculate the air quality index (AQI) based on the PM2.5 data. The EPA references the correct way of doing this as using the 24-hour average PM2.5.So my question is, is there a way for an extension to access the weewx database a pull the average value of a variable over the last 24 hours?



-- 
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/03f80a01-a1ab-4ee7-9ae1-244312a74115n%40googlegroups.com.




-- 
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-mBPA6zENp4/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAPq0zEBEiF2KHNFBvzSmVWd_V%3DjmYbN7g4X4aNo%2Bm1kbJwtkqQ%40mail.gmail.com.




-- 
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/52726A36-80B8-4017-949A-A86802908725%40gmail.com.


[weewx-user] Re: No DB or reports update

2024-04-21 Thread gjr80
Reinstalling is a bit drastic without first seeing what the problem is. 
Despite a lengthy log extract we did not see the full WeeWX startup (didn't 
see anything covering the driver being loaded) nor did we see anything 
after WeeWX startup. How about posting another log extract showing the full 
WeeWX startup and a good 10-15 minutes after WeeWX has started (ie after 
the 'Starting main packet loop' log entry).

Gary

On Monday 22 April 2024 at 01:54:50 UTC+10 jw1...@gmail.com wrote:

> Hi,
> Amid some updates and other problem solving I now have no updates 
> happening to the database nor the /var/www/html/weewx reports.
> I could have butchered the config it a bit - is there a safe (retaining 
> database) way to reinstall? Weewx.conf and syslog excerpt below.
> Thanks,
> JW
>
>
> *WEEWX.CONF (first couple sections)*
>
> # WEEWX CONFIGURATION FILE
> #
> # Copyright (c) 2009-2021 Tom Keffer 
> # See the file LICENSE.txt for your rights.
>
>
> ##
>
> # This section is for general configuration information.
>
> # Set to 1 for extra debug info, otherwise comment it out or set to zero
> debug = 1
>
> # Root directory of the weewx data file hierarchy for this station
> WEEWX_ROOT = /
>
> # Whether to log successful operations
> log_success = True
>
> # Whether to log unsuccessful operations
> log_failure = True
>
> # How long to wait before timing out a socket (FTP, HTTP) connection
> socket_timeout = 20
>
> # Do not modify this. It is used when installing and updating weewx.
> version = 5.0.2
>
>
> ##
>
>
> *SYSLOG EXCERPT*
>
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> weewx.engine.StdTimeSynch
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service weewx.engine.StdTimeSynch
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> weewx.engine.StdConvert
> Apr 21 11:46:10 sparta weewxd[429125]: INFO weewx.engine: StdConvert 
> target unit is 0x1
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service weewx.engine.StdConvert
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> weewx.engine.StdCalibrate
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service weewx.engine.StdCalibrate
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> weewx.engine.StdQC
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service weewx.engine.StdQC
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> weewx.wxservices.StdWXCalculate
> Apr 21 11:46:10 sparta weewxd[429125]: INFO weewx.wxservices: 
> StdWXCalculate will use data binding wx_binding
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.manager: Daily summary 
> version is 4.0
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service weewx.wxservices.StdWXCalculate
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> user.csv.CSV
> Apr 21 11:46:10 sparta weewxd[429125]: INFO user.csv: service version is 
> 0.11
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service user.csv.CSV
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> user.ws.WsWXCalculate
> Apr 21 11:46:10 sparta weewxd[429125]: INFO user.ws: WsWXCalculate 
> version 0.1.4
> Apr 21 11:46:10 sparta weewxd[429125]: INFO user.ws: WsWXCalculate 
> sunshine threshold: 120
> Apr 21 11:46:10 sparta weewxd[429125]: INFO user.ws: pyephem was detected
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service user.ws.WsWXCalculate
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> user.mem.MemoryMonitor
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.manager: Daily summary 
> version is 4.0
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service user.mem.MemoryMonitor
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> weewx.wxxtypes.StdWXXTypes
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service weewx.wxxtypes.StdWXXTypes
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> weewx.wxxtypes.StdPressureCooker
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service weewx.wxxtypes.StdPressureCooker
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> weewx.wxxtypes.StdRainRater
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished 
> loading service weewx.wxxtypes.StdRainRater
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
> weewx.wxxtypes.StdDelta
> Apr 21 11:46:10 sparta weewxd[429125]: DEBUG 

[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.


Re: [weewx-user] Accessing Database From Service Extension

2024-04-21 Thread Tom Keffer
Take a look at the section *Programming interface
* in
the documentation and see if that answers your question.

On Sun, Apr 21, 2024 at 9:17 AM carter.hu...@gmail.com <
carter.humphrey...@gmail.com> wrote:

> I have PM 2.5 data being feed into WeeWx via a custom service extension.
> What I want to do is calculate the air quality index (AQI) based on the
> PM2.5 data. The EPA references the correct way of doing this as using the
> 24-hour average PM2.5.
>
> So my question is, is there a way for an extension to access the weewx
> database a pull the average value of a variable over the last 24 hours?
>
> --
> 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/03f80a01-a1ab-4ee7-9ae1-244312a74115n%40googlegroups.com
> 
> .
>

-- 
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/CAPq0zEBEiF2KHNFBvzSmVWd_V%3DjmYbN7g4X4aNo%2Bm1kbJwtkqQ%40mail.gmail.com.


Re: [weewx-user] Accessing Database From Service Extension

2024-04-21 Thread Carter Humphreys
Thanks. So the calculation of AQI I have in my extension already, however I need the average value from the weewx database of the PM2.5 for a more realistic AQI. I essentially want to create a new variable that is the AQI based on the rolling 24-hour average and add that to the database.On Apr 21, 2024, at 11:09, p q  wrote:You might be able to use the python library https://pypi.org/project/python-aqi/On Sun, Apr 21, 2024 at 9:17 AM carter.hu...@gmail.com  wrote:I have PM 2.5 data being feed into WeeWx via a custom service extension. What I want to do is calculate the air quality index (AQI) based on the PM2.5 data. The EPA references the correct way of doing this as using the 24-hour average PM2.5.So my question is, is there a way for an extension to access the weewx database a pull the average value of a variable over the last 24 hours?



-- 
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/03f80a01-a1ab-4ee7-9ae1-244312a74115n%40googlegroups.com.
-- Peter Quinn(415)794-2264



-- 
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-mBPA6zENp4/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAA1SM22%3DtUXpkHLdxBHePbtn_JcmCEidHdHSigfB4ztVd3cVtw%40mail.gmail.com.




-- 
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/05ED37C7-708C-49EB-BE0F-308F21766E7E%40gmail.com.


Re: [weewx-user] Accessing Database From Service Extension

2024-04-21 Thread p q
You might be able to use the python library
https://pypi.org/project/python-aqi/


On Sun, Apr 21, 2024 at 9:17 AM carter.hu...@gmail.com <
carter.humphrey...@gmail.com> wrote:

> I have PM 2.5 data being feed into WeeWx via a custom service extension.
> What I want to do is calculate the air quality index (AQI) based on the
> PM2.5 data. The EPA references the correct way of doing this as using the
> 24-hour average PM2.5.
>
> So my question is, is there a way for an extension to access the weewx
> database a pull the average value of a variable over the last 24 hours?
>
> --
> 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/03f80a01-a1ab-4ee7-9ae1-244312a74115n%40googlegroups.com
> 
> .
>


-- 
Peter Quinn
(415)794-2264

-- 
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/CAA1SM22%3DtUXpkHLdxBHePbtn_JcmCEidHdHSigfB4ztVd3cVtw%40mail.gmail.com.


[weewx-user] Re: No DB or reports update

2024-04-21 Thread vince
On Sunday, April 21, 2024 at 8:54:50 AM UTC-7 John Walker wrote:

I could have butchered the config it a bit - is there a safe (retaining 
database) way to reinstall? Weewx.conf and syslog excerpt below.


Simply stash a copy of your database and weewx.conf file and you can 
certainly delete everything else and start anew.  
 

-- 
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/41a452dd-d419-439e-8b2d-070c9361c2f3n%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.
#   

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

2024-04-21 Thread tarob...@gmail.com
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/01940de3-e0ef-4d5f-a242-483e16d82d81n%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 = /home/piToad/Documents/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.
#   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:
 

[weewx-user] Accessing Database From Service Extension

2024-04-21 Thread carter.hu...@gmail.com
I have PM 2.5 data being feed into WeeWx via a custom service extension. 
What I want to do is calculate the air quality index (AQI) based on the 
PM2.5 data. The EPA references the correct way of doing this as using the 
24-hour average PM2.5.

So my question is, is there a way for an extension to access the weewx 
database a pull the average value of a variable over the last 24 hours?

-- 
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/03f80a01-a1ab-4ee7-9ae1-244312a74115n%40googlegroups.com.


[weewx-user] No DB or reports update

2024-04-21 Thread John Walker
Hi,
Amid some updates and other problem solving I now have no updates happening 
to the database nor the /var/www/html/weewx reports.
I could have butchered the config it a bit - is there a safe (retaining 
database) way to reinstall? Weewx.conf and syslog excerpt below.
Thanks,
JW


*WEEWX.CONF (first couple sections)*

# WEEWX CONFIGURATION FILE
#
# Copyright (c) 2009-2021 Tom Keffer 
# See the file LICENSE.txt for your rights.

##

# This section is for general configuration information.

# Set to 1 for extra debug info, otherwise comment it out or set to zero
debug = 1

# Root directory of the weewx data file hierarchy for this station
WEEWX_ROOT = /

# Whether to log successful operations
log_success = True

# Whether to log unsuccessful operations
log_failure = True

# How long to wait before timing out a socket (FTP, HTTP) connection
socket_timeout = 20

# Do not modify this. It is used when installing and updating weewx.
version = 5.0.2

##


*SYSLOG EXCERPT*

Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.engine.StdTimeSynch
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service weewx.engine.StdTimeSynch
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.engine.StdConvert
Apr 21 11:46:10 sparta weewxd[429125]: INFO weewx.engine: StdConvert target 
unit is 0x1
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service weewx.engine.StdConvert
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.engine.StdCalibrate
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service weewx.engine.StdCalibrate
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.engine.StdQC
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service weewx.engine.StdQC
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.wxservices.StdWXCalculate
Apr 21 11:46:10 sparta weewxd[429125]: INFO weewx.wxservices: 
StdWXCalculate will use data binding wx_binding
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.manager: Daily summary 
version is 4.0
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service weewx.wxservices.StdWXCalculate
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
user.csv.CSV
Apr 21 11:46:10 sparta weewxd[429125]: INFO user.csv: service version is 
0.11
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service user.csv.CSV
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
user.ws.WsWXCalculate
Apr 21 11:46:10 sparta weewxd[429125]: INFO user.ws: WsWXCalculate version 
0.1.4
Apr 21 11:46:10 sparta weewxd[429125]: INFO user.ws: WsWXCalculate sunshine 
threshold: 120
Apr 21 11:46:10 sparta weewxd[429125]: INFO user.ws: pyephem was detected
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service user.ws.WsWXCalculate
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
user.mem.MemoryMonitor
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.manager: Daily summary 
version is 4.0
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service user.mem.MemoryMonitor
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.wxxtypes.StdWXXTypes
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service weewx.wxxtypes.StdWXXTypes
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.wxxtypes.StdPressureCooker
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service weewx.wxxtypes.StdPressureCooker
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.wxxtypes.StdRainRater
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service weewx.wxxtypes.StdRainRater
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.wxxtypes.StdDelta
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service weewx.wxxtypes.StdDelta
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
user.wsxtypes.StdWSXTypes
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Finished loading 
service user.wsxtypes.StdWSXTypes
Apr 21 11:46:10 sparta weewxd[429125]: DEBUG weewx.engine: Loading service 
weewx.engine.StdArchive
Apr 21 11:46:10 sparta weewxd[429125]: INFO weewx.engine: Archive will use 
data binding wx_binding
Apr 21 11:46:10 sparta weewxd[429125]: INFO weewx.engine: Record generation 
will be attempted in 'hardware'
Apr 21 11:46:10 sparta weewxd[429125]: INFO weewx.engine: Using archive 
interval of 300 seconds (specified 

Re: [weewx-user] Missing observations - wind & rain

2024-04-21 Thread John Walker
Hi - thanks Tom for the pointer. Turns out the recently enabled firewall on 
my server caused the problem.
For anyone that has similar 
issues: https://github.com/michael-slx/weewx-weatherlink-live/issues/43
Thanks,
JW

On Friday, April 19, 2024 at 8:22:36 AM UTC-4 Tom Keffer wrote:

> You might have better luck contacting the author of the extension.
>
> On Fri, Apr 19, 2024 at 4:59 AM John Walker  wrote:
>
>> Hi - would anyone have suggestions on where I could further to try and 
>> solve the below problem? I can't find anything in documentation that 
>> relates to the "not a broadcast packet" error.
>> Many thanks,
>> JW
>>
>> On Sat, Apr 13, 2024 at 2:02 PM John Walker  wrote:
>>
>>> Hi, a few days ago I started to lose wind speed, wind direction and rain 
>>> data. Everything else is coming through ok and the charts are all updating 
>>> fine. But the wind and rain ones are blank after a certain point. Syslog 
>>> excerpt at bottom, I did find some rows indicating 'not a broadcast packet' 
>>> and 'not in record' applying to wind/rain.
>>>
>>> About the time I started to lose the data I was installing another 
>>> server application, not related to weewx. Weewx is the latest version (see 
>>> below). And I just updated the weatherlink driver today (and before the log 
>>> file excerpt below) - it was fairly recent anyway, think beginning Feb on 
>>> last update.
>>>
>>> Any pointers on how to solve this? Possibly an issue at the device head 
>>> (which is remote)?
>>>
>>> Thanks - JW
>>>
>>> weewx:
>>>   Installed: 4.9.1-1
>>>   Candidate: 4.9.1-1
>>>   Version table:
>>>  *** 4.9.1-1 100
>>> 100 /var/lib/dpkg/status
>>>
>>> *SYSLOG (debug set to 1):*
>>>
>>> Apr 13 13:52:54 sparta weewx[96085] DEBUG 
>>> user.weatherlink_live.scheduler: 100 scheduler ticks until next push refresh
>>> Apr 13 13:52:54 sparta weewx[96085] DEBUG 
>>> user.weatherlink_live.scheduler: Next scheduler tick at 2024-04-13 17:53:04 
>>> Z
>>> Apr 13 13:52:55 sparta weewx[96085] WARNING 
>>> user.weatherlink_live.driver: No data since 1 iterations
>>> Apr 13 13:52:55 sparta weewx[96085] DEBUG user.weatherlink_live.driver: 
>>> Waiting for new packet
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG 
>>> user.weatherlink_live.scheduler: Scheduler tick
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG 
>>> user.weatherlink_live.scheduler: Notifying poll callback
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG urllib3.connectionpool: 
>>> Starting new HTTP connection (1): 192.168.1.6:80
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG urllib3.connectionpool: 
>>> http://192.168.1.6:80 "GET /v1/current_conditions HTTP/1.1" 200 None
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.packets: 
>>> Trying to create HTTP conditions packet
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG 
>>> user.weatherlink_live.data_host: Polled current conditions
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> THMapping['1']: Mapped: outTemp=47.6
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> THMapping['1']: Mapped: outHumidity=69.3
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> THMapping['1']: Mapped: dewpoint=38.0
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> THMapping['1']: Mapped: heatindex=47.5
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> THMapping['1']: Mapped: wetbulb=42.3
>>>
>>>
>>> *Apr 13 13:53:00 sparta weewx[96085] DEBUG 
>>> user.weatherlink_live.mappers: RainMapping['1']: Mapping not responsible: 
>>> Not a broadcast packetApr 13 13:53:00 sparta weewx[96085] DEBUG 
>>> user.weatherlink_live.mappers: WindMapping['1']: Mapping not responsible: 
>>> Not a broadcast packet*Apr 13 13:53:00 sparta weewx[96085] DEBUG 
>>> user.weatherlink_live.mappers: WindChillMapping['1']: Mapped: windchill=47.0
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> ThwMapping['1', 'appTemp']: Mapped: thw=46.9
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> ThwMapping['1', 'appTemp']: Mapped: appTemp=46.9
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> THIndoorMapping: Mapped: inTemp=68.1
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> THIndoorMapping: Mapped: inHumidity=40.3
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> THIndoorMapping: Mapped: inDewpoint=43.1
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> THIndoorMapping: Mapped: inHeatindex=66.1
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> BaroMapping: Mapped: pressure=29.255
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> BaroMapping: Mapped: altimeter=29.549
>>> Apr 13 13:53:00 sparta weewx[96085] DEBUG user.weatherlink_live.mappers: 
>>> 

Re: [weewx-user] skin "unknown unknown"

2024-04-21 Thread Tom Keffer
That looks more like the "Seasons" skin, not the Standard skin.

The display under "About this station" is normally set by the values of
SKIN_NAME and SKIN_VERSION in the configuration file, skin.conf. They must
be missing from your copy. I don't quite understand how you ended up with
the display, but not the values, but somehow that's the way it turned out.

Either delete the display from about.inc, or add the values. To add the
values, go into Seasons/skin.conf and add them at the very top. Something
like

SKIN_NAME = Seasons
SKIN_VERSION = 5.0.2

-tk


On Sun, Apr 21, 2024 at 7:26 AM Christoph Reich 
wrote:

> I am using the Standard skin. In the section "about this station" the skin
> shows unknown unkown. I guess that should be filled automatically with the
> default naming of the skin (e.g. Standard). Howerver, I can not find how to
> fix.
>
> --
> 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/08b8b4e8-50b7-4bc1-bcc8-769b8b13190bn%40googlegroups.com
> 
> .
>

-- 
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/CAPq0zEBbRvTUERqeLyWYnJFz37y30Jc1duk8DqLS6SipnLbixg%40mail.gmail.com.


[weewx-user] skin "unknown unknown"

2024-04-21 Thread Christoph Reich
I am using the Standard skin. In the section "about this station" the skin 
shows unknown unkown. I guess that should be filled automatically with the 
default naming of the skin (e.g. Standard). Howerver, I can not find how to 
fix. 

-- 
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/08b8b4e8-50b7-4bc1-bcc8-769b8b13190bn%40googlegroups.com.