HMS100-CO added, Dewpoint for ks300, webcam/picture-support

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@125 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinhaas
2007-12-21 12:27:09 +00:00
parent d343a854d3
commit 49995b287d
6 changed files with 88 additions and 16 deletions

View File

@@ -37,26 +37,19 @@ function bft($windspeed) # wind speed in Beaufort
return($bft);
}
# saturation vapour pressure, approximation for
# temperature range 0°C .. +100,9°C
# see http://www.umnicom.de/Elektronik/Projekte/Wetterstation/Sensoren/SattDruck/SattDruck.htm
function svp($temperature) # saturation vapour pressure in hPa
{
$c1= 6.10780; # hPa
$c2= 17.09085;
$c3= 234.175; # °C
return($c1*exp(($c2*$temperature)/($c3+$temperature)));
}
# see http://www.umnicom.de/Elektronik/Projekte/Wetterstation/Sensoren/Taupunkte/Taupunkte.htm
# see http://de.wikipedia.org/wiki/Taupunkt, http://en.wikipedia.org/wiki/Dewpoint
# The dew point (or dewpoint) is the temperature to which a given parcel of air must be cooled, at constant
# barometric pressure, for water vapor to condense into water. The condensed water is called dew. The dew point
# is a saturation point.
# approximation valid for -30°C < $temp < 70°C
function dewpoint($temp,$hum) # dew point and temperature in °C, humidity in %
{
$svp= svp($temp);
$log= log10($svp*$hum/100.0);
return( (234.67*$log-184.2)/(8.233-$log));
$log= log($hum/100.0);
return( (241.2*$log+(4222.03716*$temp)/(241.2+$temp))/(17.5043-$log-(17.5043*$temp)/(241.22+$temp)) );
}
function randdefine()
{
$rand1 = rand(500,20000);