WeeWX service for additional types from a file to a WeeWX data stream
-
Arrange to have your new data saved to a file, say
/var/tmp/pond.txt
. It should be in the following format:extraTemp1 = 45.5 extraHumid1 = None myVoltage = 12.2
The value
None
is a valid value and signifies a bad data point. -
Download and install the extension
weectl extension install https://github.com/tkeffer/filepile/archive/master.zip
-
Edit the new stanza
[FilePile]
to reflect your situation. Here's an example:[FilePile] filename = /var/tmp/pond.txt unit_system = US ignore_value_error = False [[label_map]] myVoltage = supplyVoltage
In this example, the incoming data will be found in the file
/var/tmp/pond.txt
and it will be in the US Customary unit system. See below for optionignore_value_error
.The incoming observation type
myVoltage
will get mapped to the WeeWX typesupplyVoltage
. The other two types in the file (extraTemp1
andextraHumid1
in the example above), do not appear in the mapping, so they will appear under their own namesextraTemp1
andextraHumid1
. -
Restart WeeWX. For example:
sudo systemctl stop weewx sudo systemctl start weewx
-
On every archive interval, your temporary file will be read, parsed, and its contents added to the WeeWX record.
-
Arrange to have your new data saved to a file, say
/var/tmp/pond.txt
. It should be in the following format:extraTemp1 = 45.5 extraHumid1 = None myVoltage = 12.2
The value
None
is a valid value and signifies a bad data point. -
Include a stanza in your
weewx.conf
configuration file that looks like this. Adjust the options as necessary:[FilePile] filename = /var/tmp/pond.txt unit_system = US # Or, 'METRIC' or 'METRICWX' ignore_value_error = False # Map from incoming names, to WeeWX names. [[label_map]] myVoltage = supplyVoltage # Incoming name 'myVoltage' will get mapped to 'supplyVoltage'
-
Add the FilePile service to the list of
data_services
:[Engine] [[Services]] ... data_services = user.filepile.FilePile ...
-
Put the file
filepile.py
in your WeeWXuser
subdirectory. For example, if you installed usingsetup.py
:cp filepile.py /home/weewx/bin/user
-
Restart WeeWX. For example:
sudo systemctl stop weewx sudo systemctl start weewx
-
On every archive interval, your temporary file will be read, parsed, and its contents added to the WeeWX record.
ignore_value_error
controls what happens if a value is unable to be converted
to a floating point value. Examples:
outTemp = foo
windSpeed = N/A
If set to False
(the default), an exception of type ValueError
will be raised, which is likely to cause program
termination. If set to True
, the value will be ignored.