mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-15 22:26:04 +00:00
deactivated with cmd1_gt or cmd2_lt
git-svn-id: https://svn.fhem.de/fhem/trunk@5903 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
610a395351
commit
6f3e02a5a7
@ -54,8 +54,8 @@ THRESHOLD_Define($$$)
|
||||
my $target_sensor;
|
||||
my $target_reading;
|
||||
my $offset=0;
|
||||
my $pn = $a[0];
|
||||
|
||||
my $pn = $a[0];
|
||||
|
||||
if (@b > 6 || @a < 3 || @a > 6) {
|
||||
my $msg = "wrong syntax: define <name> THRESHOLD " .
|
||||
"<sensor>:<reading1>:<hysteresis>:<target_value>:<offset> AND|OR <sensor2>:<reading2>:<state> ".
|
||||
@ -243,7 +243,7 @@ THRESHOLD_Define($$$)
|
||||
{
|
||||
my $mode="external";
|
||||
readingsBulkUpdate ($hash, "cmd", "wait for next cmd");
|
||||
readingsBulkUpdate ($hash, "mode", "external");
|
||||
readingsBulkUpdate ($hash, "mode",$mode);
|
||||
}
|
||||
readingsEndUpdate ($hash, 1);
|
||||
# my $msg = THRESHOLD_Check($hash);
|
||||
@ -293,6 +293,21 @@ THRESHOLD_Set($@)
|
||||
readingsEndUpdate ($hash, 1);
|
||||
return THRESHOLD_Check($hash);
|
||||
} elsif ($arg eq "deactivated" ) {
|
||||
if ($value ne "") {
|
||||
if ($value eq "cmd1_gt" ) {
|
||||
readingsBeginUpdate ($hash);
|
||||
THRESHOLD_setValue ($hash,1);
|
||||
THRESHOLD_set_state ($hash);
|
||||
readingsEndUpdate ($hash, 1);
|
||||
} elsif ($value eq "cmd2_lt" ) {
|
||||
readingsBeginUpdate ($hash);
|
||||
THRESHOLD_setValue ($hash,2);
|
||||
THRESHOLD_set_state ($hash);
|
||||
readingsEndUpdate ($hash, 1);
|
||||
} else {
|
||||
return "$pn: set deactivated: $value, unknown command";
|
||||
}
|
||||
}
|
||||
$ret=CommandAttr(undef, "$pn disable 1");
|
||||
} elsif ($arg eq "active" ) {
|
||||
return "$pn: set active, set desired value first" if ($desired_value eq "");
|
||||
@ -844,8 +859,9 @@ THRESHOLD_setValue($$)
|
||||
Set the desired value. If no desired value is set, the module is not active.
|
||||
</li>
|
||||
<br>
|
||||
<li> <code>set <name> deactivated <value><br></code>
|
||||
Module is disabled.
|
||||
<li><code>set <name> deactivated <command><br></code>
|
||||
Module is disabled.<br>
|
||||
<command> is optional. It can be "cmd1_gt" or "cmd2_lt" passed in order to achieve a defined state before disabling the module.
|
||||
</li>
|
||||
<br>
|
||||
<li> <code>set <name> active <value><br></code>
|
||||
@ -1219,8 +1235,9 @@ THRESHOLD_setValue($$)
|
||||
Sollwert-Vorgabe durch einen Sensor wird hiermit übersteuert, solange bis "set external" gesetzt wird.
|
||||
</li>
|
||||
<br>
|
||||
<li><code>set <name> deactivated <value><br></code>
|
||||
Modul wird deaktiviert.
|
||||
<li><code>set <name> deactivated <command><br></code>
|
||||
Modul wird deaktiviert.<br>
|
||||
<command> ist optional. Es kann "cmd1_gt" oder "cmd2_lt" übergeben werden, um vor dem Deaktivieren des Moduls einen definierten Zustand zu erreichen.
|
||||
</li>
|
||||
<br>
|
||||
<li><code>set <name> active<br></code>
|
||||
|
Loading…
x
Reference in New Issue
Block a user