Add abs press and dewpt.

This commit is contained in:
2022-04-24 08:00:50 -07:00
parent 042c9d6108
commit 5007b0acce
3 changed files with 93 additions and 15 deletions

View File

@@ -1,3 +1,6 @@
substitutions:
device_name: In1
esphome: esphome:
name: weather-in-1 name: weather-in-1
@@ -38,11 +41,34 @@ i2c:
sensor: sensor:
- platform: bme280 - platform: bme280
temperature: temperature:
name: "TempIn1" name: Temp${device_name}
oversampling: 16x id: bme280_temperature
pressure: pressure:
name: "PressIn1" name: Press${device_name}
id: bme280_pressure
humidity: humidity:
name: "HumidityIn1" name: HumidityRel${device_name}
id: bme280_humidity
address: 0x76 address: 0x76
update_interval: 60s update_interval: 15s
# Templates from https://esphome.io/cookbook/bme280_environment.html
- platform: template
name: HumidityAbs${device_name}
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(bme280_temperature).state) /
(id(bme280_temperature).state + 243.5)) * id(bme280_humidity).state * mw) /
((273.15 + id(bme280_temperature).state) * r); // in grams/m^3
accuracy_decimals: 2
update_interval: 15s
icon: 'mdi:water'
unit_of_measurement: 'g/m³'
- platform: template
name: DewPt${device_name}
lambda: |-
return (243.5*(log(id(bme280_humidity).state/100)+((17.67*id(bme280_temperature).state)/
(243.5+id(bme280_temperature).state)))/(17.67-log(id(bme280_humidity).state/100)-
((17.67*id(bme280_temperature).state)/(243.5+id(bme280_temperature).state))));
unit_of_measurement: °C
icon: 'mdi:thermometer-alert'

View File

@@ -1,3 +1,6 @@
substitutions:
device_name: OutN
esphome: esphome:
name: weather-out-n name: weather-out-n
@@ -38,11 +41,34 @@ i2c:
sensor: sensor:
- platform: bme280 - platform: bme280
temperature: temperature:
name: "TempOutN" name: Temp${device_name}
oversampling: 16x id: bme280_temperature
pressure: pressure:
name: "PressOutN" name: Press${device_name}
id: bme280_pressure
humidity: humidity:
name: "HumidityOutN" name: HumidityRel${device_name}
id: bme280_humidity
address: 0x76 address: 0x76
update_interval: 60s update_interval: 15s
# Templates from https://esphome.io/cookbook/bme280_environment.html
- platform: template
name: HumidityAbs${device_name}
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(bme280_temperature).state) /
(id(bme280_temperature).state + 243.5)) * id(bme280_humidity).state * mw) /
((273.15 + id(bme280_temperature).state) * r); // in grams/m^3
accuracy_decimals: 2
update_interval: 15s
icon: 'mdi:water'
unit_of_measurement: 'g/m³'
- platform: template
name: DewPt${device_name}
lambda: |-
return (243.5*(log(id(bme280_humidity).state/100)+((17.67*id(bme280_temperature).state)/
(243.5+id(bme280_temperature).state)))/(17.67-log(id(bme280_humidity).state/100)-
((17.67*id(bme280_temperature).state)/(243.5+id(bme280_temperature).state))));
unit_of_measurement: °C
icon: 'mdi:thermometer-alert'

View File

@@ -1,3 +1,6 @@
substitutions:
device_name: OutS
esphome: esphome:
name: weather-out-s name: weather-out-s
@@ -38,11 +41,34 @@ i2c:
sensor: sensor:
- platform: bme280 - platform: bme280
temperature: temperature:
name: "TempOutS" name: Temp${device_name}
oversampling: 16x id: bme280_temperature
pressure: pressure:
name: "PressOutS" name: Press${device_name}
id: bme280_pressure
humidity: humidity:
name: "HumidityOutS" name: HumidityRel${device_name}
id: bme280_humidity
address: 0x76 address: 0x76
update_interval: 60s update_interval: 15s
# Templates from https://esphome.io/cookbook/bme280_environment.html
- platform: template
name: HumidityAbs${device_name}
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(bme280_temperature).state) /
(id(bme280_temperature).state + 243.5)) * id(bme280_humidity).state * mw) /
((273.15 + id(bme280_temperature).state) * r); // in grams/m^3
accuracy_decimals: 2
update_interval: 15s
icon: 'mdi:water'
unit_of_measurement: 'g/m³'
- platform: template
name: DewPt${device_name}
lambda: |-
return (243.5*(log(id(bme280_humidity).state/100)+((17.67*id(bme280_temperature).state)/
(243.5+id(bme280_temperature).state)))/(17.67-log(id(bme280_humidity).state/100)-
((17.67*id(bme280_temperature).state)/(243.5+id(bme280_temperature).state))));
unit_of_measurement: °C
icon: 'mdi:thermometer-alert'