From 1a1d61a2cefb5ad9b79bf559ebbb9fedaadb4322 Mon Sep 17 00:00:00 2001 From: martinp876 Date: Mon, 29 Jul 2013 18:39:24 +0000 Subject: [PATCH] update templateSet git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@3535 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 6 +++--- fhem/FHEM/98_HMinfo.pm | 12 +++++++----- fhem/FHEM/HMConfig.pm | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index b995ab339..38e4cec51 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -1400,7 +1400,7 @@ sub CUL_HM_parseCommon(@){##################################################### # 9610 if( $shash->{cmdStack} && ((hex($mFlg) & 0xA2) == 0x82) && - (CUL_HM_getRxType($shash) & 0x08)){ #wakeup ##### + (CUL_HM_getRxType($shash) & 0x18)){ #wakeup or lazy Config #####General #send wakeup and process command stack CUL_HM_SndCmd($shash, '++A112'.CUL_HM_IOid($shash).$src); CUL_HM_ProcessCmdStack($shash); @@ -2448,8 +2448,7 @@ sub CUL_HM_Set($@) { } CUL_HM_PushCmdStack($hash,$msg) if ($msg); } - elsif($cmd eq "mode") { #################################################### - #"[auto|manu|party|boost|comfort|lower] ... "}#General only for one channel?? + elsif($cmd eq "mode") { ##################################################### return "select one of auto,manu,party,boost,comfort,lower" if ($a[2] !~ m/^(auto|manu|party|boost|comfort|lower)$/); my ($temp,$party); @@ -3267,6 +3266,7 @@ sub CUL_HM_getRxType($) { #in:hash(chn or dev) out:binary coded Rx type $rxtEntity |= ($rxtOfModel =~ m/b/)?0x02:0;#burst $rxtEntity |= ($rxtOfModel =~ m/c/)?0x04:0;#config $rxtEntity |= ($rxtOfModel =~ m/w/)?0x08:0;#wakeup + $rxtEntity |= ($rxtOfModel =~ m/l/)?0x10:0;#lazyConfig } $rxtEntity = 1 if (!$rxtEntity);#always $hash->{helper}{rxType} = $rxtEntity; diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index c3fae5033..9f340446c 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -365,6 +365,7 @@ sub HMinfo_SetFn($$) {######################################################### $mode =~ s/c/config/; $mode =~ s/w/wakeup/; $mode =~ s/b/burst/; + $mode =~ s/l/lazyConf/; $mode =~ s/:/,/; $mode = "normal" if (!$mode); my $list = $th{$_}{lst}; @@ -375,7 +376,7 @@ sub HMinfo_SetFn($$) {######################################################### my ($n,$s,$e) = split(":",$_); $chan .= $s.(($s eq $e)?"":("-".$e))." ".$n.", "; } - push @model,sprintf("%-16s %-24s %4s %-13s %-5s %-5s %s" + push @model,sprintf("%-16s %-24s %4s %-15s %-5s %-5s %s" ,$th{$_}{st} ,$th{$_}{name} ,$_ @@ -386,7 +387,7 @@ sub HMinfo_SetFn($$) {######################################################### ); } $ret = $cmd.($filter?" filtered":"").":$filter\n " - .sprintf("%-16s %-24s %4s %-13s %-5s %-5s %s\n " + .sprintf("%-16s %-24s %4s %-15s %-5s %-5s %s\n " ,"subType" ,"name" ,"ID" @@ -807,13 +808,13 @@ sub HMinfo_templateDef(@){##################################################### } sub HMinfo_templateSet(@){##################################################### my ($aName,$tmpl,$pSet,@p) = @_; - $pSet = "" if (!$pSet); + $pSet = ":" if (!$pSet || $pSet eq "none"); my ($pName,$pTyp) = split(":",$pSet); return "template undefined $tmpl" if(!$tpl{$tmpl}); return "aktor $aName unknown" if(!$defs{$aName}); return "exec set $aName getConfig first" if(!(grep /RegL_/,keys%{$defs{$aName}{READINGS}})); return "give :[short|long] with peer, not $pSet" if($pName && $pTyp !~ m/(short|long)/); - $pSet = $pTyp eq "long"?"lg":"sh"; + $pSet = $pTyp ? ($pTyp eq "long"?"lg":"sh"):""; my $aHash = $defs{$aName}; my @regCh; @@ -828,7 +829,8 @@ sub HMinfo_templateSet(@){##################################################### return "Device doesn't support $regN - template $tmpl not applicable" if ($ret =~ m/failed:/); return "peer necessary for template" if ($ret =~ m/peer required/ && !$pName); return "Device doesn't support literal $regV for reg $regN" if ($ret =~ m/literal:/ && $ret !~ m/\b$regV\b/); - my ($min,$max) = ($1,$2) if ($ret =~ m/range:(.*) to (._?) /); + my ($min,$max) = ($1,$2) if ($ret =~ m/range:(.*) to (.*) :/); + $max =~ s/([0-9\.]+).*/$1/; return "$regV out of range: $min to $max" if ($min && ($regV < $min || $regV > $max)); push @regCh,"$regN,$regV"; } diff --git a/fhem/FHEM/HMConfig.pm b/fhem/FHEM/HMConfig.pm index 5e5433329..91d9306e5 100644 --- a/fhem/FHEM/HMConfig.pm +++ b/fhem/FHEM/HMConfig.pm @@ -184,7 +184,7 @@ my %culHmModel=( "0092" => {name=>"Schueco_263-144" ,st=>'switch' ,cyc=>'' ,rxt=>'c' ,lst=>'4' ,chn=>"",}, # HM Switch Interface 3 switches "0093" => {name=>"Schueco_263-158" ,st=>'THSensor' ,cyc=>'00:10' ,rxt=>'c:w' ,lst=>'p' ,chn=>"",}, # "0094" => {name=>"IS-WDS-TH-OD-S-R3" ,st=>'THSensor' ,cyc=>'00:10' ,rxt=>'c:w' ,lst=>'p' ,chn=>"",}, # - "0095" => {name=>"HM-CC-RT-DN" ,st=>'thermostat' ,cyc=>'' ,rxt=>'c:w' ,lst=>'3:3p.6p,7:0.4',chn=>"Weather:1:1,Climate:2:2,WindowRec:3:3,ClimRT_tr:4:4,ClimRT_r:5:5,rCtrl:6:6"}, # + "0095" => {name=>"HM-CC-RT-DN" ,st=>'thermostat' ,cyc=>'' ,rxt=>'c:w' ,lst=>'3:3p.6p,7:0.3.4',chn=>"Weather:1:1,Climate:2:2,WindowRec:3:3,ClimRT_tr:4:4,ClimRT_r:5:5,rCtrl:6:6"}, # "0096" => {name=>"WDF-solar" ,st=>'blindActuatorSol' ,cyc=>'' ,rxt=>'b' ,lst=>'1,3' ,chn=>"win:1:1,blind_2:3",}, # "009B" => {name=>"Schueco_263-xxx" ,st=>'tipTronic' ,cyc=>'28:00' ,rxt=>'c:w' ,lst=>'1:1.2,3:1p.3p',chn=>"act:1:1,sen:2:2,sec:3:3",}, # "009F" => {name=>"HM-Sen-Wa-Od" ,st=>'sensor' ,cyc=>'28:00' ,rxt=>'c:w' ,lst=>'1,4' ,chn=>"",}, #capacitive filling level sensor @@ -383,7 +383,7 @@ my %culHmRegDefine = ( driveDown =>{a=> 11.0,s=>2.0,l=>1,min=>0 ,max=>6000.0 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"drive time up"}, driveUp =>{a=> 13.0,s=>2.0,l=>1,min=>0 ,max=>6000.0 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"drive time up"}, - driveTurn =>{a=> 15.0,s=>1.0,l=>1,min=>0 ,max=>6000.0 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"Engine uncharge time, typically 0.5s. Do NOT set to 0 if operated with engine"}, + driveTurn =>{a=> 15.0,s=>1.0,l=>1,min=>0 ,max=>25.5 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"Engine uncharge time, typically 0.5s. Do NOT set to 0 if operated with engine"}, refRunCounter =>{a=> 16.0,s=>1.0,l=>1,min=>0 ,max=>255 ,c=>'' ,f=>'' ,u=>'' ,d=>0,t=>"reference run counter"}, #remote mainly longPress =>{a=> 4.4,s=>0.4,l=>1,min=>0.3,max=>1.8 ,c=>'m10s3' ,f=>'' ,u=>'s' ,d=>0,t=>"time to detect key long press"},