Last active
June 29, 2024 05:55
-
-
Save MehrCurry/2c22e72d7456090d42730ad9770c0247 to your computer and use it in GitHub Desktop.
Calculating absolute humidity with Home Assistant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - platform: template | |
| sensors: | |
| ventilation_possible: | |
| friendly_name: "Lüftung sinnvoll" | |
| value_template: > | |
| {% set inside_humidity = states('sensor.inside_absolute_humidity') | float %} | |
| {% set outside_humidity = states('sensor.outside_absolute_humidity') | float %} | |
| {% set target_humidity = states('sensor.target_absolute_humidity') | float %} | |
| {% set wet = inside_humidity - target_humidity %} | |
| {% set diff = inside_humidity - outside_humidity %} | |
| {% set humidity_condition = (wet * diff > 0) %} | |
| {{ humidity_condition }} | |
| icon_template: "mdi:fan" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - platform: template | |
| sensors: | |
| outside_absolute_humidity: | |
| unique_id: outside_absolute_humidity | |
| friendly_name: "Absolute Feuchte aussen" | |
| unit_of_measurement: "g/m^3" | |
| icon_template: mdi:water-percent | |
| value_template: > | |
| {{ (6.112 * (2.71828 ** ((17.67 * float(states('sensor.openweathermap_temperature'))) / (243.5 + float(states('sensor.openweathermap_temperature'))))) * (float(states('sensor.openweathermap_humidity')) / 100) * 216.7) / (float(states('sensor.openweathermap_temperature')) + 273.15) | round(2) }} | |
| inside_absolute_humidity: | |
| unique_id: inside_absolute_humidity | |
| friendly_name: "Absolute Feuchte innen" | |
| unit_of_measurement: "g/m^3" | |
| icon_template: mdi:water-percent | |
| value_template: > | |
| {{ (6.112 * (2.71828 ** ((17.67 * float(states('sensor.wohnzimmer_temperatur'))) / (243.5 + float(states('sensor.wohnzimmer_temperatur'))))) * (float(states('sensor.wohnzimmer_luftfeuchtigkeit')) / 100) * 216.7) / (float(states('sensor.wohnzimmer_temperatur')) + 273.15) | round(2) }} | |
| target_absolute_humidity: | |
| unique_id: target_absolute_humidity | |
| friendly_name: "Absolute Feuchte Sollwert" | |
| unit_of_measurement: "g/m^3" | |
| icon_template: mdi:water-percent | |
| value_template: > | |
| {{ (6.112 * (2.71828 ** ((17.67 * float(states('sensor.wohnzimmer_temperatur'))) / (243.5 + float(states('sensor.wohnzimmer_temperatur'))))) * (float(states('input_number.luftfeuchtigkeit_sollwert')) / 100) * 216.7) / (float(states('sensor.wohnzimmer_temperatur')) + 273.15) | round(2) }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment