2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

00_CUL.pm: Kopp_FC patches from Claus (private mail)

git-svn-id: https://svn.fhem.de/fhem/trunk@10472 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-01-12 08:34:51 +00:00
parent 780a97b78e
commit 3a1f6cb762

View File

@ -52,6 +52,7 @@ my $clientsSlowRF = ":FS20:FHT.*:KS300:USF1000:BS:HMS: ".
my $clientsHomeMatic = ":CUL_HM:HMS:CUL_IR:STACKABLE_CC:"; my $clientsHomeMatic = ":CUL_HM:HMS:CUL_IR:STACKABLE_CC:";
my $clientsMAX = ":CUL_MAX:HMS:CUL_IR:STACKABLE_CC:"; my $clientsMAX = ":CUL_MAX:HMS:CUL_IR:STACKABLE_CC:";
my $clientsWMBus = ":WMBUS:HMS:CUL_IR:STACKABLE_CC:"; my $clientsWMBus = ":WMBUS:HMS:CUL_IR:STACKABLE_CC:";
my $clientsKOPP_FC = ":KOPP_FC:HMS:CUL_IR:STACKABLE_CC:";
my %matchListSlowRF = ( my %matchListSlowRF = (
"1:USF1000" => "^81..(04|0c)..0101a001a5ceaa00....", "1:USF1000" => "^81..(04|0c)..0101a001a5ceaa00....",
@ -76,6 +77,7 @@ my %matchListSlowRF = (
"K:CUL_TCM97001" => "^s[A-F0-9]+", "K:CUL_TCM97001" => "^s[A-F0-9]+",
"L:CUL_REDIRECT" => "^o+", "L:CUL_REDIRECT" => "^o+",
); );
my %matchListHomeMatic = ( my %matchListHomeMatic = (
"1:CUL_HM" => "^A....................", "1:CUL_HM" => "^A....................",
"8:HMS" => "^810e04....(1|5|9).a001", # CUNO OneWire HMS Emulation "8:HMS" => "^810e04....(1|5|9).a001", # CUNO OneWire HMS Emulation
@ -89,6 +91,7 @@ my %matchListMAX = (
"D:CUL_IR" => "^I............", "D:CUL_IR" => "^I............",
"H:STACKABLE_CC"=>"^\\*", "H:STACKABLE_CC"=>"^\\*",
); );
my %matchListWMBus = ( my %matchListWMBus = (
"J:WMBUS" => "^b.*", "J:WMBUS" => "^b.*",
"8:HMS" => "^810e04....(1|5|9).a001", # CUNO OneWire HMS Emulation "8:HMS" => "^810e04....(1|5|9).a001", # CUNO OneWire HMS Emulation
@ -96,6 +99,14 @@ my %matchListWMBus = (
"H:STACKABLE_CC"=>"^\\*", "H:STACKABLE_CC"=>"^\\*",
); );
my %matchListKOPP_FC = (
"1:Kopp_FC" => "^kr..................",
"8:HMS" => "^810e04....(1|5|9).a001", # CUNO OneWire HMS Emulation
"D:CUL_IR" => "^I............",
"H:STACKABLE_CC"=>"^\\*",
);
sub sub
CUL_Initialize($) CUL_Initialize($)
{ {
@ -117,7 +128,7 @@ CUL_Initialize($)
$hash->{AttrFn} = "CUL_Attr"; $hash->{AttrFn} = "CUL_Attr";
$hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " . $hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " .
"showtime:1,0 model:CUL,CUN sendpool addvaltrigger ". "showtime:1,0 model:CUL,CUN sendpool addvaltrigger ".
"rfmode:SlowRF,HomeMatic,MAX,WMBus_T,WMBus_S ". "rfmode:SlowRF,HomeMatic,MAX,WMBus_T,WMBus_S,KOPP_FC ".
"hmId longids ". "hmId longids ".
"hmProtocolEvents:0_off,1_dump,2_dumpFull,3_dumpTrigger " . "hmProtocolEvents:0_off,1_dump,2_dumpFull,3_dumpTrigger " .
$readingFnAttributes; $readingFnAttributes;
@ -919,6 +930,8 @@ CUL_Parse($$$$@)
; ;
} elsif($fn eq "o" && $len >= 5) { # CUL_REDIRECT } elsif($fn eq "o" && $len >= 5) { # CUL_REDIRECT
; ;
} elsif($fn eq "k" && $len >= 20) { # KOPP_FC
;
} else { } else {
DoTrigger($name, "UNKNOWNCODE $dmsg"); DoTrigger($name, "UNKNOWNCODE $dmsg");
Log3 $name, 2, "$name: unknown message $dmsg"; Log3 $name, 2, "$name: unknown message $dmsg";
@ -1002,10 +1015,11 @@ CUL_Attr(@)
my $hash = $defs{$name}; my $hash = $defs{$name};
$aVal = "SlowRF" if(!$aVal || $aVal = "SlowRF" if(!$aVal ||
($aVal ne "HomeMatic" && ($aVal ne "HomeMatic"
$aVal ne "MAX" && && $aVal ne "MAX"
$aVal ne "WMBus_T" && && $aVal ne "WMBus_T"
$aVal ne "WMBus_S")); && $aVal ne "WMBus_S"
&& $aVal ne "KOPP_FC"));
my $msg = $hash->{NAME} . ": Mode $aVal not supported"; my $msg = $hash->{NAME} . ": Mode $aVal not supported";
if($aVal eq "HomeMatic") { if($aVal eq "HomeMatic") {
@ -1036,24 +1050,35 @@ CUL_Attr(@)
return $msg; return $msg;
} }
} elsif($aVal eq "WMBus_S") { } elsif($aVal eq "WMBus_S") {
return if($hash->{initString} =~ m/brs/); return if($hash->{initString} =~ m/brs/);
if($hash->{CMDS} =~ m/b/ || IsDummy($hash->{NAME}) || !$hash->{FD}) { if($hash->{CMDS} =~ m/b/ || IsDummy($hash->{NAME}) || !$hash->{FD}) {
$hash->{Clients} = $clientsWMBus; $hash->{Clients} = $clientsWMBus;
$hash->{MatchList} = \%matchListWMBus; $hash->{MatchList} = \%matchListWMBus;
$hash->{initString} = "X21\nbrs"; # Use S-Mode, X21 is needed for RSSI reporting $hash->{initString} = "X21\nbrs"; # Use S-Mode
CUL_WriteInit($hash); CUL_WriteInit($hash);
} else { } else {
Log3 $name, 2, $msg; Log3 $name, 2, $msg;
return $msg; return $msg;
} }
} elsif($aVal eq "WMBus_T") { } elsif($aVal eq "WMBus_T") {
return if($hash->{initString} =~ m/brt/); return if($hash->{initString} =~ m/brt/);
if($hash->{CMDS} =~ m/b/ || IsDummy($hash->{NAME}) || !$hash->{FD}) { if($hash->{CMDS} =~ m/b/ || IsDummy($hash->{NAME}) || !$hash->{FD}) {
$hash->{Clients} = $clientsWMBus; $hash->{Clients} = $clientsWMBus;
$hash->{MatchList} = \%matchListWMBus; $hash->{MatchList} = \%matchListWMBus;
$hash->{initString} = "X21\nbrt"; # Use T-Mode, X21 is needed for RSSI reporting $hash->{initString} = "X21\nbrt"; # Use T-Mode
CUL_WriteInit($hash);
} else {
Log3 $name, 2, $msg;
return $msg;
}
} elsif($aVal eq "KOPP_FC") {
if($hash->{CMDS} =~ m/k/ || IsDummy($hash->{NAME}) || !$hash->{FD}) {
$hash->{Clients} = $clientsKOPP_FC;
$hash->{MatchList} = \%matchListKOPP_FC;
$hash->{initString} = "krS"; # krS: start Kopp receive Mode
CUL_WriteInit($hash); CUL_WriteInit($hash);
} else { } else {
@ -1061,7 +1086,6 @@ CUL_Attr(@)
return $msg; return $msg;
} }
} else { } else {
return if($hash->{initString} eq "X21"); return if($hash->{initString} eq "X21");
$hash->{Clients} = $clientsSlowRF; $hash->{Clients} = $clientsSlowRF;