I am trying ESP fo the first time and want to calculate Dewpoint from the RH and Temperature sensor of a BME280 sensor.
I get readings for the RH and T from the sensor fine, but can’t get the calulation to work.
Say the RH is 57.4 and the T is 23.4, I should get about 14.5C for the Dewpoint
All the methods I try result in about 67C - any ideas what I am doing wrong?
- platform: bme280
temperature:
name: "Conservatory BME280 Temperature (ESP)"
id: bme280_temperature
oversampling: 16x
pressure:
name: "Conservatory BME280 Pressure (ESP)"
id: bme280_humidity
humidity:
name: "Conservatory BME280 Humidity (ESP)"
id: bme280_pressure
address: 0x76
update_interval: 60s
- platform: template
name: "1 Conservatory BME280 Dew Point (ESP)"
#//https://community.home-assistant.io/t/how-to-do-maths-in-sensor-template-with-esphome-on-hassio/193994/4
lambda: |-
const float a = 17.27; //const from https://planetcalc.com/248/
const float b = 237.7; //const from https://planetcalc.com/248/
return ( (b * ( (id(bme280_temperature).state * a) / ( b + id(bme280_temperature).state) +
logf (id(bme280_humidity).state/100) ) )/( a - ( (id(bme280_temperature).state * a) /
( b + id(bme280_temperature).state) + logf (id(bme280_humidity).state/100) ) ) );
unit_of_measurement: °C
icon: 'mdi:thermometer-alert'
update_interval: 15s
- platform: template
name: "2 Conservatory BME280 Dew Point (ESP)"
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'
update_interval: 15s
- platform: template
name: "3 Conservatory BME280 Dew Point (ESP)"
lambda: |-
return (
(pow(id(bme280_humidity).state/100.0,1.0/8.0))
*
(((0.9*id(bme280_temperature).state)+112.0))
+
(((0.1*id(bme280_temperature).state)-112.0))
);
unit_of_measurement: °C
icon: 'mdi:thermometer-alert'
update_interval: 15s
- platform: template
name: "4 Conservatory BME280 Dew Point (ESP)"
lambda: !lambda |-
return 243.04*(log(id(bme280_humidity).state/100.) + ((17.625*id(bme280_temperature).state)/(243.04+id(bme280_temperature).state)))/(17.625-log(id(bme280_humidity).state/100.)-((17.625*id(bme280_temperature).state)/(243.04+id(bme280_temperature).state)));
# Dewpoint calculated using equation (21) of this paper: Alduchov, O. A., and R. E. Eskridge, 1996: Improved Magnus' form approximation of saturation vapor pressure. J. Appl. Meteor., 35, 601–609
#[https://doi.org/10.1175/1520-0450(1996)035%3C0601:IMFAOS%3E2.0.CO;2]
unit_of_measurement: "°C"
icon: 'mdi:thermometer-alert'
update_interval: 15s