The engine in weewx uses a pipeline architecture. The services are
processed in order, with the results of one service given to the next in
line.
The data_services are fairly early in the pipe, but after the driver. So,
if you substitute a new value of outHumidity in place of whatever was
already in the loop packet, it will be treated as if it came off the
driver.
Your service will look something like this (NOT TESTED):
class AddHumidity(StdService):
"""Service to add outHumidity"""
def __init__(self, engine, config_dict):
# Initialize my base class:
super(AddHumidity, self).__init__(engine, config_dict)
self.bind(weewx.NEW_LOOP_PACKET, self.new_loop_packet)
def new_loop_packet(self, event):
"""Substitute value of outHumidity"""
humidity = myFunctionToGetHumidity()
event.packet['outHumidity'] = humidity
Note that the function myFunctionToGetHumidity() is expected to supply the
new humidity value. It is important that it not block too long because it
is sitting in the main engine thread. Everything stops while the engine
waits for the new humidity value.
-tk
On Thu, Sep 8, 2016 at 2:31 PM, Thomas Culver <[email protected]> wrote:
> I am successfully running weewx on a Raspberry Pi 3 using a Fine Onset
> wh1080 weather station. I have noticed over time that the humidity reading
> from the wh1080 is not accurate, therefore I installed a dht22 sensor and
> connected it the Rasperry Pi via the gpio interface. I have modified a
> service , "data_services = user.dht22.DHT22Service" to read and store the
> data in the archive table at extraTemp1 and extraHumid1. Since the
> humidify sensor is bad on my wh1080, i would like to write the humidify
> data, from the dht22, to outHumidity. That way I will not need to customize
> any reports to use the correct humidify column from the archive table. I
> know how to write the outHumidify in my data_services routine, but i expect
> it will be overwritten when weewx reads from the wh1080. I would expect
> that I need to modify the fousb driver, can someone point me to the
> correct code, or documentation, that would explain the change. I am not a
> python programmer. An "Old IBM 360 Assembler programmer" appreciates the
> help. Thanks.
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.