BME280 Esphome Altitude all over the place

Hello,

im running this code on a wemos d1 but the altitude goes from -50 to 130+.
The chips is mounted stationary on the wall so it most definatly is not moving.

esphome:
  name: bme280
  platform: ESP8266
  board: d1_mini_pro

wifi:
  ssid: "xxxxxxx"
  password: "xxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Outside Temperature"
    password: "nlOrd0eKRCJY"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "xxxx"

ota:
  password: "xxxx"
  
i2c:
#  sda: 21
#  scl: 22
   scan: True
   id: bus_a

sensor:
  - platform: bme280
    temperature:
      name: "BME280 Temperature"
      id: bme280_temperature
      oversampling: 16x
    pressure:
      name: "BME280 Pressure"
      id: bme280_pressure
    humidity:
      name: "BME280 Relative Humidity"
      id: bme280_humidity
    address: 0x76
    update_interval: 15s
  - platform: template
    name: "Altitude"
    lambda: |-
      const float STANDARD_SEA_LEVEL_PRESSURE = 1032; //in hPa, see note
      return ((id(bme280_temperature).state + 273.15) / 0.0065) *
        (powf((STANDARD_SEA_LEVEL_PRESSURE / id(bme280_pressure).state), 0.190234) - 1); // in meter
    update_interval: 15s
    icon: 'mdi:signal'
    unit_of_measurement: 'm'

Any way to fix this behavior?

This is normal. Air pressure change naturally. High air pressure clear weather and warm during summer. Low pressure cloudy and usually bad weather.

If you want to know the altitude you need to know the air pressure on a specific height at the same time so you can compensate for natural variation of air pressure.

/Mattias

Thank you for your awnser Matthias,
so bascially to use it outside will not really work.