diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm
index 3b2fd7273..cef5078a5 100755
--- a/fhem/FHEM/10_CUL_HM.pm
+++ b/fhem/FHEM/10_CUL_HM.pm
@@ -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
diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html
index 2dc3846a2..c7ce23b64 100644
--- a/fhem/docs/commandref.html
+++ b/fhem/docs/commandref.html
@@ -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.
[sec]: Sets the delay in seconds after the lock automatically locked
again.
0 - 65535 seconds
-
# Lock the lock
set keymatic lock