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
cd /home/weewx wget https://github.com/tkeffer/filepile/archive/filepile-1.0.0.tar.gz wee_extension --install=filepile-1.0.0.tar.gz
-
Edit the new stanza
[FilePile]
to reflect your situation. Here's an example:[FilePile] filename = /var/tmp/pond.txt unit_system = US [[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.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' # 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.