2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 04:36:02 +00:00

OT2-final, others

git-svn-id: https://svn.fhem.de/fhem/trunk@3963 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-09-26 08:55:32 +00:00
parent 5ad0604063
commit 53b61900af
4 changed files with 52 additions and 20 deletions

View File

@ -856,7 +856,7 @@ FW_doDetail($)
## dependent objects
my @dob; # dependent objects - triggered by current device
foreach my $dn (sort keys %defs) {
next if($dn eq $d);
next if(!$dn || $dn eq $d);
my $dh = $defs{$dn};
if(($dh->{DEF} && $dh->{DEF} =~ m/\b$d\b/) ||
($h->{DEF} && $h->{DEF} =~ m/\b$dn\b/)) {

View File

@ -930,14 +930,20 @@ sub CUL_HM_Parse($$) {##############################
elsif($st eq "THSensor") { ##################################################
if ($mTp eq "70"){
my $chn = 1;
$chn = 5 if ($md eq "HM-WDS30-OT2-SM");
$chn = 10 if ($md =~ m/^(WS550|WS888|HM-WDC7000)/);#todo use channel correct
my $t = hex(substr($p,0,4));
$t -= 32768 if($t > 1638.4);
$t = sprintf("%0.1f", $t/10);
my $statemsg = "state:T: $t";
push @event, "temperature:$t";#temp is always there
if ($md !~ m/^(S550IA|HM-WDS30-T-O)$/){#ignore only-temp sensors
if ($md eq "HM-WDS30-OT2-SM"){
$chn = 5;
my $chnHash = $modules{CUL_HM}{defptr}{$src.$chn};
push @entities,CUL_HM_UpdtReadBulk($chnHash,1,$statemsg,
"temperature:$t")
if ($chnHash);
}
elsif ($md !~ m/^(S550IA|HM-WDS30-T-O)$/){#skip temp-only sens
my $h = hex(substr($p,4,2));
$statemsg .= " H: $h";
push @event, "humidity:$h";
@ -956,7 +962,6 @@ sub CUL_HM_Parse($$) {##############################
$d = hex($d);
$d -= 0x10000 if($d & 0xC000);
$d = sprintf("T: %0.1f",$d/10);
my $chId = sprintf("%02X",hex($a) & 0x3f);
if($modules{CUL_HM}{defptr}{$src.$chId}){
push @entities,CUL_HM_UpdtReadSingle($modules{CUL_HM}{defptr}{$src.$chId}
@ -2589,6 +2594,9 @@ sub CUL_HM_Set($@) {
return "entry must be between 1 and 36" if ($eNo < 1 || $eNo > 36);
my $sndID = CUL_HM_name2Id($sId);
my $recID = CUL_HM_name2Id($rId);
$sndID = AttrVal($sId,"hmId","");
if ($sndID !~ m/(^[0-9A-F]{6})$/){$sndID = AttrVal($sId,"hmId","");};
if ($recID !~ m/(^[0-9A-F]{6})$/){$recID = AttrVal($rId,"hmId","");};
return "sender ID $sId unknown:".$sndID if ($sndID !~ m/(^[0-9A-F]{6})$/);
return "receiver ID $rId unknown:".$recID if ($recID !~ m/(^[0-9A-F]{6})$/);
return "broadcast must be yes or now" if ($bCst !~ m/^(yes|no)$/);
@ -4320,17 +4328,21 @@ sub CUL_HM_repReadings($) {# for repeater in:hash, out: string with peers
push @pB,$b;
}
my @readList;
for (my $n=0;$n<36;$n++){
push @readList,"repPeer_$n:undefined" ;
}
push @readList,"repPeer_$_:undefined" for(0..35);#set default empty
my @retL;
foreach my$pId(sort keys %pCnt){
my ($pdID,$bdcst,$no) = unpack('A6A2A2',$pId);
my $fNo = $no-1;#shorthand field number, often used
my $sName = CUL_HM_id2Name($pdID);
if ($sName eq $pdID && $pD[$fNo]){
$sName = $defs{$pD[$fNo]}->{IODev}{NAME}
if($attr{$defs{$pD[$fNo]}->{IODev}{NAME}}{hmId} eq $pdID);
}
my $eS = sprintf("%02d %-15s %-15s %-3s %-4s",
$no,$sName
$no
,$sName
,((!$pS[$fNo] || $pS[$fNo] ne $sName)?"unknown":" dst>$pD[$fNo]")
,($bdcst eq "01"?"yes":"no ")
,($pB[$fNo] && ( ($bdcst eq "01" && $pB[$fNo] eq "y")

View File

@ -34,7 +34,7 @@ sub HMinfo_Define($$){#########################################################
my @a = split("[ \t][ \t]*", $def);
my $name = $hash->{NAME};
$hash->{Version} = "01";
$attr{$name}{webCmd} = "update:protoEvents:rssi:peerXref:configCheck:models";
$attr{$name}{webCmd} = "update:protoEvents short:rssi:peerXref:configCheck:models";
$attr{$name}{sumStatus} = "battery"
.",sabotageError"
.",powerError"
@ -88,7 +88,7 @@ sub HMinfo_getParam(@) { ######################################################
my $found = 0;
foreach (@param){
my $para = CUL_HM_Get($ehash,$eName,"param",$_);
push @paramList,sprintf("%-20s",($para eq "undefined"?"-":$para));
push @paramList,sprintf("%-15s",($para eq "undefined"?"-":$para));
$found = 1 if ($para ne "undefined") ;
}
return $found,sprintf("%-20s\t: %s",$eName,join "\t|",@paramList);
@ -264,26 +264,45 @@ sub HMinfo_SetFn($@) {#########################################################
;
}
elsif($cmd eq "protoEvents"){##print protocol-events-------------------------
my ($type) = @a;
my @paramList;
my @IOlist;
foreach my $dName (HMinfo_getEntities($opt."dv",$filter)){
my $id = $defs{$dName}{DEF};
my ($found,$para) = HMinfo_getParam($id
my ($found,$para) = HMinfo_getParam($id,
,"protState","protCmdPend"
,"protSnd","protLastRcv","protResnd"
,"protResndFail","protNack","protIOerr");
$para =~ s/( last_at|20..-|\|)//g;
my @pl = split "\t",$para;
$_ =~ s/\s+$|//g foreach (@pl);
push @paramList, sprintf("%-20s%-22s|%-18s|%-18s|%-14s|%-18s|%-18s|%-18s|%-18s",
foreach (@pl){
$_ =~ s/\s+$|//g ;
$_ =~ s/CMDs_//;
$_ =~ s/..-.. ..:..:..//g if ($type eq "short");
$_ =~ s/CMDs // if ($type eq "short");
}
if ($type eq "short"){
push @paramList, sprintf("%-20s%-17s|%-9s|%-9s|%-9s|%-9s|%-9s|%-9s",
$pl[0],$pl[1],$pl[2],$pl[3],$pl[5],$pl[6],$pl[7],$pl[8]);
}
else{
push @paramList, sprintf("%-20s%-17s|%-18s|%-18s|%-14s|%-18s|%-18s|%-18s|%-18s",
$pl[0],$pl[1],$pl[2],$pl[3],$pl[4],$pl[5],$pl[6],$pl[7],$pl[8]);
}
push @IOlist,$defs{$pl[0]}{IODev}->{NAME};
}
my $hdr = sprintf("%-20s:%-21s|%-18s|%-18s|%-14s|%-18s|%-18s|%-18s|%-18s",
my $hdr = sprintf("%-20s:%-16s|%-18s|%-18s|%-14s|%-18s|%-18s|%-18s|%-18s",
,"name"
,"protState","protCmdPend"
,"protSnd","protLastRcv","protResnd"
,"protResndFail","protNack","protIOerr");
,"State","CmdPend"
,"Snd","LastRcv","Resnd"
,"ResndFail","Nack","IOerr");
$hdr = sprintf("%-20s:%-16s|%-9s|%-9s|%-9s|%-9s|%-9s|%-9s",
,"name"
,"State","CmdPend"
,"Snd","Resnd"
,"ResndFail","Nack","IOerr") if ($type eq "short");
$ret = $cmd." done:" ."\n ".$hdr ."\n ".(join "\n ",sort @paramList)
;
$ret .= "\n\n CUL_HM queue:$modules{CUL_HM}{prot}{rspPend}";
@ -495,7 +514,7 @@ sub HMinfo_SetFn($@) {#########################################################
."\n register [<typeFilter>] # devicefilter parse devicename. Partial strings supported"
."\n peerXref [<typeFilter>] # peer cross-reference"
."\n models [<typeFilter>] # list of models incl native parameter"
."\n protoEvents [<typeFilter>] # protocol status - names can be filtered"
."\n protoEvents [<typeFilter>] [short|long] # protocol status - names can be filtered"
."\n param [<typeFilter>] [<param1>] [<param2>] ... # displays params for all entities as table"
."\n rssi [<typeFilter>] # displays receive level of the HM devices"
."\n last: most recent"
@ -569,7 +588,8 @@ sub HMinfo_SetFnDly($) {#######################################################
;
}
else{
return "autoReadReg clear configCheck param peerCheck peerXref "
return "autoReadReg clear "
."configCheck param peerCheck peerXref "
."protoEvents models regCheck register rssi saveConfig update "
."cpRegs templateChk templateDef templateList templateSet";
}

View File

@ -203,7 +203,7 @@ my %culHmModel=(
"00A5" => {name=>"HM-RC-Sec4-2" ,st=>'remote' ,cyc=>'' ,rxt=>'c:l' ,lst=>'1,4' ,chn=>"Btn:1:2,BTN_T:3:1,BTN_A:4:1",},#only 1 and 2 canbe peered???
"00A6" => {name=>"HM-RC-Key4-2" ,st=>'remote' ,cyc=>'' ,rxt=>'c:l' ,lst=>'1,4' ,chn=>"Btn:1:2,BTN_T:3:1,BTN_A:4:1",},#only 1 and 2 canbe peered???
"00A7" => {name=>"HM-Sen-RD-O" ,st=>'sensRain' ,cyc=>'' ,rxt=>'' ,lst=>'1:1,4:1p' ,chn=>"Rain:1:1,Heating:2:2",},#stc:70 THSensor
"00A8" => {name=>"HM-WDS30-OT2-SM" ,st=>'THSensor' ,cyc=>'00:10' ,rxt=>'c:w:f' ,lst=>'p' ,chn=>"Th:1:4,Weather:5:5",},
"00A8" => {name=>"HM-WDS30-OT2-SM" ,st=>'THSensor' ,cyc=>'00:10' ,rxt=>'c:w:f' ,lst=>'p' ,chn=>"T1:1:1,T2:2:2,T1-T2:3:3,T2-T1:4:4,Event:5:5",},
"00A9" => {name=>"HM-PB-6-WM55" ,st=>'remote' ,cyc=>'' ,rxt=>'c' ,lst=>'1,4' ,chn=>"Btn:1:6",},
"00AB" => {name=>"HM-LC-SW4-BA-PCB" ,st=>'switch' ,cyc=>'' ,rxt=>'b' ,lst=>'1,3' ,chn=>"Sw:1:4",},
"00AF" => {name=>"HM-OU-CM-PCB" ,st=>'outputUnit' ,cyc=>'' ,rxt=>'' ,lst=>'3' ,chn=>"",},