2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

HMLAN IDcount, CFM register, minor fixes

git-svn-id: https://svn.fhem.de/fhem/trunk@2360 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2012-12-24 14:09:12 +00:00
parent fa04527f1f
commit 8799dcca39
2 changed files with 68 additions and 64 deletions

View File

@ -213,18 +213,19 @@ HMLAN_Write($$$)
Log $ll5, "HMLAN: Skip ACK" if (!$debug);
return;
}
# my $IDact = '+'.$dst; # guess: ID recover? Different to IDadd?
# my $IDack = '+'.$dst.',02,00,'; # guess: ID acknowledge
# my $IDHM = '+'.$dst.',01,00,F1EF'; #used by HMconfig - meanning??
# my $IDadd = '+'.$dst; # guess: add ID?
# my $IDack = '+'.$dst.',02,00,'; # guess: ID acknowledge
# my $IDack = '+'.$dst.',FF,00,'; # guess: ID acknowledge General
# my $IDsub = '-'.$dst; # guess: ID remove?
my $IDadd = '+'.$dst.',00,00,'; # guess: add ID?
# my $IDadd = '+'.$dst.',00,00,'; # guess: add ID?
my $IDadd = '+'.$dst; # guess: add ID?
my $IDsub = '-'.$dst; # guess: ID remove?
if (!$lhash{$dst} && $dst ne "000000"){
HMLAN_SimpleWrite($hash, $IDadd);
$lhash{$dst} = 1;
$hash->{assignIDs}=join(',',keys %lhash);
$hash->{assignIDsCnt}=scalar(keys %lhash)-1;
}
my $tm = int(gettimeofday()*1000) % 0xffffffff;
@ -335,6 +336,7 @@ HMLAN_Parse($$)
$hash->{firmware} = sprintf("%d.%d", (hex($mFld[1])>>12)&0xf, hex($mFld[1]) & 0xffff);
$hash->{owner} = $mFld[4];
$hash->{uptime} = HMLAN_uptime($mFld[5]);
$hash->{assignIDsReport}=$mFld[6];
$hash->{helper}{keepAliveRec} = 1;
Log $ll5, 'HMLAN_Parse: '.$name. ' V:'.$mFld[1]
.' sNo:'.$mFld[2].' d:'.$mFld[3]

View File

@ -434,9 +434,6 @@ CUL_HM_Parse($$)
push @event, CUL_HM_Pair($name, $shash,$cmd,$src,$dst,$p);
}
}
# elsif(($cmd =~ m/^A0[01]{2}$/ && $dst eq $id) && $st ne "keyMatic") {#### Pairing-Request-Convers.
# push @event, ""; #todo why end here?
# } General check operation after removal
elsif($model eq "KS550" || $model eq "HM-WDS100-C6-O") { ############
if($msgType eq "70" && $p =~ m/^(....)(..)(....)(....)(..)(..)(..)/) {
@ -861,15 +858,15 @@ CUL_HM_Parse($$)
}
elsif ($msgType eq "41"){ #Alarm detected
my ($No,$state) = (substr($p,2,2),substr($p,4,2));
my $stStr = ($state eq "01")?"all-clear":"on";
if($dhash){ # the source is in dst
if (!$dhash->{helper}{alarmNo} || $dhash->{helper}{alarmNo} ne $No){
$dhash->{helper}{alarmNo} = $No;
readingsSingleUpdate($dhash,'state',
(($state eq "01")?"all-clear":"on"),1);
readingsSingleUpdate($dhash,'state',$stStr,1);
}
}
push @event,"state:".(($state eq "01")?"all-clear":"on").":from:".$dname;
push @event,"smoke_detect:on $dname";
push @event,"state:".$stStr.":from:".$dname;
push @event,"smoke_detect:$stStr $dname";
}
elsif ($msgType eq "01"){ #Configs
my $sType = substr($p,0,2);
@ -1049,6 +1046,7 @@ CUL_HM_Parse($$)
"ValveAdjCmd:".$d1);
CUL_HM_SndCmd($chnHash,$msgcnt."8002".$dst.$src.'0101'.
sprintf("%02X",$vp*2)."0000");#$vp, $err,$??
$sendAck = "";
}
elsif($msgType eq "02"){
if ($dhash->{helper}{respWait}{msgId} &&
@ -1137,7 +1135,7 @@ my %culHmRegDefShLg = (# register that are available for short AND long button p
#output Unit
ActType =>{a=> 36 ,s=>1 ,l=>3,min=>0 ,max=>255 ,c=>'' ,f=>'' ,u=>'' ,d=>0,t=>"Action type(LED or Tone)"},
ActNum =>{a=> 37 ,s=>1 ,l=>3,min=>1 ,max=>255 ,c=>'' ,f=>'' ,u=>'' ,d=>0,t=>"Action Number"},
Intense =>{a=>47 ,s=>1 ,l=>3,min=>10 ,max=>255 ,c=>'' ,f=>'' ,u=>'' ,d=>0,t=>"Volume - Tone channel only!"},
Intense =>{a=> 43 ,s=>1 ,l=>3,min=>10 ,max=>255 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"Volume",lit=>{vol_0=>255,vol_1=>250,vol_2=>246,vol_3=>240,vol_4=>234,vol_5=>227,vol_6=>218,vol_7=>207,vol_8=>190,vol_9=>162,vol_00=>10}},
# statemachines
BlJtOn =>{a=> 11.0,s=>0.4,l=>3,min=>0 ,max=>9 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"Jump from On" ,lit=>{no=>0,onDly=>1,refOn=>2,on=>3,dlyOff=>4,refOff=>5,off=>6,rampOn=>8,rampOff=>9}},
BlJtOff =>{a=> 11.4,s=>0.4,l=>3,min=>0 ,max=>9 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"Jump from Off" ,lit=>{no=>0,onDly=>1,refOn=>2,on=>3,dlyOff=>4,refOff=>5,off=>6,rampOn=>8,rampOff=>9}},
@ -1245,6 +1243,8 @@ my %culHmRegDefine = (
# weather units
stormUpThresh =>{a=> 6 ,s=>1 ,l=>1,min=>0 ,max=>255 ,c=>'' ,f=>'' ,u=>'' ,d=>1,t=>"Storm upper threshold"},
stormLowThresh =>{a=> 7 ,s=>1 ,l=>1,min=>0 ,max=>255 ,c=>'' ,f=>'' ,u=>'' ,d=>1,t=>"Storm lower threshold"},
# others
localResetDis =>{a=> 7 ,s=>1 ,l=>1,min=>0 ,max=>255 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"LocalReset disable",lit=>{off=>0,on=>1}},
);
my %culHmRegGeneral = (
@ -1274,12 +1274,7 @@ my %culHmRegType = (
},
switch=> {OnTime =>1,OffTime =>1,OnDly =>1,OffDly =>1,
SwJtOn =>1,SwJtOff =>1,SwJtDlyOn =>1,SwJtDlyOff =>1,
CtOn =>1,CtDlyOn =>1,
CtOff =>1,CtDlyOff =>1,
},
outputUnit=>{
OnDly =>1,OnTime =>1,OffDly =>1,OffTime =>1,
ActType =>1,ActNum =>1,Intense =>1,
CtOn =>1,CtDlyOn =>1,CtOff =>1,CtDlyOff =>1,
},
winMatic=>{
OnTime =>1,OffTime =>1,OffLevelKm =>1,
@ -1309,6 +1304,12 @@ my %culHmRegModel = (
"HM-PB-4DIS-WM" => {language =>1,stbyTime =>1},
"HM-WDS100-C6-O"=> {stormUpThresh =>1,stormLowThresh =>1},
"KS550" => {stormUpThresh =>1,stormLowThresh =>1},
"HM-OU-CFM-PL" => {localResetDis =>1,
OnTime =>1,OffTime =>1, OnDly =>1,OffDly =>1,
SwJtOn =>1,SwJtOff =>1,SwJtDlyOn =>1,SwJtDlyOff =>1,
CtOn =>1,CtDlyOn =>1,CtOff =>1,CtDlyOff =>1,
OnTimeMode =>1,OffTimeMode =>1,
ActType =>1,ActNum =>1},
);
my %culHmRegChan = (# if channelspecific then enter them here
"HM-CC-TC02"=> {
@ -1328,6 +1329,7 @@ my %culHmRegChan = (# if channelspecific then enter them here
"HM-RC-19-SW12"=> {msgShowTime =>1, beepAtAlarm =>1, beepAtService =>1,beepAtInfo =>1,
backlAtAlarm =>1, backlAtService =>1, backlAtInfo =>1,
lcdSymb =>1, lcdLvlInterp =>1},
"HM-OU-CFM-PL02"=>{Intense=>1}
);
##--------------- Conversion routines for register settings
@ -2420,7 +2422,7 @@ CUL_HM_Set($@)
$set = ($set eq "unset")?0:1;
my ($b1,$b2,$nrCh2Pair);
$b1 = ($isChannel) ? hex($chn):(!$bNo?"01":sprintf("%02X",$bNo));
$b1 = ($isChannel) ? hex($chn):(!$bNo?"01":$bNo);
$b1 = $b1*2 - 1 if(!$single && !$isChannel);
if ($single){
$b2 = $b1;