From 7024f046cffcff145af4e195cefc18f9c08cd3fb Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Fri, 6 May 2022 10:15:50 -0700 Subject: [PATCH] Fix problem that creates 'ghost' values for VantageVue stations. Fixes issue #771. --- bin/weewx/drivers/vantage.py | 19 +++++++++++++++++-- docs/changes.txt | 3 +++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/bin/weewx/drivers/vantage.py b/bin/weewx/drivers/vantage.py index ca2d455e..9f74149c 100644 --- a/bin/weewx/drivers/vantage.py +++ b/bin/weewx/drivers/vantage.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2009-2021 Tom Keffer +# Copyright (c) 2009-2022 Tom Keffer # # See the file LICENSE.txt for your full rights. # @@ -33,7 +33,7 @@ from weewx.crc16 import crc16 log = logging.getLogger(__name__) DRIVER_NAME = 'Vantage' -DRIVER_VERSION = '3.2.3' +DRIVER_VERSION = '3.3.0' def loader(config_dict, engine): @@ -1480,6 +1480,9 @@ class Vantage(weewx.drivers.AbstractDevice): } # Now we need to map the raw values to physical units. for _type in raw_loop_packet: + if _type in extra_sensors and self.hardware_type == 17: + # Vantage Vues do not support extra sensors. Skip them. + continue # Get the mapping function for this type. If there is # no such function, supply a lambda function that returns None func = _loop_map.get(_type, lambda p, k: None) @@ -1554,6 +1557,9 @@ class Vantage(weewx.drivers.AbstractDevice): raw_archive_record['wind_samples']) for _type in raw_archive_record: + if _type in extra_sensors and self.hardware_type == 17: + # VantageVues do not support extra sensors. Skip them. + continue # Get the mapping function for this type. If there is no such # function, supply a lambda function that will just return None func = _archive_map.get(_type, lambda p, k: None) @@ -1672,6 +1678,15 @@ rec_types_B, fmt_B = list(zip(*rec_B_schema)) rec_A_struct = struct.Struct('<' + ''.join(fmt_A)) rec_B_struct = struct.Struct('<' + ''.join(fmt_B)) +# These are extra sensors, not found on the Vues. +extra_sensors = { + 'leafTemp1', 'leafTemp2', 'leafWet1', 'leafWet2', + 'soilTemp1', 'soilTemp2', 'soilTemp3', 'soilTemp4', + 'extraHumid1', 'extraHumid2', 'extraTemp1', 'extraTemp2', 'extraTemp3', + 'soilMoist1', 'soilMoist2', 'soildMoist3', 'soilMoist4' +} + + def _rxcheck(model_type, interval, iss_id, number_of_wind_samples): """Gives an estimate of the fraction of packets received. diff --git a/docs/changes.txt b/docs/changes.txt index 7c9d9577..61f5be49 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -4,6 +4,9 @@ WeeWX change history 4.8.1 MM/DD/YYYY Don't swallow syntax errors when wee_config is looking for drivers. +Fix problem that create 'ghost' values for VantageVue stations. +Fixes issue #771. + 4.8.0 04/21/2022 Allow unit to be overridden for a specific plot by using new option 'unit'.