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') }}