Anyone know a way to get a sensor that shows dew point based on temperature and humidity sensor?
This sensor has a dew point attribute:
In case you dināt found one:
I tried this custom component, but could not get it to work. I installed via HACS, restarted HA and then tried to add the config to configuration.yaml, but got an error when I tried to restart that dewpoint platform was not recognised or something like that.
Gavin, The manifest needs a version number added to it. see Issue #2 on the github repositry.
Once you have added a version number the integration works well.
~Brian
U can use this fork, as it is beeing updated:
Hey this is great and no errors when HA is loading.
https://github.com/miguelangel-nubla/home-assistant-dewpoint
Updated to.
- Core2025.1.0
- Supervisor2024.12.3
- Operating System14.1
- Frontend20250103.0
Configuration warnings
Platform error āsensorā from integration ādewpointā - cannot import name āTEMP_CELSIUSā from āhomeassistant.constā (/usr/src/homeassistant/homeassistant/const.py)
This project is quite old and hasnāt been updated in a long time. Iād recommend using Thermal Comfort instead. It offers a lot more features, including dew point calculation.
If youāre only looking for a simple sensor for dew point, Iāve actually made one myself. Itās not on GitHub yet, but I can upload it if youāre interested!
Thermal Comfort is no good for me. I need multiple custom dew point sensors for my āSimple Air Comfort Cardā. I did not see a way to achieve that with Thermal Comfort.
Definitely interested.
I ended up using creating new Template Sensors.
Iāve just uploaded my Dew Point Integration for Home Assistant to GitHub. Itās available to install via HACS, and the setup is completely UI-based, making it super simple to get started.
The integration calculates the dew point temperature using the Arden Buck equation, ensuring accurate results. It uses your existing temperature and humidity sensors to provide this data, along with additional attributes for temperature and humidity directly in the entity.
If you want to monitor dew points in multiple areas, you can easily create multiple dew point sensors for different locations. Just add more sensors via the UI ā no YAML required!
Feel free to try it out, and let me know your feedback or any suggestions for improvements!
What does your integration do that a template sensor couldnāt do? I know your formula is a bit more involved, but I donāt think itās anything that couldnāt be done in a template. FWIW I used the formula from here.
- name: "Indoor Dew Point"
unique_id: indoor_dew_point
icon: mdi:thermometer-water
device_class: temperature
state_class: measurement
unit_of_measurement: "Ā°C"
state: >
{% set temp = states('sensor.indoor_temperature') | float %}
{% set humidity = states('sensor.indoor_humidity') | float %}
{% set dp = temp - ((100 - humidity)/5) %}
{{ '%0.1f' | format(dp) }}
availability: >
{{ is_number(states('sensor.indoor_temperature'))
and is_number(states('sensor.indoor_humidity')) }}
Not a knock on your integration, just curious if Iām missing something.
Edit: Now Iām curious. I might just setup up your integration and track the differences in values over time.
Youāre absolutely right, a template sensor can certainly calculate the dew point, and itās a great way to customize things in Home Assistant. However, there are some differences between the template sensor youāve shared and my integration. And the key difference is the formula.
The template sensor youāve shared uses the Lawrence formula, which is a simplified method to approximate the dew point. This formula is quick and effective, especially for relative humidity values above 50%. However, itās less accurate at extreme temperatures or humidity levels since it doesnāt account for the non-linear relationship between temperature, humidity, and vapor pressure.
My integration, on the other hand, uses the Arden Buck equation, which provides a more precise calculation by considering the exponential relationship between temperature and saturation vapor pressure. This can give a more accurate result, particularly in environments where precision matters (e.g., very high or very low humidity).
That said, thereās absolutely nothing wrong with using a template sensor, itās a fantastic approach! My integration is simply an alternative for those who:
- Prefer a plug-and-play solution without writing templates.
- Want a more precise calculation using Arden Buckās formula.
- Appreciate the ability to manage multiple dew point sensors entirely through the Home Assistant UI.
Different approaches for different needs
At the end of the day, Home Assistant is all about flexibility. Whether you use a template sensor or an integration depends on your preferences and needs. Both methods are valid, and I think itās wonderful that we have multiple options to achieve the same goal!
If youāre happy with your template sensor, thatās great! But if someone is looking for a slightly more precise calculation without diving into YAML, my integration might be a good fit.
For those interested in code, this thread on the Home Assistant Community Forum provides information on creating multiple sensors using macro syntax with the Arden Buck equation as the calculation method. I havenāt tried it myself, but according to the thread, it seems to work well.
Thereās also an integration called Thermal Comfort, which is excellent for those looking for a variety of thermal indices and thermal perceptions. It offers a lot of additional functionality.
As always, it comes down to what you need and how you prefer to set things up!
Thank you for taking the time to compose your very thoughtful reply. So the difference is basically the calculation, which is what I was wondering. My outdoor dew point is provided by my weather integration and I have to assume they did the work to make it as accurate as possible!
My template sensor is just for indoor, and I did use a mehā¦good enuf approach for it. I didnāt feel like putting the effort into converting the AB formula into jinja. Thanks to modern climate controls itās not very often Iām out of the ācomfortableā range indoors anyway. But I did bookmark that thread. Since someone went through the trouble to do the work, I might as well use it! But I am going to compare the simplified template to your integration for a while just to see how accurate the simplified formula really is. Iām sure someone has already done this somewhere, so itās more just for shits and giggles
The thermal comfort integration also looks very interesting. Iāve also bookmarked that to check it out when I get a moment.
Yes, youāre absolutely right, the key differences really boil down to the calculation method and the installation/setup experience. Your approach with the simplified formula is definitely āgood enoughā for many use cases, especially in controlled indoor environments like yours. Itās great to see how flexible Home Assistant is in accommodating different levels of precision and complexity based on user needs.
Iād be genuinely interested to hear about your comparison results between the simplified template sensor and my integration. Itās always fascinating to see how close the two approaches get, especially in typical indoor conditions versus more extreme cases. I havenāt personally tried the simplified Lawrence formula in a template sensor, so I canāt say how much it deviates in practice.
I did a quick calculation using a temperature of 1.1 Ā°C and a relative humidity of 84.2%.as it is outside here right now, the two methods give the following results and the difference here is about 0.79 Ā°C, which shows how the methods can diverge
ā¢ Arden Buck equation: -1.27 Ā°C
ā¢ Lawrence simplified formula: -2.06 Ā°C
If you do find any noteworthy differences, or even if the results are nearly identical, it would be great to hear your findings! I think these kinds of experiments help everyone better understand what works best for their specific scenarios.
For the below temperature and humidity ranges Arden Buck seems to match Lawrence to 1 decimal place. turns out after checking, my macro is using the Arden Buck equation. Dropping the P as the thread on the Home Assistant Community Forum mentions.
Feels Like (Top Right)
Dew Point (Top Left)
MACRO custom_templates/macros.jinja
{% macro calculate_dew_point(entity_temperature, entity_humidity) %}
{% set T, RH = states(entity_temperature), states(entity_humidity) %}
{% if (T == 'unknown') or (RH == 'unknown') %}
unknown
{% elif (T == 'unavailable') or (RH == 'unavailable') %}
unavailable
{% else %}
{% set T = T | float %}
{% set RH = RH | float %}
{% set a = 6.1121 | float %}
{% set b = 18.678 | float %}
{% set c = 257.14 | float %}
{% set d = 234.5 | float %}
{% set e = 2.71828 | float %}
{% set gamma = log((RH/100)*e**((b-T/d)*(T/(c+T)))) | float %}
{% set dew_point = ((c * gamma) / (b - gamma)) | round(1) %}
{{ dew_point }}
{% endif %}
{% endmacro %}
TEMPLATE SENSOR - configuration.yaml/
- sensor:
- name: "dewpoint_outside"
unique_id: 2fac14a6-affd-4985-88d6-67b3cff34e3f
unit_of_measurement: "Ā°C"
icon: mdi:thermometer-water
state: >
{% from 'macros.jinja' import calculate_dew_point %}
{{ calculate_dew_point('sensor.netatmo_outdoor_temperature', 'sensor.netatmo_outdoor_humidity') }}