mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-07 22:29:19 +00:00
hmInfo add sum for protoEvents, HM prohibit TC iregulat peering
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4604 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
18e34540c6
commit
44e8f69e30
@ -3343,15 +3343,18 @@ sub CUL_HM_Set($@) {
|
|||||||
}
|
}
|
||||||
elsif($cmd eq "peerChan") { ############################################# reg
|
elsif($cmd eq "peerChan") { ############################################# reg
|
||||||
#peerChan <btnN> <device> ... [single|dual] [set|unset] [actor|remote|both]
|
#peerChan <btnN> <device> ... [single|dual] [set|unset] [actor|remote|both]
|
||||||
my ($bNo,$peerN,$single,$set,$target) = ($a[2],$a[3],$a[4],$a[5],$a[6]);
|
my ($bNo,$peerN,$single,$set,$target) = ($a[2],$a[3],($a[4]?$a[4]:"dual"),
|
||||||
|
($a[5]?$a[5]:"set"),
|
||||||
|
($a[6]?$a[6]:"both"));
|
||||||
$state = "";
|
$state = "";
|
||||||
return "$bNo is not a button number" if(($bNo < 1) && !$roleC);
|
return "$bNo is not a button number" if(($bNo < 1) && !$roleC);
|
||||||
my $peerId = CUL_HM_name2Id($peerN);
|
my $peerId = CUL_HM_name2Id($peerN);
|
||||||
return "please enter peer" if(!$peerId);
|
return "please enter peer" if(!$peerId);
|
||||||
$peerId .= "01" if( length($peerId)==6);
|
$peerId .= "01" if( length($peerId)==6);
|
||||||
|
|
||||||
my ($peerChn,$peerBtn,$peerHash,$myBtn);
|
my ($peerChn,$peerBtn,$peerHash,$myBtn,$cmdB);
|
||||||
my $peerDst = substr($peerId,0,6);
|
my $peerDst = substr($peerId,0,6);
|
||||||
|
my $pmd = AttrVal(CUL_HM_id2Name($peerDst), "model" , "");
|
||||||
|
|
||||||
if ($md =~ m/HM-CC-RT-DN/ && $chn eq "05" ){# rt team peers cross from 05 to 04
|
if ($md =~ m/HM-CC-RT-DN/ && $chn eq "05" ){# rt team peers cross from 05 to 04
|
||||||
$myBtn = $peerBtn = "04";
|
$myBtn = $peerBtn = "04";
|
||||||
@ -3364,18 +3367,20 @@ sub CUL_HM_Set($@) {
|
|||||||
$peerHash = $modules{CUL_HM}{defptr}{$peerDst.$peerChn}if ($modules{CUL_HM}{defptr}{$peerDst.$peerChn});
|
$peerHash = $modules{CUL_HM}{defptr}{$peerDst.$peerChn}if ($modules{CUL_HM}{defptr}{$peerDst.$peerChn});
|
||||||
$peerHash = $modules{CUL_HM}{defptr}{$peerDst} if (!$peerHash);
|
$peerHash = $modules{CUL_HM}{defptr}{$peerDst} if (!$peerHash);
|
||||||
|
|
||||||
return "$peerN not a CUL_HM device" if($target && ($target ne "remote") &&(!$peerHash ||$peerHash->{TYPE} ne "CUL_HM"));
|
return "$peerN not a CUL_HM device" if(($target ne "remote") &&(!$peerHash ||$peerHash->{TYPE} ne "CUL_HM"));
|
||||||
return "$single must be single or dual" if(defined($single) && ($single !~ m/^(single|dual)$/));
|
return "$single must be single or dual" if($single !~ m/^(single|dual)$/);
|
||||||
return "$set must be set or unset" if(defined($set) && ($set !~ m/^(set|unset)$/));
|
return "$set must be set or unset" if($set !~ m/^(set|unset)$/);
|
||||||
return "$target must be [actor|remote|both]" if(defined($target) && ($target !~ m/^(actor|remote|both)$/));
|
return "$target must be [actor|remote|both]" if($target !~ m/^(actor|remote|both)$/);
|
||||||
return "use climate chan to pair TC" if( $md =~ m/(HM-CC-TC|ROTO_ZEL-STG-RM-FWT)/ && $myBtn ne "02");
|
return "use - single [set|unset] actor - for smoke detector" if( $st eq "smokeDetector" && ($single ne "single" || $target ne "actor"));
|
||||||
return "use - single [set|unset] actor - for smoke detector" if( $st eq "smokeDetector" && (!$single || $single ne "single" || $target ne "actor"));
|
return "use - single - for ".$st if(($st =~ m/(threeStateSensor|thermostat|motionDetector)/) && ($single ne "single"));
|
||||||
return "use - single - for ".$st if(($st =~ m/(threeStateSensor|thermostat|motionDetector)/)
|
return "TC WindowRec only peers to channel 01 single" if( $pmd =~ m/(HM-CC-TC|ROTO_ZEL-STG-RM-FWT)/ && $peerChn eq "03" && $myBtn ne "01" && $set eq "set");
|
||||||
&& (!$single || $single ne "single"));
|
|
||||||
my $pSt = CUL_HM_Get($peerHash,$peerHash->{NAME},"param","subType");
|
my $pSt = CUL_HM_Get($peerHash,$peerHash->{NAME},"param","subType");
|
||||||
|
|
||||||
$single = ($single eq "single")?1:"";#default to dual
|
$single = ($single eq "single")?1:"";#default to dual
|
||||||
$set = ($set && $set eq "unset")?0:1;
|
|
||||||
|
if ($set eq "unset"){$set = 0;$cmdB ="02";}
|
||||||
|
else {$set = 1;$cmdB ="01";}
|
||||||
|
|
||||||
my ($b1,$b2,$nrCh2Pair);
|
my ($b1,$b2,$nrCh2Pair);
|
||||||
$b1 = ($roleC) ? hex($myBtn) : ($single?$bNo : ($bNo*2 - 1));
|
$b1 = ($roleC) ? hex($myBtn) : ($single?$bNo : ($bNo*2 - 1));
|
||||||
@ -3389,7 +3394,6 @@ sub CUL_HM_Set($@) {
|
|||||||
$nrCh2Pair = 2;
|
$nrCh2Pair = 2;
|
||||||
}
|
}
|
||||||
$target = "both" if ($st eq "virtual" && $pSt eq "smokeDetector");
|
$target = "both" if ($st eq "virtual" && $pSt eq "smokeDetector");
|
||||||
my $cmdB = ($set)?"01":"02";# do we set or remove?
|
|
||||||
|
|
||||||
# First the remote (one loop for on, one for off)
|
# First the remote (one loop for on, one for off)
|
||||||
if (!$target || $target =~ m/^(remote|both)$/){
|
if (!$target || $target =~ m/^(remote|both)$/){
|
||||||
@ -4084,11 +4088,10 @@ sub CUL_HM_respPendTout($) {
|
|||||||
Log3 $name,4,"CUL_HM_Resend: $name nr ".$pHash->{rspWait}{reSent};
|
Log3 $name,4,"CUL_HM_Resend: $name nr ".$pHash->{rspWait}{reSent};
|
||||||
if ($hash->{protCondBurst}&&$hash->{protCondBurst} eq "on" ){
|
if ($hash->{protCondBurst}&&$hash->{protCondBurst} eq "on" ){
|
||||||
#timeout while conditional burst was active. try re-wakeup
|
#timeout while conditional burst was active. try re-wakeup
|
||||||
my (undef,$addr,$msg) = unpack 'A10A12A*',
|
my $addr = CUL_HM_IOid($hash);
|
||||||
$hash->{helper}{prt}{rspWait}{cmd};
|
|
||||||
$pHash->{rspWaitSec}{$_} = $pHash->{rspWait}{$_}
|
$pHash->{rspWaitSec}{$_} = $pHash->{rspWait}{$_}
|
||||||
foreach (keys%{$pHash->{rspWait}});
|
foreach (keys%{$pHash->{rspWait}});
|
||||||
CUL_HM_SndCmd($hash,"++B112$addr");
|
CUL_HM_SndCmd($hash,"++B112$addr$HMid");
|
||||||
$hash->{helper}{prt}{awake}=4;# start re-wakeup
|
$hash->{helper}{prt}{awake}=4;# start re-wakeup
|
||||||
}
|
}
|
||||||
elsif(CUL_HM_getRxType($hash) & 0x08){# wakeup devices
|
elsif(CUL_HM_getRxType($hash) & 0x08){# wakeup devices
|
||||||
|
@ -405,6 +405,7 @@ sub HMinfo_SetFn($@) {#########################################################
|
|||||||
$type = "long" if(!$type);
|
$type = "long" if(!$type);
|
||||||
my @paramList;
|
my @paramList;
|
||||||
my @IOlist;
|
my @IOlist;
|
||||||
|
my @plSum; push @plSum,0 for (0..9);#prefill
|
||||||
foreach my $dName (HMinfo_getEntities($opt."dv",$filter)){
|
foreach my $dName (HMinfo_getEntities($opt."dv",$filter)){
|
||||||
my $id = $defs{$dName}{DEF};
|
my $id = $defs{$dName}{DEF};
|
||||||
my ($found,$para) = HMinfo_getParam($id,
|
my ($found,$para) = HMinfo_getParam($id,
|
||||||
@ -419,13 +420,18 @@ sub HMinfo_SetFn($@) {#########################################################
|
|||||||
$_ =~ s/..-.. ..:..:..//g if ($type eq "short");
|
$_ =~ s/..-.. ..:..:..//g if ($type eq "short");
|
||||||
$_ =~ s/CMDs // if ($type eq "short");
|
$_ =~ s/CMDs // if ($type eq "short");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (1..9){
|
||||||
|
my ($x) = $pl[$_] =~ /(\d+)/;
|
||||||
|
$plSum[$_] += $x;
|
||||||
|
}
|
||||||
if ($type eq "short"){
|
if ($type eq "short"){
|
||||||
push @paramList, sprintf("%-20s%-17s|%-10s|%-10s|%-10s#%-10s|%-10s|%-10s|%-10s",
|
push @paramList, sprintf("%-20s%-17s|%-10s|%-10s|%-10s#%-10s|%-10s|%-10s|%-10s",
|
||||||
$pl[0],$pl[1],$pl[2],$pl[3],$pl[5],$pl[6],$pl[7],$pl[8],$pl[9]);
|
@pl[0..3],@pl[5..9]);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
push @paramList, sprintf("%-20s%-17s|%-18s|%-18s|%-14s|%-18s#%-18s|%-18s|%-18s|%-18s",
|
push @paramList, sprintf("%-20s%-17s|%-18s|%-18s|%-14s|%-18s#%-18s|%-18s|%-18s|%-18s",
|
||||||
$pl[0],$pl[1],$pl[2],$pl[3],$pl[4],$pl[5],$pl[6],$pl[7],$pl[8],$pl[9]);
|
@pl[0..9]);
|
||||||
}
|
}
|
||||||
push @IOlist,$defs{$pl[0]}{IODev}->{NAME};
|
push @IOlist,$defs{$pl[0]}{IODev}->{NAME};
|
||||||
}
|
}
|
||||||
@ -440,8 +446,16 @@ sub HMinfo_SetFn($@) {#########################################################
|
|||||||
,"State","CmdPend"
|
,"State","CmdPend"
|
||||||
,"Snd","Resnd"
|
,"Snd","Resnd"
|
||||||
,"CmdDel","ResndFail","Nack","IOerr") if ($type eq "short");
|
,"CmdDel","ResndFail","Nack","IOerr") if ($type eq "short");
|
||||||
$ret = $cmd." done:" ."\n ".$hdr ."\n ".(join "\n ",sort @paramList)
|
$ret = $cmd." done:" ."\n ".$hdr ."\n ".(join "\n ",sort @paramList);
|
||||||
;
|
$ret .= "\n======================================================="
|
||||||
|
."=========================================================";
|
||||||
|
if ($type eq "short"){
|
||||||
|
$ret .= "\n ".sprintf("%-20s%-17s|%-10s|%-10s|%-10s#%-10s|%-10s|%-10s|%-10s","sum",@plSum[1..3],@plSum[5..9]);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$ret .= "\n ".sprintf("%-20s%-17s|%-18s|%-18s|%-14s|%-18s#%-18s|%-18s|%-18s|%-18s","sum",@plSum[1..9]);
|
||||||
|
}
|
||||||
|
|
||||||
$ret .= "\n\n CUL_HM queue:$modules{CUL_HM}{prot}{rspPend}";
|
$ret .= "\n\n CUL_HM queue:$modules{CUL_HM}{prot}{rspPend}";
|
||||||
$ret .= "\n";
|
$ret .= "\n";
|
||||||
$ret .= "\n autoReadReg pending:" .join(",",@{$modules{CUL_HM}{helper}{qReqConf}})
|
$ret .= "\n autoReadReg pending:" .join(",",@{$modules{CUL_HM}{helper}{qReqConf}})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user