Vantage Vue: how to override humidity sensor values

183 views
Skip to first unread message

Lieven Hollevoet

unread,
May 6, 2024, 4:21:52 AM5/6/24
to weewx-user
Hello fellow weewx-users,

I am happily running weewx in combination with a Davis Vantage Vue station since 2018.

Recently, the humidity sensor of my station has developed a problem in which it sometimes report 'sane' values and sometimes it reports a 0 or 1% relative humidity. This of course results in very wonky dewpoint calculations and so I set out to fix it.
Replacement sensors are no longer available, soldering a new sensor in the station is not an option. 

I don't want to replace the complete sensor suite in the outdoor unit as all other sensors are still working fine. I opted to setup a new relative humidity sensor. I attached a Bosch BME280 sensor to the Luftdaten air quality sensor that I have running near the weather station to measure valid relative humidity values. 

I am pulling the BME280 relative humidity sensor values via Home Assistant from the Luftdaten sensor and I am posting it to an MQTT broker. WeeWX reads the relative humidity sensor values from the BME280 using the MQTTSubscribeService. The new relative humidity sensor value are reported in the extraHumid1 sensor in WeeWX.

This is all working as expected.

The question I have: is there a way to override the standard 'outHumidity' readings that come from the LOOP packets that are read from the Vantage station with the valid readings from the extraHumid1 sensor? 

I tried using the [StdCalibrate] > [[Corrections]] setting in the configuration but the problem is that the LOOP packets from the Vantage station with the invalid relative humidity readings are much more frequently received than the updates from the MQTT service that only updates the sensor value every 2 minutes. So the override with the corrections only happens when a new MQTT message is received, all the other intermediate loop pakets still contain the invalid relative humidity readings from the Vantage driver (the 'outHumidity' sensor).

I searched the documentation but I did not find a way to implement what I try to do. Does somebody have a pointer that I can follow to solve this issue?

For your reference: my weather data with the invalid and the valid relative humidity sensor can be found on http://weer.lika.be 

Thanks in advance,
 Lieven.

Tom Keffer

unread,
May 6, 2024, 5:07:46 PM5/6/24
to weewx...@googlegroups.com
You could try

outHumidity = extraHumid1 if extraHumid1 is not None else None

I don't know if this will work, but I'm thinking that for the packets that do not include extraHumid1, you will get a NameError exception, which WeeWX ignores. So, outHumidity will be None unless there's a value for extraHumid1.

Give it a try...

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/0270db27-4a43-4f55-99f3-b67eb4273200n%40googlegroups.com.

bell...@gmail.com

unread,
May 6, 2024, 7:25:05 PM5/6/24
to weewx-user
In theory you should just need to map the MQTT data to outHumidity and MQTTSubscribeService will overwrite the loop/record data.
If you want it in both fields,  try something like Tom suggested.
rich

bell...@gmail.com

unread,
May 6, 2024, 7:28:00 PM5/6/24
to weewx-user

Hmm, that (mapping to outHumidity) probably won’t work  if the frequency of the MQTT data is less than the loop data…
Drat

Lieven Hollevoet

unread,
May 8, 2024, 4:28:15 AM5/8/24
to weewx-user
Hey Tom and Rich,

thanks for the fast reply. 

As Rich is assuming correctly: the simple overwrite does not work because the MQTT data is less frequent than the loop data.

I tried the suggestions of Tom with some variations but unfortunately it also does not seem to work. It does work for the packets where there is an extraHumid1 value included but when there is none the outHumidity does not get overwritten by the 'None' value. I don't see any indication in the weewx logs why this is the case. I did enable the 'debug' option but it doesn't make we wiser.

I also tried to overwrite the outHumidity value twice in the [[Corrections]] settings, a first time with 'None' and a second time with 'ExtraHumid1' in the hope that the default assignment of 'None' would get overwritten only if ExtraHumid1 has a valid value but also that did not work. Weewx errors out because the outHumidity value is twice in the list of [[Corrections]].

I did find back this thread: https://www.mail-archive.com/weewx...@googlegroups.com/msg47494.html where I extracted the following correction formula:

outHumidity = extraHumid1 if 'extraHumid1' in locals() else None

Thanks Tom for pointing me into the right direction and for making this awesome software package available for us!

Best regards,
 Lieven. 

Op dinsdag 7 mei 2024 om 01:28:00 UTC+2 schreef bell...@gmail.com:

Tom Keffer

unread,
May 8, 2024, 10:07:09 AM5/8/24
to weewx...@googlegroups.com
On Wed, May 8, 2024 at 1:28 AM Lieven Hollevoet <lieven.h...@gmail.com> wrote:

I did find back this thread: https://www.mail-archive.com/weewx...@googlegroups.com/msg47494.html where I extracted the following correction formula:

outHumidity = extraHumid1 if 'extraHumid1' in locals() else None

Of course! Totally forgot about that solution!

michael.k...@gmx.at

unread,
May 8, 2024, 12:38:58 PM5/8/24
to weewx-user
You can map the value to extrahumid1 and use this (hacky) extension:

and put this in your weewx.conf:

[UsePreferred]
    outHumidity = extraHumid1


michael.k...@gmx.at

unread,
May 8, 2024, 12:47:36 PM5/8/24
to weewx-user
This might work in StdCalibrate/Corrections (not tested):

outHumidity = extraHumid1 if extraHumid1 is not None and 'outHumidity' not in locals() else None

michael.k...@gmx.at

unread,
May 8, 2024, 12:50:31 PM5/8/24
to weewx-user
Ahh.. and I forgot: the BME280 is not suitable, take a look in the datasheet, it is not designed for use in condensing environments, and it really sucks in such conditions. Go for a Sensirion SHTxx.

Lieven Hollevoet

unread,
May 8, 2024, 1:13:03 PM5/8/24
to weewx-user
Hey Michael,

thanks for the input. The StdCalibrate/Corrections formula I posted earlier works as expected, so I won't install the extra extension if not absolutely required. Good to know that is exists though!

You have a valid point about operational range of the BME sensor versus SHT3x devices. 

Now I know that I have a working setup to substitute the faulty readings of the Vantage Vue (which is also a Sensirion but with the older bus format Sensirion used to have on their first line of RH sensors) it is only a matter of replacing the I2C sensor on the luftdaten hardware. Ordered and I'll replace the sensor when the SHT31 breakout board arrives.

Best regards,
 Lieven


Op woensdag 8 mei 2024 om 18:50:31 UTC+2 schreef michael.k...@gmx.at:
Reply all
Reply to author
Forward
0 new messages