mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
add optional diff-temp to dewpoint fan
git-svn-id: https://svn.fhem.de/fhem/trunk@1877 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c52f1f27b6
commit
e23cd23950
@ -73,15 +73,20 @@ dewpoint_Define($$)
|
||||
}
|
||||
} elsif ($cmd_type eq "fan") {
|
||||
# define <name> dewpoint fan devicename-regex devicename-outside min_temp
|
||||
if(@a == 6) {
|
||||
if (@a == 6 || @a == 7) {
|
||||
$hash->{DEVNAME_OUT} = $a[4];
|
||||
$hash->{MIN_TEMP} = $a[5];
|
||||
if (@a == 6) {
|
||||
$hash->{DIFF_TEMP} = 0;
|
||||
} else {
|
||||
$hash->{DIFF_TEMP} = $a[6];
|
||||
}
|
||||
} else {
|
||||
return "wrong syntax: define <name> dewpoint fan devicename-regex devicename-outside min_temp"
|
||||
return "wrong syntax: define <name> dewpoint fan devicename-regex devicename-outside min_temp [diff_temp]"
|
||||
}
|
||||
} elsif ($cmd_type eq "alarm") {
|
||||
# define <name> dewpoint alarm devicename-regex devicename-reference diff_temp
|
||||
if(@a == 6) {
|
||||
if (@a == 6) {
|
||||
$hash->{DEVNAME_REF} = $a[4];
|
||||
$hash->{DIFF_TEMP} = $a[5];
|
||||
} else {
|
||||
@ -147,7 +152,8 @@ dewpoint_Notify($$)
|
||||
}
|
||||
$devname_out = $hash->{DEVNAME_OUT};
|
||||
$min_temp = $hash->{MIN_TEMP};
|
||||
Log 1, "dewpoint_notify: cmd_type=$cmd_type devname=$devName dewname=$hashName, dev=$devName, dev_regex=$re, devname_out=$devname_out, min_temp=$min_temp" if ($dewpoint_debug == 1);
|
||||
$diff_temp = $hash->{DIFF_TEMP};
|
||||
Log 1, "dewpoint_notify: cmd_type=$cmd_type devname=$devName dewname=$hashName, dev=$devName, dev_regex=$re, devname_out=$devname_out, min_temp=$min_temp, diff_temp=$diff_temp" if ($dewpoint_debug == 1);
|
||||
|
||||
} elsif ($cmd_type eq "alarm") {
|
||||
if (!defined($hash->{DEVNAME_REF}) || !defined($hash->{DIFF_TEMP})) {
|
||||
@ -251,16 +257,16 @@ dewpoint_Notify($$)
|
||||
|
||||
Log 1, "dewpoint_notify: current=$current" if ($dewpoint_debug == 1);
|
||||
} elsif ($cmd_type eq "fan") {
|
||||
# >define <name> dewpoint fan devicename devicename-outside min-temp
|
||||
# >define <name> dewpoint fan devicename devicename-outside min-temp [diff-temp]
|
||||
#
|
||||
# This define may be used to turn an fan on or off if the outside air has less
|
||||
# water
|
||||
#
|
||||
# - Generate reading/event "fan: on" if dewpoint of <devicename-outside> is lower
|
||||
# - Generate reading/event "fan: on" if (dewpoint of <devicename-outside>) + diff_temp is lower
|
||||
# than dewpoint of <devicename> and temperature of <devicename-outside> is >= min-temp
|
||||
# and reading "fan" was not already "on".
|
||||
# - Generate reading/event "fan: off": else and if reading "fan" was not already "off".
|
||||
Log 1, "dewpoint_notify: fan devname_out=$devname_out, min_temp=$min_temp" if ($dewpoint_debug == 1);
|
||||
Log 1, "dewpoint_notify: fan devname_out=$devname_out, min_temp=$min_temp, diff_temp=$diff_temp" if ($dewpoint_debug == 1);
|
||||
my $sensor;
|
||||
my $current;
|
||||
if (exists $defs{$devname_out}{READINGS}{temperature}{VAL} && exists $defs{$devname_out}{READINGS}{humidity}{VAL}) {
|
||||
@ -268,7 +274,7 @@ dewpoint_Notify($$)
|
||||
my $humidity_out = $defs{$devname_out}{READINGS}{humidity}{VAL};
|
||||
my $dewpoint_out = sprintf("%.1f", dewpoint_dewpoint($temperature_out,$humidity_out));;
|
||||
Log 1, "dewpoint_notify: fan dewpoint_out=$dewpoint_out" if ($dewpoint_debug == 1);
|
||||
if ($dewpoint_out < $dewpoint && $temperature_out >= $min_temp) {
|
||||
if (($dewpoint_out + $diff_temp) < $dewpoint && $temperature_out >= $min_temp) {
|
||||
$current = "on";
|
||||
Log 1, "dewpoint_notify: fan ON" if ($dewpoint_debug == 1);
|
||||
} else {
|
||||
|
@ -1442,6 +1442,7 @@ A line ending with \ will be concatenated with the next one, so long lines
|
||||
<regexp>.<br><br>
|
||||
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
|
||||
<a name="Calendarattr"></a>
|
||||
@ -6962,6 +6963,7 @@ The one byte hex string is generated by the Oregon sensor when is it powered on.
|
||||
<a name="OREGONset"></a>
|
||||
<b>Set</b> <ul>N/A</ul><br>
|
||||
|
||||
|
||||
<a name="OREGONget"></a>
|
||||
<b>Get</b> <ul>N/A</ul><br>
|
||||
|
||||
@ -10184,15 +10186,15 @@ KlikAanKlikUit, NEXA, CHACON, HomeEasy UK. <br> You need to define an RFXtrx433
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<code>define <name> dewpoint fan <devicename-regex> <devicename-outside> <min-temp></code><br>
|
||||
<code>define <name> dewpoint fan <devicename-regex> <devicename-outside> <min-temp> [<diff_temp>]</code><br>
|
||||
<br>
|
||||
<ul>
|
||||
May be used to turn an fan on or off if the outside air has less water.
|
||||
<ul>
|
||||
<li>
|
||||
Generate event "fan: on" if dewpoint of <devicename-outside> is lower
|
||||
Generate event "fan: on" if (dewpoint of <devicename-outside>) + <diff_temp> is lower
|
||||
than dewpoint of <devicename> and temperature of <devicename-outside> is >= min-temp
|
||||
and reading "fan" was not already "on". The event will be generated for <devicename>.</li>
|
||||
and reading "fan" was not already "on". The event will be generated for <devicename>. Parameter <diff-temp> is optional</li>
|
||||
<li>Generate event "fan: off": else and if reading "fan" was not already "off".</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user