mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
complete TCIT register, re-specify RC19 buttonregister
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4710 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
25cddaaf90
commit
0bd9b011ee
@ -2189,10 +2189,7 @@ sub CUL_HM_Get($@) {
|
|||||||
elsif($cmd eq "reg") { #####################################################
|
elsif($cmd eq "reg") { #####################################################
|
||||||
my (undef,undef,$regReq,$list,$peerId) = @a;
|
my (undef,undef,$regReq,$list,$peerId) = @a;
|
||||||
if ($regReq eq 'all'){
|
if ($regReq eq 'all'){
|
||||||
my @regArr = keys %{$culHmRegGeneral};
|
my @regArr = CUL_HM_getRegN($st,$md,$chn);
|
||||||
push @regArr, keys %{$culHmRegType->{$st}} if($culHmRegType->{$st});
|
|
||||||
push @regArr, keys %{$culHmRegModel->{$md}} if($culHmRegModel->{$md});
|
|
||||||
push @regArr, keys %{$culHmRegChan->{$md.$chn}} if($culHmRegChan->{$md.$chn});
|
|
||||||
|
|
||||||
my @peers; # get all peers we have a reglist
|
my @peers; # get all peers we have a reglist
|
||||||
my @listWp; # list that require peers
|
my @listWp; # list that require peers
|
||||||
@ -2236,20 +2233,7 @@ sub CUL_HM_Get($@) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif($cmd eq "regList") { #################################################
|
elsif($cmd eq "regList") { #################################################
|
||||||
my @regArr = keys %{$culHmRegGeneral};
|
my @regArr = CUL_HM_getRegN($st,$md,$chn);
|
||||||
push @regArr, keys %{$culHmRegType->{$st}} if($culHmRegType->{$st});
|
|
||||||
push @regArr, keys %{$culHmRegModel->{$md}} if($culHmRegModel->{$md});
|
|
||||||
|
|
||||||
if ($isChannel){
|
|
||||||
push @regArr, keys %{$culHmRegChan->{$md.$chn}} if($culHmRegChan->{$md.$chn});
|
|
||||||
}
|
|
||||||
else{# add all ugly channel register to device view
|
|
||||||
for my $chnId (CUL_HM_getAssChnIds($name)){
|
|
||||||
my $chnN = substr($chnId,6,2);
|
|
||||||
push @regArr, keys %{$culHmRegChan->{$md.$chnN}}
|
|
||||||
if($culHmRegChan->{$md.$chnN});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
my @rI;
|
my @rI;
|
||||||
foreach my $regName (@regArr){
|
foreach my $regName (@regArr){
|
||||||
@ -2669,16 +2653,9 @@ sub CUL_HM_Set($@) {
|
|||||||
|
|
||||||
my (undef,undef,$regName,$data,$peerChnIn) = @a;
|
my (undef,undef,$regName,$data,$peerChnIn) = @a;
|
||||||
$state = "";
|
$state = "";
|
||||||
if (!$culHmRegType->{$st}{$regName} &&
|
my @regArr = CUL_HM_getRegN($st,$md,$chn);
|
||||||
!$culHmRegGeneral->{$regName} &&
|
return "$regName failed: supported register are ".join(" ",sort @regArr)
|
||||||
!$culHmRegModel->{$md}{$regName} &&
|
if (!grep /^$regName$/,@regArr );
|
||||||
!$culHmRegChan->{$md.$chn}{$regName} ){
|
|
||||||
my @regArr = keys %{$culHmRegGeneral};
|
|
||||||
push @regArr, keys %{$culHmRegType->{$st}} if($culHmRegType->{$st});
|
|
||||||
push @regArr, keys %{$culHmRegModel->{$md}} if($culHmRegModel->{$md});
|
|
||||||
push @regArr, keys %{$culHmRegChan->{$md.$chn}} if($culHmRegChan->{$md.$chn});
|
|
||||||
return "$regName failed: supported register are ".join(" ",sort @regArr);
|
|
||||||
}
|
|
||||||
|
|
||||||
my $reg = $culHmRegDefine->{$regName};
|
my $reg = $culHmRegDefine->{$regName};
|
||||||
return $st." - ".$regName # give some help
|
return $st." - ".$regName # give some help
|
||||||
@ -4624,10 +4601,7 @@ sub CUL_HM_updtRegDisp($$$) {
|
|||||||
my $md = $attr{$devName}{model} ?$attr{$devName}{model} :"";
|
my $md = $attr{$devName}{model} ?$attr{$devName}{model} :"";
|
||||||
my $chn = $hash->{DEF};
|
my $chn = $hash->{DEF};
|
||||||
$chn = (length($chn) == 8)?substr($chn,6,2):"";
|
$chn = (length($chn) == 8)?substr($chn,6,2):"";
|
||||||
my @regArr = keys %{$culHmRegGeneral};
|
my @regArr = CUL_HM_getRegN($st,$md,$chn);
|
||||||
push @regArr, keys %{$culHmRegType->{$st}} if($culHmRegType->{$st});
|
|
||||||
push @regArr, keys %{$culHmRegModel->{$md}} if($culHmRegModel->{$md});
|
|
||||||
push @regArr, keys %{$culHmRegChan->{$md.$chn}} if($culHmRegChan->{$md.$chn});
|
|
||||||
my @changedRead;
|
my @changedRead;
|
||||||
my $expL = CUL_HM_getAttrInt($name,"expert");
|
my $expL = CUL_HM_getAttrInt($name,"expert");
|
||||||
my $expLvl = ($expL != 0)?1:0;
|
my $expLvl = ($expL != 0)?1:0;
|
||||||
@ -4654,6 +4628,9 @@ sub CUL_HM_updtRegDisp($$$) {
|
|||||||
elsif ($md =~ m/HM-CC-RT-DN/){#handle temperature readings
|
elsif ($md =~ m/HM-CC-RT-DN/){#handle temperature readings
|
||||||
CUL_HM_RTtempReadings($hash) if ($list == 7 && $chn eq "04");
|
CUL_HM_RTtempReadings($hash) if ($list == 7 && $chn eq "04");
|
||||||
}
|
}
|
||||||
|
elsif ($md =~ m/HM-TC-IT-WM-W-EU/){#handle temperature readings
|
||||||
|
CUL_HM_TCITtempReadings($hash) if ($list >= 7 && $chn eq "02");
|
||||||
|
}
|
||||||
elsif ($md eq "HM-PB-4DIS-WM"){#add text
|
elsif ($md eq "HM-PB-4DIS-WM"){#add text
|
||||||
CUL_HM_4DisText($hash) if ($list == 1) ;
|
CUL_HM_4DisText($hash) if ($list == 1) ;
|
||||||
}
|
}
|
||||||
@ -4852,6 +4829,14 @@ sub CUL_HM_time2min($) { # minutes -> time
|
|||||||
return $m;
|
return $m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub CUL_HM_getRegN($$$){
|
||||||
|
my ($st,$md,$chn) = @_;
|
||||||
|
my @regArr = keys %{$culHmRegGeneral};
|
||||||
|
push @regArr, keys %{$culHmRegType->{$st}} if($culHmRegType->{$st});
|
||||||
|
push @regArr, keys %{$culHmRegModel->{$md}} if($culHmRegModel->{$md});
|
||||||
|
push @regArr, keys %{$culHmRegChan->{$md.$chn}} if($culHmRegChan->{$md.$chn});
|
||||||
|
return @regArr;
|
||||||
|
}
|
||||||
sub CUL_HM_4DisText($) { # convert text for 4dis
|
sub CUL_HM_4DisText($) { # convert text for 4dis
|
||||||
#text1: start at 54 (0x36) length 12 (0x0c)
|
#text1: start at 54 (0x36) length 12 (0x0c)
|
||||||
#text2: start at 70 (0x46) length 12 (0x0c)
|
#text2: start at 70 (0x46) length 12 (0x0c)
|
||||||
@ -5008,6 +4993,68 @@ sub CUL_HM_RTtempReadings($) {# parse RT temperature readings
|
|||||||
"winOpnDetFall:" .ReadingsVal($name,"R-winOpnDetFall" ,"unknown"),);
|
"winOpnDetFall:" .ReadingsVal($name,"R-winOpnDetFall" ,"unknown"),);
|
||||||
return $setting;
|
return $setting;
|
||||||
}
|
}
|
||||||
|
sub CUL_HM_TCITtempReadings($) {# parse RT temperature readings
|
||||||
|
my ($hash)=@_;
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
my $regPre = ((CUL_HM_getAttrInt($name,"expert") == 2)?"":".");
|
||||||
|
my @changedRead;
|
||||||
|
my $setting;
|
||||||
|
my %idxN = (7=>"P1",8=>"P2",9=>"P3");
|
||||||
|
foreach my $lst (7,8,9){
|
||||||
|
my $tempRegs = ReadingsVal($name,$regPre."RegL_0$lst:","");
|
||||||
|
my $stmpRegs = ($hash->{helper}{shadowReg}{"RegL_0$lst:"})? # need to compare actual data
|
||||||
|
($hash->{helper}{shadowReg}{"RegL_0$lst:"})
|
||||||
|
:$tempRegs;
|
||||||
|
# return "reglist incomplete\n" if ($tempRegs !~ m/00:00/);
|
||||||
|
|
||||||
|
my @days = ("Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri");
|
||||||
|
|
||||||
|
$tempRegs =~ s/.* 14://; #remove register up to addr 20 from list
|
||||||
|
$tempRegs =~ s/ 00:00/ /g; #remove regline termination
|
||||||
|
$tempRegs =~ s/ ..://g; #remove addr Info
|
||||||
|
$tempRegs =~ s/ //g; #blank
|
||||||
|
|
||||||
|
$stmpRegs =~ s/.* 14://;
|
||||||
|
$stmpRegs =~ s/ 00:00/ /g;
|
||||||
|
$stmpRegs =~ s/ ..://g;
|
||||||
|
$stmpRegs =~ s/ //g;
|
||||||
|
|
||||||
|
push (@changedRead,"tempList$idxN{$lst}_State:".
|
||||||
|
($hash->{helper}{shadowReg}{"RegL_0$lst:"} ?"set":"verified"));
|
||||||
|
for (my $day = 0;$day<7;$day++){
|
||||||
|
my $dayRead = "";
|
||||||
|
my $pre ="";
|
||||||
|
my @time;
|
||||||
|
my @temp;
|
||||||
|
my $str;
|
||||||
|
if (substr($stmpRegs,$day *13*4,13*4) eq
|
||||||
|
substr($tempRegs,$day *13*4,13*4) ){
|
||||||
|
$str = substr($tempRegs,$day *13*4,13*4);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$str = substr($stmpRegs,$day *13*4,13*4);
|
||||||
|
$pre = "set_";
|
||||||
|
}
|
||||||
|
foreach (unpack '(A4)*',$str){
|
||||||
|
my $h = hex($_);
|
||||||
|
push @temp,($h >> 9)/2;
|
||||||
|
$h = ($h & 0x1ff) * 5;
|
||||||
|
$h = sprintf("%02d:%02d",int($h / 60),($h%60));
|
||||||
|
push @time,$h;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (my $idx = 0;$idx<13;$idx++){
|
||||||
|
my $entry = sprintf(" %s %3.01f",$time[$idx],$temp[$idx]);
|
||||||
|
$setting .= "Temp set: ".$days[$day].$entry." C\n";
|
||||||
|
$dayRead .= $entry;
|
||||||
|
last if ($time[$idx] eq "24:00");
|
||||||
|
}
|
||||||
|
push (@changedRead,"tempList$idxN{$lst}".$days[$day].":".$pre." ".$dayRead);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CUL_HM_UpdtReadBulk($hash,1,@changedRead) if (@changedRead);
|
||||||
|
return $setting;
|
||||||
|
}
|
||||||
sub CUL_HM_repReadings($) { # parse repeater
|
sub CUL_HM_repReadings($) { # parse repeater
|
||||||
my ($hash)=@_;
|
my ($hash)=@_;
|
||||||
my %pCnt;
|
my %pCnt;
|
||||||
|
@ -748,9 +748,7 @@ $culHmRegType{pushButton} = $culHmRegType{remote};
|
|||||||
|
|
||||||
%culHmRegModel = (
|
%culHmRegModel = (
|
||||||
"HM-RC-12" =>{ backAtKey =>1, backAtMotion =>1, backOnTime =>1},
|
"HM-RC-12" =>{ backAtKey =>1, backAtMotion =>1, backOnTime =>1},
|
||||||
"HM-RC-19" =>{ backAtKey =>1, backAtMotion =>1, backOnTime =>1,backAtCharge =>1,language =>1
|
"HM-RC-19" =>{ backAtKey =>1, backAtMotion =>1, backOnTime =>1,backAtCharge =>1,language =>1},
|
||||||
,lcdSymb =>1, lcdLvlInterp =>1
|
|
||||||
},
|
|
||||||
"HM-RC-4-2" =>{ localResDis =>1},
|
"HM-RC-4-2" =>{ localResDis =>1},
|
||||||
|
|
||||||
"HM-LC-Bl1PBU-FM" =>{ transmitTryMax =>1,statusInfoMinDly=>1,statusInfoRandom=>1,localResDis =>1},
|
"HM-LC-Bl1PBU-FM" =>{ transmitTryMax =>1,statusInfoMinDly=>1,statusInfoRandom=>1,localResDis =>1},
|
||||||
@ -924,6 +922,7 @@ $culHmRegModel{"ROTO_ZEL-STG-RM-FSA"} = $culHmRegModel{"HM-CC-VD"};
|
|||||||
"HM-RC-1912" =>{ msgShowTime =>1, beepAtAlarm =>1, beepAtService =>1,beepAtInfo =>1
|
"HM-RC-1912" =>{ msgShowTime =>1, beepAtAlarm =>1, beepAtService =>1,beepAtInfo =>1
|
||||||
,backlAtAlarm =>1, backlAtService =>1, backlAtInfo =>1
|
,backlAtAlarm =>1, backlAtService =>1, backlAtInfo =>1
|
||||||
},
|
},
|
||||||
|
"HM-RC-1901" =>{ lcdSymb =>1, lcdLvlInterp =>1},
|
||||||
"HM-OU-CFM-PL01" =>{ ActTypeLed =>1},
|
"HM-OU-CFM-PL01" =>{ ActTypeLed =>1},
|
||||||
"HM-OU-CFM-PL02" =>{ ActTypeMp3 =>1,Intense =>1},
|
"HM-OU-CFM-PL02" =>{ ActTypeMp3 =>1,Intense =>1},
|
||||||
"HM-SEC-WIN01" =>{ setupDir =>1,pullForce =>1,pushForce =>1,tiltMax =>1
|
"HM-SEC-WIN01" =>{ setupDir =>1,pullForce =>1,pushForce =>1,tiltMax =>1
|
||||||
@ -1013,6 +1012,12 @@ $culHmRegModel{"ROTO_ZEL-STG-RM-FSA"} = $culHmRegModel{"HM-CC-VD"};
|
|||||||
#clones - - - - - - - - - - - - - - -
|
#clones - - - - - - - - - - - - - - -
|
||||||
$culHmRegChan{"HM-RC-19-B12"} = $culHmRegChan{"HM-RC-1912"};
|
$culHmRegChan{"HM-RC-19-B12"} = $culHmRegChan{"HM-RC-1912"};
|
||||||
$culHmRegChan{"HM-RC-19-SW12"} = $culHmRegChan{"HM-RC-1912"};
|
$culHmRegChan{"HM-RC-19-SW12"} = $culHmRegChan{"HM-RC-1912"};
|
||||||
|
foreach (2..16){
|
||||||
|
my $c = sprintf("%02X",$_);
|
||||||
|
$culHmRegChan{"HM-RC-19$c"} = $culHmRegChan{"HM-RC-1901"};
|
||||||
|
$culHmRegChan{"HM-RC-19-B$c"} = $culHmRegChan{"HM-RC-1901"};
|
||||||
|
$culHmRegChan{"HM-RC-19-SW$c"} = $culHmRegChan{"HM-RC-1901"};
|
||||||
|
}
|
||||||
|
|
||||||
$culHmRegChan{"WDF-solar02"} = $culHmRegType{"dimmer"};
|
$culHmRegChan{"WDF-solar02"} = $culHmRegType{"dimmer"};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user