Good day to all of you in this forum,
I loaded on the Arduino Uno the " SFE_BMP180 library example sketch" after having changed my home elevation : I set 350 meters.
The sketch works well and gives the following :
Spec sheet says it's typically off by about 1 mBar.
Your altitude is another thing: take it up or down a floor and you'll see the difference. How sure are you about your elevation?
the SFE_BMP180 library uses a slightly less precise constant for the exponent in the conversion formula so the result might not be as precise as it could be. For some reason, it uses "1.0/0.190223" instead of 5.257 that I have seen in web pages about the conversion. Don't know if that has any effect - I don't remember the Numerical Analysis that I took at university over 40 years ago.
the Arduino will use single precision floating point for the calculation whereas the airport almost certainly uses double precision.
the weather report here usually only changes the temperature and other readings once an hour whereas the airport will be using the current temperature in its calculations. So, you might be relying on info that is up to an hour old.
Some or all of the above, plus what @wvmarle has said, may conspire to produce a different reading.
A difference of 4mb is about 0.4% which is almost certainly not good enough if you're trying to land a plane at the airport but for general weather logging, it's probably plenty sufficient.
Mine has an offset of 4 mb from the airport, 15 miles away and 90 feet higher, I just added 4.0 to the reading and it's always within 1 to 3 mb of what the airport reports, close enough for ol' grounded me.
The data sheet for the BMP180 sensor says the absolute accuracy is +2/-4 HPa, so that reading would be in spec (although the sea level correction may not be correct).
Unfortunately, the OP does not seem to understand how to read a data sheet, or what "absolute accuracy" means: if the reported value is 1021 HPa, then the true value is most likely in the range 1017 to 1023 HPa.
With a resolution of well below 1 mbar these sensors can indeed do that: they can sense whether you move up or down the house a floor or two.
However with varying air pressure (base air pressure, and effects from wind blowing against your home and exhaust fans and so, plus their own absolute error) it's never going to be possible to say this way on which floor you actually are.