{% set T = states('sensor.agv_esp32_greenhouse_inside_temperature')|float(none) %} {% set RH = states('sensor.agv_esp32_greenhouse_inside_humidity')|float(none) %} {% if T is not none and RH is not none and RH > 0 %} {% set a = 17.62 %} {% set b = 243.12 %} {% set gamma = (a * T) / (b + T) + log(RH / 100) %} {{ ((b * gamma) / (a - gamma)) | round(2) }} {% else %} {{ none }} {% endif %}