Yet another problem with pressure and the barometer

128 views
Skip to first unread message

Tomasz Lewicki

unread,
Jul 7, 2026, 5:11:16 AM (6 days ago) Jul 7
to weewx-user

Please help me understand the workflow for pressure/barometer calculations in Weewx.

Here’s the situation. Let’s say my barometer reads 970 hPa. Setting aside how the reduced pressure is calculated, I know that it underestimates the pressure by 6 hPa. I’d like to inform Weewx of this without using the weather station console—that is, without physically entering corrections into the console. In other words, I want to do this in weewx.conf.

I’ve made the following changes:

[[[Units]]]
    [[[[Groups]]]]
group_pressure = hPa

[StdCalibrate]
    [[Corrections]]
        pressure = pressure + 6.0
       
[StdWXCalculate]
    [[Calculations]]
        barometer = WHAT SHOULD BE HERE?
        pressure = AND HERE?

Greg Troxel

unread,
Jul 7, 2026, 8:30:48 AM (6 days ago) Jul 7
to 'Tomasz Lewicki' via weewx-user
"'Tomasz Lewicki' via weewx-user" <weewx...@googlegroups.com> writes:

> Please help me understand the workflow for pressure/barometer calculations
> in Weewx.

First, read this:

https://github.com/weewx/weewx/wiki/Barometer,-pressure,-and-altimeter

Given auxilliary data (temperature, humidity, elevation), one can
convert between pressure/barometer and pressure/altimeter. weewx has
code that when a driver reports some but not all of those, it can
calculate the rest.

Different consoles have different behavior. I will assume that a
console should display barometer. Physically, consoles measure station
pressure.

> Here’s the situation. Let’s say my barometer reads 970 hPa. Setting aside
> how the reduced pressure is calculated, I know that it underestimates the
> pressure by 6 hPa. I’d like to inform Weewx of this without using the
> weather station console—that is, without physically entering corrections
> into the console. In other words, I want to do this in weewx.conf.

There are assumptions lurking in your statements, and I'd like to draw
them out.

The correct approach is for the console to have:
- an altitude setting
- a station pressure calibration offset (well, it could be an offset
at some pressure and a slope, or more complicated but I've never
seen that in any instrument people use with weewx)
and then for the console to calculate baromter.

You haven't said what kind of station hardware you are using, and more
importantly, what values it reports.

You are saying you "don't want to" do this in the console, but you don't
explain why. I think if you can adjust station pressure in the console,
that's the best place.

You say it underestimates barometer. You didn't explain how well you
have determined height -- which is quite difficult, and it's roughly
0.12 hPa per meter.

Your 6 hpa is likely some combination of station pressure error and
altitude error. That's a lot. I would be suspicioiukous of the
hardware at anything over 3 hPa error.

Because of the error being caused by station pressure reading error and
altitude setting error, it's likely to change somewhat. You are going
to have some second-order error from applying a barometer correction,
but I suspect that's in the noise compared to your other error sources
(like time variation in station pressure error).

> I’ve made the following changes:
> [[[Units]]]
> [[[[Groups]]]]
> group_pressure = hPa
>
> [StdCalibrate]
> [[Corrections]]
> pressure = pressure + 6.0
>
> [StdWXCalculate]
> [[Calculations]]
> barometer = WHAT SHOULD BE HERE?
> pressure = AND HERE?

In order to decide what to do, you need to understand for each of
barometer, pressure, altimeter if they are

reported by the station or not

calculated by weewx or not (and obviously, if not reported, must be
calculated)

Under

[StdWXCalculate]

[[Calculations]]

There are configuration directives to prefer_hardware.



My advice is:

Tell us what station hardware you are using. (Really, read
https://github.com/weewx/weewx/wiki/Help!-Posting-to-weewx-user
and include what was asked for and relevant. The OS part is very
likely not important, but model of station, and how you have
configured it is very important.)

Understand which values are reported (turn on debugging and watch LOOP
packets) and which are calculated, in the default setup.

Consider setting barometer/altimeter to calculated, and go with with
your correction to pressure (which is "Station Pressure")

Tomasz Lewicki

unread,
Jul 7, 2026, 10:56:06 AM (5 days ago) Jul 7
to weewx-user

Thank you for your reply and for your willingness to help. I've been a satisfied QGIS user for several years now; I manage a few stations, so I have a pretty good idea of how things work. I deliberately didn't provide details about the station model, console, etc., because I'd like the solution to be hardware agnostic. I'm familiar with the Wiki article, but unfortunately, it doesn't explain what I'm asking about. Or maybe I just can't read between the lines :)

As for the barometer readings, I have two (WH25A and WN32P), and each shows a different value. Their readings differ by exactly 10 hPa. I have a Python script that retrieves the current METAR for a nearby airport, and based on the specified altitude above sea level and the entered pressure, it calculates the "correct" pressure and reports the offset of my barometer from the airport's. It saves the results to a file and calculates the mean and median from several measurements. That's why I wrote that I'm interested in a pressure correction of +6 hPa, because that's how much the WH25A sensor underreports (I borrowed a WN32P for verification only).

I'd simply like to understand how the correction calculation workflow works, as specified in the [StdCalibrate] / [[Corrections]] section of weewx.conf. At what point is this correction applied, and to which "measurement" method—only software? Only hardware? Both?

My reasoning is as follows:

1. I set the pressure correction to pressure = pressure + 6.0 in weewx.conf; I don't change anything in the station console—no offsets, no entering "correct" ABS or REL pressure

2. After setting the pressure correction, should I set pressure = prefer_hardware or software?

3. What should I do with barometer then, to avoid applying a double correction or causing a calculation error?

Greg Troxel

unread,
Jul 7, 2026, 12:14:39 PM (5 days ago) Jul 7
to 'Tomasz Lewicki' via weewx-user
"'Tomasz Lewicki' via weewx-user" <weewx...@googlegroups.com> writes:

> Thank you for your reply and for your willingness to help. I've been a
> satisfied QGIS user for several years now; I manage a few stations, so I
> have a pretty good idea of how things work. I deliberately didn't provide
> details about the station model, console, etc., because I'd like the
> solution to be hardware agnostic. I'm familiar with the Wiki article, but
> unfortunately, it doesn't explain what I'm asking about. Or maybe I just
> can't read between the lines :)

I don't think it's reasonable to leave out relevant information on
purpose, and if you are asking a theoretical question that should be
separate.

> As for the barometer readings, I have two (WH25A and WN32P), and each shows
> a different value. Their readings differ by exactly 10 hPa. I have a Python

Something seems very wrong. I have never seen a pressure sensor that
far off. I suspect confusion between reduced and station pressures.
But maybe you just have bad hardware.

> script that retrieves the current METAR for a nearby airport, and based on
> the specified altitude above sea level and the entered pressure, it
> calculates the "correct" pressure and reports the offset of my barometer
> from the airport's.

It would be nice to publish that, so that you contribute to the commons.

> It saves the results to a file and calculates the mean
> and median from several measurements. That's why I wrote that I'm
> interested in a pressure correction of +6 hPa, because that's how much the
> WH25A sensor underreports (I borrowed a WN32P for verification only).

You said 10 earlier which is not 6. So please dig into your hardware
and debug logs and examine and then describe
- what the documentation (+ weewx wiki, internet) says it measures and reports
- what kind of calibration can be done on the hardware
- what values you have set for those calibrations
- how you determined your elevation and what your estimate of alitude
uncertainty is

- specific values reported by your hardware, your elevation, and
corresponding values/elevation from nearby official stations

> I'd simply like to understand how the correction calculation workflow
> works, as specified in the [StdCalibrate] / [[Corrections]] section of
> weewx.conf. At what point is this correction applied, and to which
> "measurement" method—only software? Only hardware? Both?

I suggest reading the source code. Also, in weewx.conf, services are
listed in order, and the standard approach is to do StdCalibrate before
StxWXCalculate. So *if* the console reports station pressure, and *if*
barometer is software instead of harder, then just adjusting station
pressure should be sufficient, because StdWXCalculate should see the
adjusted station pressure. But if the console is *also* reporting
barometric pressure, then StdWXCalculate will not be run for barometric
pressure.

You really need to understand what is being reported vs calculated, and
how weewx is choosing to calculate or use hardware for each item.

> My reasoning is as follows:
>
> 1. I set the pressure correction to pressure = pressure + 6.0 in
> weewx.conf; I don't change anything in the station console—no offsets, no
> entering "correct" ABS or REL pressure
>
> 2. After setting the pressure correction, should I set pressure =
> prefer_hardware or software?

You should understand what is going on with what's reported and what's
calculated.

> 3. What should I do with barometer then, to avoid applying a double
> correction or causing a calculation error?

You should understand what is going on with what's reported and what's
calculated.

If you don't want to try to understand that, then it's going to be much
<harder for you to get a good outcome.

Vince Skahan

unread,
Jul 7, 2026, 12:55:31 PM (5 days ago) Jul 7
to weewx-user
Since you are using ecowitt you can apply your correction byusing the wsview app if you have that. I have had to slightly adjust some ecowitt temperature sensors vs. my multiple other reference sensors.

Tomasz Lewicki

unread,
Jul 7, 2026, 1:26:33 PM (5 days ago) Jul 7
to weewx-user
> I have never seen a pressure sensor that far off.
> I suspect confusion between reduced and station pressures.
> But maybe you just have bad hardware.

But I see them right now :) One shows 969,7 hPa, second 979,8 hPa. Sorry, it's not my fault that I see such values on the displays. And I know what ABS and REL are, really.


> You said 10 earlier which is not 6.

It seems you didn't understand what I wrote: "I have two (WH25A and WN32P), and each shows a different value. Their readings differ by exactly 10 hPa". WH25A shows 969,7 hPa, WN32P shows 979,8 hPa. So it's 10 hPa. Correction +6 hPa is needed for WH25A which I use with my station. For WN32P correction is -4 hPa.


> I suggest reading the source code. Also, in weewx.conf, services are
> listed in order, and the standard approach is to do StdCalibrate before
> StxWXCalculate. So *if* the console reports station pressure, and *if*
> barometer is software instead of harder, then just adjusting station
> pressure should be sufficient, because StdWXCalculate should see the
> adjusted station pressure. But if the console is *also* reporting
> barometric pressure, then StdWXCalculate will not be run for barometric
> pressure.

And that's the answer that's slowly leading me to some kind of conclusion. So should I set correction for pressure (ABS) only *and* pressure = prefer_hardware to get pressure reported by console corrected by +6 hPa? if yes, what to do next to have barometer (REL) also corrected, ie. near to METAR value?


> You should understand what is going on with what's reported and what's
> calculated.
>
> If you don't want to try to understand that, then it's going to be much
> harder for you to get a good outcome.

That's what I'm trying to do from the very beginning :) As I said earlier, I take care of several stations and trying to find some general way to correct pressure using only weewx.conf, without physical access to hardware/consoles.

Greg Troxel

unread,
Jul 7, 2026, 2:06:56 PM (5 days ago) Jul 7
to 'Tomasz Lewicki' via weewx-user
"'Tomasz Lewicki' via weewx-user" <weewx...@googlegroups.com> writes:

> It seems you didn't understand what I wrote: "I have two (WH25A and WN32P),
> and each shows a different value. Their readings differ by exactly 10 hPa".
> WH25A shows 969,7 hPa, WN32P shows 979,8 hPa. So it's 10 hPa. Correction +6
> hPa is needed for WH25A which I use with my station. For WN32P correction
> is -4 hPa.

I see - comparing 3 things. In theory, all station pressure. That is
still a very large error. With one weather station and various BME280
type sensors (or DPS310), I think I'm seeing a peak-peak range of about
3 hPa.

>> I suggest reading the source code. Also, in weewx.conf, services are

> So should I set correction for pressure (ABS) only *and* pressure =
> prefer_hardware to get pressure reported by console corrected by +6 hPa? if
> yes, what to do next to have barometer (REL) also corrected, ie. near to
> METAR value?

You should understand, of your hardware, which values are reported to
weewx, and which weewx is calculating. Then how to address calibration
will very likely be clearer.

Tomasz Lewicki

unread,
Jul 7, 2026, 2:41:45 PM (5 days ago) Jul 7
to weewx-user
This is excerpt from weewxd.log. I'm using interceptor driver.

DEBUG user.interceptor

ID=XXXX&PASSWORD=XXXX&indoortempf=76.3&tempf=72.7&dewptf=48.4&windchillf=72.7&indoorhumidity=49&humidity=42&soilmoisture=-9999&AqPM2.5=-9999&windspeedmph=9.8&windgustmph=15.0&winddir=234&absbaromin=28.61&baromin=29.74&rainin=0.00&dailyrainin=0.00&weeklyrainin=0.13&monthlyrainin=0.46&yearlyrainin=7.57&solarradiation=2.72&UV=0&dateutc=2026-7-7%2018:37:42&softwaretype=WS-1002%20V2.5.2&action=updateraw&realtime=1&rtfreq=5

raw packet: {'dateTime': 1783449462, 'usUnits': 1, 'rain_total': 7.57, 'temperature_in': 76.3, 'temperature_out': 72.7, 'dewpoint': 48.4, 'windchill': 72.7, 'humidity_in': 49.0, 'humidity_out': 42.0, 'soilmoisture_1': None, 'pm2_5': None, 'wind_speed': 9.8, 'wind_gust': 15.0, 'wind_dir': 234.0, 'pressure': 28.61, 'barometer': 29.74, 'solar_radiation': 2.72, 'uv': 0.0, 'rain': None}

mapped packet: {'dateTime': 1783449462, 'usUnits': 1, 'pressure': 28.61, 'barometer': 29.74, 'outHumidity': 42.0, 'inHumidity': 49.0, 'outTemp': 72.7, 'inTemp': 76.3, 'windSpeed': 9.8, 'windGust': 15.0, 'windDir': 234.0, 'radiation': 2.72, 'dewpoint': 48.4, 'windchill': 72.7, 'rain': None, 'UV': 0.0, 'pm2_5': None}

I hope it helps.

Tom Keffer

unread,
Jul 7, 2026, 5:03:42 PM (5 days ago) Jul 7
to weewx...@googlegroups.com
To answer your question, it helps to look at the setup of the standard processing pipeline:

StdConvert
The first step is to convert any data coming off the hardware into the appropriate unit system.

StdCalibrate
Then user-specified corrections are made.

StdQC
Set any anomalous data to None.

StdWXCalculate
This is probably where the confusion lies. Given the presence of appropriate values of temperature and altitude, StdWXCalculate can calculate pressure from barometer, altimeter from pressure, and barometer from pressure. Whether it does so depends on the value of the "directive." If the directive is "hardware," it doesn't touch the value. If it is "software" it always calculates the value, even if the hardware emitted something. If it is "prefer_hardware" it calculates a value only if the value is None, otherwise it doesn't touch it. 

Note that for "prefer_hardware" a new value is calculated only if the old value was None. If altimeter is emitted from the dictionary completely, it won't do anything.

Now to answer your question, you can leave the values at their defaults:

[StdWXCalculate]
    [[Calculations]]
        pressure = prefer_hardware
        altimeter = prefer_hardware
        barometer = prefer_hardware

pressure: Because your driver emits a value for pressure, the directive "prefer_hardware" tells StdWXCalculate not to touch it. 

altimeter: If the driver emits a value of None for altimeter the directive "prefer_hardware" tells StdWXCalculate to calculate it from the provided sensor pressure. Because StdWXCalculate appears after StdCalibrate in the processing pipeline, it will use the corrected value of pressure. If the driver does emit a value for altimeter, it won't touch it, which means that you should either apply a correction to altimeter in StdCalibrate, or use a directive of "software", forcing StdWXCalculate to calculate it from the corrected sensor pressure. If your driver emits nothing at all for altimeter then nothing is done.

barometer: Same as altimeter.

Hope this helps. 

-tk



--
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 visit https://groups.google.com/d/msgid/weewx-user/dad98426-2004-4d3e-b1cb-6bd36d59da90n%40googlegroups.com.

Clay Jackson

unread,
Jul 7, 2026, 11:10:11 PM (5 days ago) Jul 7
to weewx-user
Pardon me for jumping in here; but I've done a lot of fiddling and research on just this topic.   

Some background, I currently have THREE pressure sensors within a 600' radius, and Acurite 5-n-1, the pressure sensor that comes with an "original" PurpleAire Outdoor unit and the sensor in my Tempest WeatherFlow. At one time or another I've had as many as five pressure sensors.  Being in the US, I typically display pressure as inHg; but when fiddling, I use millibars.  Right now, my Tempest WeatherFlow is reporting 29.736 inHG, my purpleair is reporting 29.08 inHG and the Accurite is reporting 29.63 inHG.   I've NEVER seen agreement on any 2 sensors, let alone 3 or 4 and I've seen differences as much as .5 inHG

I'm 3 miles and about 100 feet lower than S40 (our nearest airport) which is reporting 29.81.  But I'm also reporting a CORRECTED (to a NIST traceable sling psychrometer) temp of 94.2 as opposed to 86 at S40.  For what it's worth, the purpleaire is reporting a temp of 104, because the sensors are inside a small non-ventilated case.
 
I also participate in the NOAA Citizen's Weather Observer Program, and here's what they say over the last 30 days.
Average barometer error: 0.1 milliBars
Error standard deviation: 0.4 milliBars

When I first started w/CWOP, I went crazy trying to correct stuff and actually did correct my Acurite to SLP; but Based on the current CWOP data, which is taken from the Tempest, when I installed that 3 years ago and observed the differences daily for a month, I gave up trying to "calibrate" it.  I do check once or twice/week and have never seen anything but two "thumbs up" out of CWOP except during frontal passes.   It's also been my experience that even 3 miles and 100 ft can make a large difference, a few tenths inHG,  especially when you consider temperature as well.

Bottom line:
1) With "consumer grade" equipment, you're never gonna get NIST reliabilty or traceabilty
2) Different sensors will report different results.  Pick one, get it to approximate either Sea Level Pressure or "altitude corrected" pressure and then observe it for a while.

And as far as what WeeWx does, "What Tom and the documentation say".

Vince Skahan

unread,
Jul 7, 2026, 11:28:33 PM (5 days ago) Jul 7
to weewx-user
VP2 barom 30.045
Ecowitt pressure 30.04 relative and 29.67 absolute
Purpleair pressure 1005.97 mbar (29.71 inHg)

So all three line up here….

Tom Keffer

unread,
Jul 7, 2026, 11:56:28 PM (5 days ago) Jul 7
to weewx...@googlegroups.com
Clay, you're the perfect example of the saying, "Give a man a watch and he knows what time it is. Give him two and he has no idea."

--
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.

Tomasz Lewicki

unread,
Jul 8, 2026, 2:21:00 AM (5 days ago) Jul 8
to weewx-user
Yes, it helps A LOT! Thank you very much, Tom. It answers to my questions.

I think your explanations should be included in the wiki, in the text linked in this discussion. Questions about this or that pressure come up from time to time, and people are referred to the wiki, so these theoretical and computational basics would certainly help clarify certain ambiguities that inevitably arise. And I think that’s great, because if someone has doubts, it means they don’t treat Weewx as a black box where something goes in on one end and comes out on the other - and that’s all there is to it.

Thank you!

Tomasz

Clay Jackson

unread,
Jul 8, 2026, 6:25:53 PM (4 days ago) Jul 8
to weewx-user
Well, yeah :-) 

For pressure, I ignore all but the Tempest now, except when someone asks. 

About time - I have a GPS-disciplined Temperature Controlled Oscillator as an NPT Stratum 1 source, and all but two of the 18 "time display units" in my house, our pre-internet stoves, are synced to that or WWVB (NIST Radio time).  I know what time it is down to a few hundred milliseconds or better.   

And while we're on that subject, is everyone ready for The Epochalypse Project — Time Integrity & Epoch Rollover Risk (2036/2038)?
Reply all
Reply to author
Forward
0 new messages