2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

Add rfmode MAX to enable receiving MAX! messages if firmware of CUL/Cuno is > 1.46

git-svn-id: https://svn.fhem.de/fhem/trunk@1900 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
gmaniac 2012-09-29 20:26:33 +00:00
parent 8a7f79acba
commit 0d045cc2db
2 changed files with 25 additions and 4 deletions

View File

@ -1,4 +1,5 @@
- SVN
- feature: rfmode supports to listen to MAX if fw>1.46 in 00_CUL.pm (Jens)
- feature: Status and length on cmdStack in webinterface for 10_CUL_HM
- feature: devicepair in 10_CUL_HM.pm supports unset
- feature: devicepair for single Button in 10_CUL_HM.pm (by MartinP)

View File

@ -49,6 +49,8 @@ my $clientsSlowRF = ":FS20:FHT:FHT8V:KS300:USF1000:BS:HMS: " .
my $clientsHomeMatic = ":CUL_HM:HMS:CUL_IR:"; # OneWire emulated as HMS on a CUNO
my $clientsMAX = ":CUL_MAX:"; # as a starter - not available, yet
my %matchListSlowRF = (
"1:USF1000" => "^81..(04|0c)..0101a001a5ceaa00....",
"2:BS" => "^81..(04|0c)..0101a001a5cf",
@ -71,6 +73,10 @@ my %matchListHomeMatic = (
"D:CUL_IR" => "^I............",
);
my %matchListMAX = (
"F:CUL_MAX" => "^Z........................",
);
sub
CUL_Initialize($)
{
@ -92,7 +98,7 @@ CUL_Initialize($)
$hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " .
"showtime:1,0 model:CUL,CUN,CUR loglevel:0,1,2,3,4,5,6 " .
"sendpool addvaltrigger " .
"rfmode:SlowRF,HomeMatic hmId hmProtocolEvents";
"rfmode:SlowRF,HomeMatic,MAX hmId hmProtocolEvents";
$hash->{ShutdownFn} = "CUL_Shutdown";
}
@ -683,7 +689,7 @@ CUL_Write($$$)
if($fn eq "F" || # FS20 message
$bstring =~ m/^u....F/ || # FS20 messages sent over an RFR
($fn eq "" && $bstring =~ m/^A/)) { # AskSin/BidCos/HomeMatic
($fn eq "" && ($bstring =~ m/^A/ || $bstring =~ m/^Z/ ))) { # AskSin/BidCos/HomeMatic/MAX
CUL_AddFS20Queue($hash, $bstring);
@ -702,6 +708,7 @@ CUL_SendFromQueue($$)
my $name = $hash->{NAME};
my $hm = ($bstring =~ m/^A/);
my $mz = ($bstring =~ m/^Z/);
my $to = ($hm ? 0.15 : 0.3);
if($bstring ne "") {
@ -800,7 +807,7 @@ CUL_Parse($$$$$)
my $rssi;
my $dmsg = $rmsg;
if($dmsg =~ m/^[AFTKEHRSt]([A-F0-9][A-F0-9])+$/) { # RSSI
if($dmsg =~ m/^[AFTKEHRStZ]([A-F0-9][A-F0-9])+$/) { # RSSI
my $l = length($dmsg);
$rssi = hex(substr($dmsg, $l-2, 2));
$dmsg = substr($dmsg, 0, $l-2);
@ -877,6 +884,8 @@ CUL_Parse($$$$$)
;
} elsif($fn eq "A" && $len >= 21) { # AskSin/BidCos/HomeMatic
;
} elsif($fn eq "Z" && $len >= 21) { # Moritz/Max
;
} elsif($fn eq "t" && $len >= 5) { # TX3
$dmsg = "TX".substr($dmsg,1); # t.* is occupied by FHTTK
} else {
@ -946,14 +955,24 @@ CUL_Attr(@)
my $name = $a[1];
my $hash = $defs{$name};
my $numv = substr($hash->{VERSION},2,4);
$a[3] = "SlowRF" if(!$a[3] || $a[3] ne "HomeMatic");
$a[3] = "SlowRF" if(!$a[3] || ($a[3] ne "HomeMatic" && $a[3] ne "MAX"));
if($a[3] eq "HomeMatic") {
return if($hash->{initString} =~ m/Ar/);
$hash->{Clients} = $clientsHomeMatic;
$hash->{MatchList} = \%matchListHomeMatic;
$hash->{initString} = "X21\nAr"; # X21 is needed for RSSI reporting
CUL_SimpleWrite($hash, "Zx") if($numv > 1.46); # reset MAX, if available
CUL_SimpleWrite($hash, $hash->{initString});
} elsif(($a[3] eq "MAX") && ($numv > 1.46)) {
return if($hash->{initString} =~ m/Zr/);
$hash->{Clients} = $clientsMAX;
$hash->{MatchList} = \%matchListMAX;
$hash->{initString} = "X21\nZr"; # X21 is needed for RSSI reporting
CUL_SimpleWrite($hash, "Ax"); # reset AskSin
CUL_SimpleWrite($hash, $hash->{initString});
} else {
@ -962,6 +981,7 @@ CUL_Attr(@)
$hash->{MatchList} = \%matchListSlowRF;
$hash->{initString} = "X21";
CUL_SimpleWrite($hash, "Ax"); # reset AskSin
CUL_SimpleWrite($hash, "Zx") if($numv > 1.46); # reset MAX if available
CUL_SimpleWrite($hash, $hash->{initString});
}