diff --git a/fhem/FHEM/00_CUL.pm b/fhem/FHEM/00_CUL.pm index c3a1c46d0..3487d59b7 100755 --- a/fhem/FHEM/00_CUL.pm +++ b/fhem/FHEM/00_CUL.pm @@ -76,10 +76,6 @@ CUL_Initialize($) # Provider $hash->{ReadFn} = "CUL_Read"; $hash->{WriteFn} = "CUL_Write"; - $hash->{Clients} = $clientsSlowRF; - $hash->{MatchList} = \%matchListSlowRF; - $hash->{HomeMaticClients} = $clientsHomeMatic; - $hash->{HomeMaticMatchList} = \%matchListHomeMatic; $hash->{ReadyFn} = "CUL_Ready"; # Normal devices @@ -117,6 +113,8 @@ CUL_Define($$) if(uc($a[3]) !~ m/^[0-6][0-9A-F][0-6][0-9A-F]$/); $hash->{FHTID} = uc($a[3]); $hash->{initString} = "X21"; + $hash->{Clients} = $clientsSlowRF; + $hash->{MatchList} = \%matchListSlowRF; if($dev eq "none") { Log 1, "$name device is none, commands will be echoed only"; @@ -1122,13 +1120,15 @@ CUL_Attr(@) if($a[3] eq "HomeMatic") { return if($hash->{initString} eq "Ar"); - $hash->{mode} = "HomeMatic"; + $hash->{Clients} = $clientsHomeMatic; + $hash->{MatchList} = \%matchListHomeMatic; $hash->{initString} = "Ar"; CUL_SimpleWrite($hash, $hash->{initString}); } else { return if($hash->{initString} eq "X21"); - delete($hash->{mode}); + $hash->{Clients} = $clientsSlowRF; + $hash->{MatchList} = \%matchListSlowRF; $hash->{initString} = "X21"; CUL_SimpleWrite($hash, "Ax"); CUL_SimpleWrite($hash, $hash->{initString}); diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index 93dc57b1e..f2d032471 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -22,6 +22,7 @@ my %culHmDevProps=( "41" => { st => "sensor", cl => "sender" }, "42" => { st => "swi", cl => "sender" }, "43" => { st => "pushButton", cl => "sender" }, + "60" => { st => "KFM100", cl => "sender" }, "80" => { st => "threeStateSensor",cl => "sender" }, "81" => { st => "motionDetector", cl => "sender" }, "C0" => { st => "keyMatic", cl => "sender" }, @@ -86,7 +87,9 @@ my %culHmModel=( "0044" => "HM-SEN-EP", "0045" => "HM-SEC-WDS", "0046" => "HM-SWI-3-FM", + "0047" => "KFM-Display", "0048" => "IS-WDS-TH-OD-S-R3", + "0049" => "KFM-Sensor", "004A" => "HM-SEC-MDIR", "004C" => "HM-RC-12-SW", "004D" => "HM-RC-19-SW", @@ -324,7 +327,7 @@ CUL_HM_Set($@) return "Usage: set $a[0] $cmd [on|off] " if(@a != 6); return "$a[2] is not a button number" if($a[2] !~ m/^\d$/); return "$a[3] is not on or off" if($a[3] !~ m/^(on|off)$/); - my $bn = $a[2]*2-($a[3] eq "on" ? 1 : 0); + my $bn = $a[2]*2-($a[3] eq "on" ? 0 : 1); CUL_HM_PushCmdStack($hash, sprintf("++A001%s%s%02d050000000001", $id, $hash->{DEF}, $bn)); @@ -344,8 +347,8 @@ CUL_HM_Set($@) $tl = length($l1); for(my $l = 0; $l < $tl; $l+=28) { my $ml = $tl-$l < 28 ? $tl-$l : 28; - CUL_HM_PushCmdStack($hash, - sprintf("++A001%s%s%02d08%s", $id, $hash->{DEF}, $bn, substr($l1,$l,$ml))); + CUL_HM_PushCmdStack($hash, sprintf("++A001%s%s%02d08%s", + $id, $hash->{DEF}, $bn, substr($l1,$l,$ml))); } CUL_HM_PushCmdStack($hash, @@ -411,12 +414,13 @@ CUL_HM_Pair(@) my $stn = $attr{$name}{subType}; # subTypeName my $stt = $stn eq "unknown" ? "subType unknown" : "is a $stn"; - Log GetLogLevel($name,2), "CUL_HM pair: $name $stt, model $attr{$name}{model} ". - "serialNr $attr{$name}{serialNr}"; + Log GetLogLevel($name,2), + "CUL_HM pair: $name $stt, model $attr{$name}{model} ". + "serialNr $attr{$name}{serialNr}"; # Abort if we are not authorized if($dst eq "000000") { - return if(!$iohash->{HM_PAIR} && !AttrVal($iohash->{NAME}, "hm_autopair", 0)); + return if(!$iohash->{hmPair}); } elsif($dst ne $id) { return "" ; diff --git a/fhem/FHEM/93_FHEM2FHEM.pm b/fhem/FHEM/93_FHEM2FHEM.pm index 5e9789ad9..80d49479d 100755 --- a/fhem/FHEM/93_FHEM2FHEM.pm +++ b/fhem/FHEM/93_FHEM2FHEM.pm @@ -24,7 +24,6 @@ FHEM2FHEM_Initialize($) $hash->{WriteFn} = "FHEM2FHEM_Write"; $hash->{ReadyFn} = "FHEM2FHEM_Ready"; $hash->{noRawInform} = 1; - $hash->{regexpClients} = ".*"; # Normal devices $hash->{DefFn} = "FHEM2FHEM_Define"; @@ -54,6 +53,7 @@ FHEM2FHEM_Define($$) } else { $hash->{remoteDevice} = $2; $hash->{remoteDevice} =~ s/^://; + $hash->{regexpClients} = ".*"; } my $dev = $a[2];