Dewpoint calculation.

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
redswan
Posts: 16
Joined: Monday 23 October 2017 17:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.5
Contact:

Dewpoint calculation.

Post by redswan »

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
User avatar
kiddigital
Posts: 438
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Dewpoint calculation.

Post by kiddigital »

Look at `main/helper.cpp`.

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
redswan
Posts: 16
Joined: Monday 23 October 2017 17:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.5
Contact:

Solved: Dewpoint calculation.

Post by redswan »

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 :oops:
The difference in constants only makes a few hundredths of a degree difference.

Chris
User avatar
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.

Post by FireWizard »

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
redswan
Posts: 16
Joined: Monday 23 October 2017 17:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.5
Contact:

Re: Dewpoint calculation.

Post by redswan »

Just saw your replies - thanks @Kiddigital, @Firewizard
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest