mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
Rework some KeyMatic settings
git-svn-id: https://svn.fhem.de/fhem/trunk@1928 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
5a99e983ce
commit
148748dec3
@ -902,17 +902,17 @@ CUL_HM_Parse($$)
|
||||
my ($val, $err) = (hex($3), hex($4));
|
||||
|
||||
my $error = 'none';
|
||||
$error = 'motor aborted' if ($err & 0x04);
|
||||
$error = 'clutch failure' if ($err & 0x02); # Todo: check this value
|
||||
$error = 'unknown' if ($err & 0x40); # Todo: unknown error?
|
||||
push @event, "error: " . $error;
|
||||
my $stErr = ($err >>1) & 0x7;
|
||||
$error = 'motor aborted' if ($stErr == 2);
|
||||
$error = 'clutch failure' if ($stErr == 1);
|
||||
|
||||
push @event, "battery: ". (($err & 0x80) ? "low" : "ok");
|
||||
push @event, "lock: " . (($val == 1) ? "unlocked" : "locked");
|
||||
push @event, "unknown:" . ( ($err & 0x40) ? "40" : ""); # Todo: unknown error?
|
||||
push @event, "battery:". (($err & 0x80) ? "low" : "ok");
|
||||
push @event, "lock:" . (($val == 1) ? "unlocked" : "locked");
|
||||
|
||||
push @event, "uncertain: " . (($err & 0x30) ? "yes" : "no");
|
||||
push @event, "uncertain:" . (($err & 0x30) ? "yes" : "no");
|
||||
my $state = ($err & 0x30) ? " (uncertain)" : "";
|
||||
push @event, "state: " . (($val == 1) ? "unlocked" : "locked") . $state;
|
||||
push @event, "state:" . (($val == 1) ? "unlocked" : "locked") . $state;
|
||||
}
|
||||
}
|
||||
else{#####################################
|
||||
@ -1292,8 +1292,7 @@ my %culHmSubTypeSets = (
|
||||
"lock"=>"",
|
||||
"unlock"=>"[sec] ...",
|
||||
"open"=>"[sec] ...",
|
||||
"inhibit-set"=>"",
|
||||
"inhibit-clear"=>"",
|
||||
"inhibit"=>"[on|off]",
|
||||
},
|
||||
|
||||
);
|
||||
@ -1434,13 +1433,10 @@ CUL_HM_Set($@)
|
||||
CUL_HM_pushConfig($hash, $id, $dst, $chn,0,0,$chn,
|
||||
"08" . ($a[2] eq "on" ? "01":"02"));
|
||||
|
||||
}
|
||||
elsif($cmd eq "statusRequest" && $st eq "keyMatic") { ########################
|
||||
CUL_HM_PushCmdStack($hash, sprintf("++B001%s%s010E",$id,$dst)); # LEVEL_GET
|
||||
|
||||
}
|
||||
elsif($cmd eq "statusRequest") { ############################################
|
||||
my $chnFound;
|
||||
my $flag = ($st eq "keyMatic")?"B0":"A0";
|
||||
foreach my $channel (keys %{$attr{$name}}){
|
||||
next if ($channel !~ m/^channel_/);
|
||||
my $chnHash = CUL_HM_name2hash($attr{$name}{$channel});
|
||||
@ -1448,11 +1444,11 @@ CUL_HM_Set($@)
|
||||
my $chnNo = $chnHash->{DEF};
|
||||
$chnNo = substr($chnNo,6,2);
|
||||
$chnFound = 1 if ($chnNo eq "01");
|
||||
CUL_HM_PushCmdStack($hash,sprintf("++A001%s%s%s0E", $id,$dst,$chnNo));
|
||||
CUL_HM_PushCmdStack($hash,sprintf("++%s01%s%s%s0E", $flag, $id,$dst,$chnNo));
|
||||
}
|
||||
}
|
||||
# if channel or single channel device
|
||||
CUL_HM_PushCmdStack($hash,sprintf("++A001%s%s%s0E", $id,$dst,$chn))
|
||||
CUL_HM_PushCmdStack($hash,sprintf("++%s01%s%s%s0E",$flag,$id,$dst,$chn))
|
||||
if (!$chnFound);
|
||||
}
|
||||
elsif($cmd eq "getpair") { ##################################################
|
||||
@ -1651,31 +1647,27 @@ CUL_HM_Set($@)
|
||||
|
||||
}
|
||||
elsif($cmd eq "lock") { ###################################################
|
||||
CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s800100FF",$id,$dst)); # LEVEL_SET
|
||||
CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s800100FF",$id,$dst)); # LEVEL_SET
|
||||
|
||||
}
|
||||
elsif($cmd eq "unlock") { ###################################################
|
||||
$tval = (@a > 2) ? int($a[2]) : 0;
|
||||
my $delay = ($tval > 0) ? CUL_HM_encodeTime8($tval) : "FF"; # RELOCK_DELAY (255=never)
|
||||
my $delay = ($tval > 0) ? CUL_HM_encodeTime8($tval) : "FF"; # RELOCK_DELAY (FF=never)
|
||||
CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s800101%s",$id,$dst,$delay)); # LEVEL_SET
|
||||
|
||||
}
|
||||
elsif($cmd eq "open") { ###################################################
|
||||
$tval = (@a > 2) ? int($a[2]) : 0;
|
||||
my $delay = ($tval > 0) ? CUL_HM_encodeTime8($tval) : "FF"; # RELOCK_DELAY (255=never)
|
||||
my $delay = ($tval > 0) ? CUL_HM_encodeTime8($tval) : "FF"; # RELOCK_DELAY (FF=never)
|
||||
CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s8001C8%s",$id,$dst,$delay)); # OPEN
|
||||
|
||||
}
|
||||
elsif($cmd eq "inhibit-set") { ###############################################
|
||||
CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s0101",$id,$dst)); # SET_LOCK
|
||||
elsif($cmd eq "inhibit") { ###############################################
|
||||
return "$a[2] is not on or off" if($a[2] !~ m/^(on|off)$/);
|
||||
my $val = ($a[2] eq "on") ? "01" : "00";
|
||||
CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s%s01",$id,$dst,$val)); # SET_LOCK
|
||||
|
||||
}
|
||||
|
||||
elsif($cmd eq "inhibit-clear") { #############################################
|
||||
CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s0001",$id,$dst)); # SET_LOCK
|
||||
|
||||
}
|
||||
|
||||
elsif($cmd eq "pct") { ######################################################
|
||||
$a[1] = 100 if ($a[1] > 100);
|
||||
$tval = CUL_HM_encodeTime16((@a > 2)?$a[2]:85825945);# onTime 0.0..85825945.6, 0=forever
|
||||
|
@ -3748,13 +3748,11 @@ A line ending with \ will be concatenated with the next one, so long lines
|
||||
Unlocked the door so that the door can be opened.<br>
|
||||
[sec]: Sets the delay in seconds after the lock automatically locked
|
||||
again.<br>0 - 65535 seconds</li>
|
||||
<li><B>inhibit-set</B><br>
|
||||
Blocked all directly paired remotes and the hardware buttons of the
|
||||
keyMatic. Now the door lock drive can be controlled only by
|
||||
FHEM.<br></li>
|
||||
<li><B>inhibit-clear</B><br>
|
||||
Deletes the previously set inhibit-flag again.<br><br>
|
||||
Example:
|
||||
<li><B>inhibit [on|off]</B><br>
|
||||
Block / unblock all directly paired remotes and the hardware buttons of the
|
||||
keyMatic. If inhibit set on, the door lock drive can be controlled only by
|
||||
FHEM.<br><br>
|
||||
Examples:
|
||||
<ul><code>
|
||||
# Lock the lock<br>
|
||||
set keymatic lock<br><br>
|
||||
|
Loading…
Reference in New Issue
Block a user