diff --git a/common/base.yaml b/common/base.yaml index b77a218..b7e1741 100644 --- a/common/base.yaml +++ b/common/base.yaml @@ -4,7 +4,7 @@ esphome: board: lolin_d32_pro project: name: "xd0.esp32weatherstation2" - version: "0.0.6" + version: "0.0.7" includes: - fonts/weather_icon_map.h - custom/veml6075_custom_sensor.h diff --git a/common/battery.yaml b/common/battery.yaml index abb661d..a086064 100644 --- a/common/battery.yaml +++ b/common/battery.yaml @@ -7,3 +7,7 @@ sensor: # filters: # - lambda: return ( x/4096.0 ) * 2 * 3.42; update_interval: 60s + +#deep_sleep: +# run_duration: 30s +# sleep_duration: 10min diff --git a/common/bme280.yaml b/common/bme280.yaml index 257b2d1..cebcb78 100644 --- a/common/bme280.yaml +++ b/common/bme280.yaml @@ -12,3 +12,34 @@ sensor: id: humidity address: 0x77 update_interval: 60s + - platform: template + name: "${node_name} Equivalent sea level pressure" + id: pressure_sealevel + lambda: |- + const float STANDARD_ALTITUDE = ${altitude}; // in meters, see note + return id(pressure).state / powf(1 - ((0.0065 * STANDARD_ALTITUDE) / + (id(temperature).state + (0.0065 * STANDARD_ALTITUDE) + 273.15)), 5.257); // in hPa + update_interval: 60s + unit_of_measurement: 'hPa' + - platform: template + name: "${node_name} Absolute Humidity" + lambda: |- + const float mw = 18.01534; // molar mass of water g/mol + const float r = 8.31447215; // Universal gas constant J/mol/K + return (6.112 * powf(2.718281828, (17.67 * id(temperature).state) / + (id(temperature).state + 243.5)) * id(humidity).state * mw) / + ((273.15 + id(temperature).state) * r); // in grams/m^3 + accuracy_decimals: 2 + update_interval: 60s + icon: 'mdi:water' + unit_of_measurement: 'g/m³' + - platform: template + name: "${node_name} Dew Point" + lambda: |- + return (243.5*(log(id(humidity).state/100)+((17.67*id(temperature).state)/ + (243.5+id(temperature).state)))/(17.67-log(id(humidity).state/100)- + ((17.67*id(temperature).state)/(243.5+id(temperature).state)))); + accuracy_decimals: 1 + update_interval: 60s + unit_of_measurement: °C + icon: 'mdi:thermometer-alert' diff --git a/common/bme680.yaml b/common/bme680.yaml index 522b6e4..1dff46e 100644 --- a/common/bme680.yaml +++ b/common/bme680.yaml @@ -53,6 +53,37 @@ sensor: - median: window_size: 12 send_every: 12 + - platform: template + name: "${node_name} Equivalent sea level pressure" + id: pressure_sealevel + lambda: |- + const float STANDARD_ALTITUDE = ${altitude}; // in meters, see note + return id(pressure).state / powf(1 - ((0.0065 * STANDARD_ALTITUDE) / + (id(temperature).state + (0.0065 * STANDARD_ALTITUDE) + 273.15)), 5.257); // in hPa + update_interval: 60s + unit_of_measurement: 'hPa' + - platform: template + name: "${node_name} Absolute Humidity" + lambda: |- + const float mw = 18.01534; // molar mass of water g/mol + const float r = 8.31447215; // Universal gas constant J/mol/K + return (6.112 * powf(2.718281828, (17.67 * id(temperature).state) / + (id(temperature).state + 243.5)) * id(humidity).state * mw) / + ((273.15 + id(temperature).state) * r); // in grams/m^3 + accuracy_decimals: 2 + update_interval: 60s + icon: 'mdi:water' + unit_of_measurement: 'g/m³' + - platform: template + name: "${node_name} Dew Point" + lambda: |- + return (243.5*(log(id(humidity).state/100)+((17.67*id(temperature).state)/ + (243.5+id(temperature).state)))/(17.67-log(id(humidity).state/100)- + ((17.67*id(temperature).state)/(243.5+id(temperature).state)))); + accuracy_decimals: 1 + update_interval: 60s + unit_of_measurement: °C + icon: 'mdi:thermometer-alert' text_sensor: - platform: bme680_bsec diff --git a/common/display.yaml b/common/display.yaml index d94275b..6342ff2 100644 --- a/common/display.yaml +++ b/common/display.yaml @@ -70,7 +70,7 @@ display: if (id(temperature).state) { it.printf(2, 21+4, id(font2), COLOR_OFF, "%.1f", id(temperature).state); it.printf(55, 21+4, id(font1), COLOR_OFF, "°C"); it.printf(2, 57+4, id(font2), COLOR_OFF, "%.1f", id(humidity).state); it.printf(55, 57+4, id(font1), COLOR_OFF, "%%"); - it.printf(2, 93+4, id(font2), COLOR_OFF, "%.0f", id(pressure).state); it.printf(55, 93+4, id(font1), COLOR_OFF, "hPa"); + it.printf(2, 93+4, id(font2), COLOR_OFF, "%.0f", id(pressure_sealevel).state); it.printf(55, 93+4, id(font1), COLOR_OFF, "hPa"); it.graph(70, 21, id(temperature_graph)); it.graph(70, 57, id(humidity_graph)); it.graph(70, 93, id(pressure_graph)); diff --git a/hendrik-test.yaml b/hendrik-test.yaml index 358c24b..d31c065 100644 --- a/hendrik-test.yaml +++ b/hendrik-test.yaml @@ -1,5 +1,6 @@ substitutions: node_name: hendrik-test + altitude: "111" packages: base: !include common/base.yaml diff --git a/sensor-outdoor.yaml b/sensor-outdoor.yaml index f9fe652..4dc06f8 100644 --- a/sensor-outdoor.yaml +++ b/sensor-outdoor.yaml @@ -1,5 +1,6 @@ substitutions: node_name: sensor-outdoor + altitude: "30" packages: base: !include common/base.yaml diff --git a/sensor-springer.yaml b/sensor-springer.yaml index 54e2164..6b5b1db 100644 --- a/sensor-springer.yaml +++ b/sensor-springer.yaml @@ -1,5 +1,6 @@ substitutions: node_name: sensor-springer + altitude: "30" packages: base: !include common/base.yaml diff --git a/sensor-sz.yaml b/sensor-sz.yaml index ecceccb..a5d9abb 100644 --- a/sensor-sz.yaml +++ b/sensor-sz.yaml @@ -1,5 +1,6 @@ substitutions: node_name: sensor-sz + altitude: "30" packages: base: !include common/base.yaml diff --git a/sensor-wz.yaml b/sensor-wz.yaml index d33cd6e..84adf37 100644 --- a/sensor-wz.yaml +++ b/sensor-wz.yaml @@ -1,5 +1,6 @@ substitutions: node_name: sensor-wz + altitude: "30" packages: base: !include common/base.yaml