Skip to content

Instantly share code, notes, and snippets.

@sicknesz
Created January 25, 2021 19:25
Show Gist options
  • Select an option

  • Save sicknesz/a7e8671dda52f8943d512084740d63e1 to your computer and use it in GitHub Desktop.

Select an option

Save sicknesz/a7e8671dda52f8943d512084740d63e1 to your computer and use it in GitHub Desktop.
vapor_deficit:
friendly_name: 'VPD in kilo pascals'
value_template: >-
{% set T = states('sensor.growtent_temp') | float %}
{% set RH = states('sensor.growtent_humidity') | float %}
{% set t = states('input_number.leaf_temperature') | float %}
{% set VPSat = 610.7 * 10 ** (7.5 * t / (t + 237.3)) / 1000 %}
{% set VPAir = (610.7 * 10 ** (7.5 * T / (T + 237.3)) / 1000) * (RH/100) %}
{% set VPD = VPSat - VPAir %}
{{- VPD | round(2) -}}
unit_of_measurement: 'kPa'
icon_template: >-
mdi:gauge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment