The new WeatherFlow integration reports the station pressure, however this value isn’t typically used; the sea level pressure is what most people are interested in, especially in the aviation industry. The downside of this is it depends on the station elevation to calculate. Fortunately the Zone location already stores elevation. For flexibility it might be nice if the integration had a config option to either use the Zone setting or override with a custom value.
As for calculating the sea level pressure, pyweatherflowudp already does this via the calculate_sea_level_pressure method, it just requires the elevation as a parameter.
Just setup my Tempest weather station and added the Weatherflow integration. Still new to HA. What’s the best way to get a sea level pressure entity that I can display in my dashboard?
I just moved over from weatherflow2mqtt and also missing the local Sea Level Pressure. So I created my own template sensors for sea level pressure and pressure trend following the formula published from weatherflow. Sharing if anyone is interested:
template:
- sensor:
- name: current_sea_level_pressure
unit_of_measurement: inHg
state_class: measurement
device_class: atmospheric_pressure
state: >
{% set H_asl = 231.648 %} {## Hight of ground above sea level ##}
{% set H_agl = 2.4384 %} {## Hight of station above ground level ##}
{% set g = 9.80665 %} {## gravity (9.80665 m/s2 ##}
{% set L_s = 0.0065 %} {## standard atmosphere lapse rate (0.0065 K/m) ##}
{% set P_0 = 1013.25 %} {## standard sea level pressure ##}
{% set T_0 = 288.15 %} {## standard sea level temperature ##}
{% set R_d = 287.05 %} {## gas constant for dry air ##}
{% set P_hg_mb = 0.029529980 %} {## conversion factor for inHg to mb ##}
{% set P1 = (R_d * L_s)/g %} {## pre-calculate first power factor in formula ##}
{% set P2 = g/(R_d * L_s) %} {## pre-calculate second power factor in formula ##}
{% set P_sta = states('sensor.st_00139366_air_pressure')|float(0) / P_hg_mb %}
{{ (P_sta * ((1 + ((P_0/P_sta) ** P1 ) * (L_s * (H_asl + H_agl)) / T_0) ** P2) * P_hg_mb ) | round(6)}}
{## formula per weatherflow documentation. Rounding to 6 is optimistic on significant digits. ##}
- name: current_weather_pressure_trend
state: "{% if states('sensor.pressure_trend_value')|float(0) * 3 > 0.0295 %} rising
{%- elif states('sensor.pressure_trend_value')|float(default = 0) * 3 < -0.0295 -%} falling
{%- else -%} steady
{% endif %}"
sensor:
- platform: derivative
source: sensor.current_sea_level_pressure
name: pressure_trend_value
round: 4
unit_time: h
time_window: "03:00:00"