Skip to content
Snippets Groups Projects
Commit 5de0894b authored by Jan Grewe's avatar Jan Grewe
Browse files

fix VPD calculation

parent 094ef882
Branches
No related tags found
No related merge requests found
......@@ -5,12 +5,13 @@ sensor:
update_interval: 5s
accuracy_decimals: 2
unit_of_measurement: 'kPa'
<<: !include filter.yaml
lambda: |-
float temperature = (id(mlx90614_temperature_object).state - 32) * 5/9;
float humidity = id(bme280_humidity).state;
float vpSaturation = 610.7 * pow(10, (7.5 * temperature / (temperature + 237.3)));
float vpDeficit = ((100.0 - humidity) / 100.0) * vpSaturation;
return vpDeficit / 1000;
// https://vpdchart.com/grow-guide/vpd.html#how-to-calculate-vpd
float vp_leaf = 610.7 * pow(10, 7.5 * id(mlx90614_temperature_object).state / (237.3+id(mlx90614_temperature_object).state)) / 1000;
float vp_air = 610.7 * pow(10, 7.5 * id(bme280_temperature).state / (237.3+id(bme280_temperature).state) ) / 1000 * id(bme280_humidity).state/100;
float vpd = vp_leaf - vp_air;
return vpd;
prometheus:
relabel:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment