Hi,
I'm trying to reconstitute some historical data to include in one of my temp/humidity sensors. Can some one please point me to the formula used to calculate the dew-point. I've found several on the web but they give different results that don't correspond to what I see in Domoticz. I've tried looking in the source but I've no idea in which file its defined.
Thanks for any help.
Chris
Dewpoint calculation.
Moderators: leecollings, remb0
- kiddigital
- Posts: 438
- Joined: Thursday 10 August 2017 6:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Dewpoint calculation.
Look at `main/helper.cpp`.
It contains a Dew Point calculation function.
It contains a Dew Point calculation function.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
One RPi with Pi foundation standard touch screen to display Dashticz
-
- Posts: 16
- Joined: Monday 23 October 2017 17:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.5
- Contact:
Solved: Dewpoint calculation.
Hi,
OK, I've answered my own question - it's in main/helper.cpp.
It's the same formula that I already found except that the constants are different!
(C1 * (LOG(Hum/100) + ( (C2 *Temp / (C1 +Temp ) ))) / (C2 - (LOG(Hum/100) + ( (C2 *Temp ) / (C1 +Temp ) )))
C1 in Domoticz is 243.04, my search elsewhere gives 237.3
C2 in Domoticz is 17.625, elsewhere 17.27
No idea, for the moment why the difference.
Anyway, after testing, the real problem was that I was using LOG base 10 instead of natural LOG, my bad
The difference in constants only makes a few hundredths of a degree difference.
Chris
OK, I've answered my own question - it's in main/helper.cpp.
It's the same formula that I already found except that the constants are different!
(C1 * (LOG(Hum/100) + ( (C2 *Temp / (C1 +Temp ) ))) / (C2 - (LOG(Hum/100) + ( (C2 *Temp ) / (C1 +Temp ) )))
C1 in Domoticz is 243.04, my search elsewhere gives 237.3
C2 in Domoticz is 17.625, elsewhere 17.27
No idea, for the moment why the difference.
Anyway, after testing, the real problem was that I was using LOG base 10 instead of natural LOG, my bad

The difference in constants only makes a few hundredths of a degree difference.
Chris
- FireWizard
- Posts: 1889
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Dewpoint calculation.
Hi @redswan,
Have a look at my post at viewtopic.php?p=279553&hilit=Dewpoint#p279553
This contains a javascript function of the Dewpoint calculation and is identical to what Domoticz is using. However I do not understand the function of the second "if" statement in the Domoticz calculation. If it is the intention to avoid a division by zero, then the lines 620/621 are wrong.
Regards
Have a look at my post at viewtopic.php?p=279553&hilit=Dewpoint#p279553
This contains a javascript function of the Dewpoint calculation and is identical to what Domoticz is using. However I do not understand the function of the second "if" statement in the Domoticz calculation. If it is the intention to avoid a division by zero, then the lines 620/621 are wrong.
Regards
-
- Posts: 16
- Joined: Monday 23 October 2017 17:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.5
- Contact:
Re: Dewpoint calculation.
Just saw your replies - thanks @Kiddigital, @Firewizard
Who is online
Users browsing this forum: Google [Bot] and 1 guest