2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-28 05:01:57 +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:
dirkho 2012-10-05 21:50:40 +00:00
parent 5a99e983ce
commit 148748dec3
2 changed files with 24 additions and 34 deletions

View File

@ -902,17 +902,17 @@ CUL_HM_Parse($$)
my ($val, $err) = (hex($3), hex($4)); my ($val, $err) = (hex($3), hex($4));
my $error = 'none'; my $error = 'none';
$error = 'motor aborted' if ($err & 0x04); my $stErr = ($err >>1) & 0x7;
$error = 'clutch failure' if ($err & 0x02); # Todo: check this value $error = 'motor aborted' if ($stErr == 2);
$error = 'unknown' if ($err & 0x40); # Todo: unknown error? $error = 'clutch failure' if ($stErr == 1);
push @event, "error: " . $error;
push @event, "battery: ". (($err & 0x80) ? "low" : "ok"); push @event, "unknown:" . ( ($err & 0x40) ? "40" : ""); # Todo: unknown error?
push @event, "lock: " . (($val == 1) ? "unlocked" : "locked"); 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)" : ""; my $state = ($err & 0x30) ? " (uncertain)" : "";
push @event, "state: " . (($val == 1) ? "unlocked" : "locked") . $state; push @event, "state:" . (($val == 1) ? "unlocked" : "locked") . $state;
} }
} }
else{##################################### else{#####################################
@ -1292,8 +1292,7 @@ my %culHmSubTypeSets = (
"lock"=>"", "lock"=>"",
"unlock"=>"[sec] ...", "unlock"=>"[sec] ...",
"open"=>"[sec] ...", "open"=>"[sec] ...",
"inhibit-set"=>"", "inhibit"=>"[on|off]",
"inhibit-clear"=>"",
}, },
); );
@ -1434,13 +1433,10 @@ CUL_HM_Set($@)
CUL_HM_pushConfig($hash, $id, $dst, $chn,0,0,$chn, CUL_HM_pushConfig($hash, $id, $dst, $chn,0,0,$chn,
"08" . ($a[2] eq "on" ? "01":"02")); "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") { ############################################ elsif($cmd eq "statusRequest") { ############################################
my $chnFound; my $chnFound;
my $flag = ($st eq "keyMatic")?"B0":"A0";
foreach my $channel (keys %{$attr{$name}}){ foreach my $channel (keys %{$attr{$name}}){
next if ($channel !~ m/^channel_/); next if ($channel !~ m/^channel_/);
my $chnHash = CUL_HM_name2hash($attr{$name}{$channel}); my $chnHash = CUL_HM_name2hash($attr{$name}{$channel});
@ -1448,11 +1444,11 @@ CUL_HM_Set($@)
my $chnNo = $chnHash->{DEF}; my $chnNo = $chnHash->{DEF};
$chnNo = substr($chnNo,6,2); $chnNo = substr($chnNo,6,2);
$chnFound = 1 if ($chnNo eq "01"); $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 # 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); if (!$chnFound);
} }
elsif($cmd eq "getpair") { ################################################## elsif($cmd eq "getpair") { ##################################################
@ -1651,31 +1647,27 @@ CUL_HM_Set($@)
} }
elsif($cmd eq "lock") { ################################################### 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") { ################################################### elsif($cmd eq "unlock") { ###################################################
$tval = (@a > 2) ? int($a[2]) : 0; $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 CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s800101%s",$id,$dst,$delay)); # LEVEL_SET
} }
elsif($cmd eq "open") { ################################################### elsif($cmd eq "open") { ###################################################
$tval = (@a > 2) ? int($a[2]) : 0; $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 CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s8001C8%s",$id,$dst,$delay)); # OPEN
} }
elsif($cmd eq "inhibit-set") { ############################################### elsif($cmd eq "inhibit") { ###############################################
CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s0101",$id,$dst)); # SET_LOCK 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") { ###################################################### elsif($cmd eq "pct") { ######################################################
$a[1] = 100 if ($a[1] > 100); $a[1] = 100 if ($a[1] > 100);
$tval = CUL_HM_encodeTime16((@a > 2)?$a[2]:85825945);# onTime 0.0..85825945.6, 0=forever $tval = CUL_HM_encodeTime16((@a > 2)?$a[2]:85825945);# onTime 0.0..85825945.6, 0=forever

View File

@ -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> Unlocked the door so that the door can be opened.<br>
[sec]: Sets the delay in seconds after the lock automatically locked [sec]: Sets the delay in seconds after the lock automatically locked
again.<br>0 - 65535 seconds</li> again.<br>0 - 65535 seconds</li>
<li><B>inhibit-set</B><br> <li><B>inhibit [on|off]</B><br>
Blocked all directly paired remotes and the hardware buttons of the Block / unblock all directly paired remotes and the hardware buttons of the
keyMatic. Now the door lock drive can be controlled only by keyMatic. If inhibit set on, the door lock drive can be controlled only by
FHEM.<br></li> FHEM.<br><br>
<li><B>inhibit-clear</B><br> Examples:
Deletes the previously set inhibit-flag again.<br><br>
Example:
<ul><code> <ul><code>
# Lock the lock<br> # Lock the lock<br>
set keymatic lock<br><br> set keymatic lock<br><br>