2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 07:56:03 +00:00

provide vccu

git-svn-id: https://svn.fhem.de/fhem/trunk@5912 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2014-05-20 12:59:50 +00:00
parent afaefe8d37
commit be5f6232d3
4 changed files with 204 additions and 83 deletions

View File

@ -556,7 +556,7 @@ sub HMLAN_Parse($$) {##########################################################
my $HMcnd =$stat >>8; #high = HMLAN cond my $HMcnd =$stat >>8; #high = HMLAN cond
$stat &= 0xff; # low byte related to message format $stat &= 0xff; # low byte related to message format
if ($HMcnd == 0x01){#HMLAN responded to AES request if ($HMcnd == 0x01 && $mFld[3] ne "FF"){#HMLAN responded to AES request
$CULinfo = "AESKey-".$mFld[3]; $CULinfo = "AESKey-".$mFld[3];
} }

View File

@ -134,7 +134,7 @@ sub CUL_HM_Initialize($) {
$hash->{RenameFn} = "CUL_HM_Rename"; $hash->{RenameFn} = "CUL_HM_Rename";
$hash->{AttrFn} = "CUL_HM_Attr"; $hash->{AttrFn} = "CUL_HM_Attr";
$hash->{AttrList} = "do_not_notify:1,0 ignore:1,0 dummy:1,0 " $hash->{AttrList} = "do_not_notify:1,0 ignore:1,0 dummy:1,0 "
."IODev IOList " #IOList is for CCU only ."IODev IOList IOgrp " #IOList is for CCU only
."showtime:1,0 " ."showtime:1,0 "
."serialNr firmware .stc .devInfo " ."serialNr firmware .stc .devInfo "
."rawToReadable unit "#"KFM-Sensor" only ."rawToReadable unit "#"KFM-Sensor" only
@ -434,13 +434,14 @@ sub CUL_HM_Define($$) {##############################
} }
} }
else{# define a device else{# define a device
$hash->{helper}{role}{dev}=1; $hash->{helper}{role}{dev} = 1;
$hash->{helper}{role}{chn}=1;# take role of chn 01 until it is defined $hash->{helper}{role}{chn} = 1;# take role of chn 01 until it is defined
$hash->{helper}{q}{qReqConf}=""; # queue autoConfig requests for this device $hash->{helper}{q}{qReqConf} = ""; # queue autoConfig requests
$hash->{helper}{q}{qReqStat}=""; # queue autoConfig requests for this device $hash->{helper}{q}{qReqStat} = ""; # queue statusRequest for this device
$hash->{helper}{mRssi}{mNo} = "";
CUL_HM_prtInit ($hash); CUL_HM_prtInit ($hash);
CUL_HM_hmInitMsg($hash); CUL_HM_hmInitMsg($hash);
AssignIoPort($hash) if (!$init_done && $HMid ne "000000"); CUL_HM_assignIO($hash)if (!$init_done && $HMid ne "000000");
} }
$modules{CUL_HM}{defptr}{$HMid} = $hash; $modules{CUL_HM}{defptr}{$HMid} = $hash;
@ -1982,7 +1983,7 @@ sub CUL_HM_parseCommon(@){#####################################################
# parsing commands that are device independent # parsing commands that are device independent
my ($ioHash,$mNo,$mFlg,$mTp,$src,$dst,$p,$st,$md) = @_; my ($ioHash,$mNo,$mFlg,$mTp,$src,$dst,$p,$st,$md) = @_;
my $shash = $modules{CUL_HM}{defptr}{$src}; my $shash = $modules{CUL_HM}{defptr}{$src};
my $dhash = $modules{CUL_HM}{defptr}{$dst}; my $dhash = $modules{CUL_HM}{defptr}{$dst} if (defined $modules{CUL_HM}{defptr}{$dst});
return "" if(!$shash->{DEF});# this should be from ourself return "" if(!$shash->{DEF});# this should be from ourself
my $ret = ""; my $ret = "";
my $pendType = $shash->{helper}{prt}{rspWait}{Pending}? my $pendType = $shash->{helper}{prt}{rspWait}{Pending}?
@ -2020,9 +2021,7 @@ sub CUL_HM_parseCommon(@){#####################################################
} }
my $repeat; my $repeat;
if ($mTp eq "02"){# Ack/Nack ########################### if ($mTp eq "02"){# Ack/Nack/aesReq ####################
#see if the channel is defined separate - otherwise go for chief
my $subType = substr($p,0,2); my $subType = substr($p,0,2);
my $reply; my $reply;
my $success; my $success;
@ -2086,6 +2085,9 @@ sub CUL_HM_parseCommon(@){#####################################################
} }
} }
elsif($subType eq "04"){ #ACK-AES, interim######## elsif($subType eq "04"){ #ACK-AES, interim########
my (undef,$key,$aesKeyNbr) = unpack'A2A12A2',$p;
push @evtEt,[$shash,1,"aesKeyNbr:".$aesKeyNbr] if (defined $aesKeyNbr);# if ($msgStat =~ m/AESKey/)
#push @evtEt,[$shash,1,"aesCommToDev:".substr($msgStat,7)];#elsif($msgStat =~ m/AESCom/){# AES communication to central
#$success = ""; #result not final, another response should come #$success = ""; #result not final, another response should come
$reply = "done"; $reply = "done";
} }
@ -2118,6 +2120,14 @@ sub CUL_HM_parseCommon(@){#####################################################
} }
$ret = $reply; $ret = $reply;
} }
elsif($mTp eq "03"){# AESack #############################
#Reply to AESreq - only visible with CUL or in monitoring mode
#not with HMLAN/USB
#my $aesKey = $p;
push @evtEt,[$shash,1,"aesReqTo:".$dhash->{NAME}] if (defined $dhash);
$ret = "done";
}
elsif($mTp eq "00"){###################################### elsif($mTp eq "00"){######################################
my $paired = 0; #internal flag my $paired = 0; #internal flag
CUL_HM_infoUpdtDevData($shash->{NAME}, $shash,$p) CUL_HM_infoUpdtDevData($shash->{NAME}, $shash,$p)
@ -2142,8 +2152,10 @@ sub CUL_HM_parseCommon(@){#####################################################
delete $shash->{READINGS}{"RegL_00:"}; delete $shash->{READINGS}{"RegL_00:"};
delete $shash->{READINGS}{".RegL_00:"}; delete $shash->{READINGS}{".RegL_00:"};
AssignIoPort($shash,$ioHash->{NAME}) if (!$modules{CUL_HM}{helper}{hmManualOper}){
if (!$modules{CUL_HM}{helper}{hmManualOper}); $attr{$shash->{NAME}}{IODev} = $ioHash;
CUL_HM_assignIO($shash) ;
}
my ($idstr, $s) = ($ioId, 0xA); my ($idstr, $s) = ($ioId, 0xA);
$idstr =~ s/(..)/sprintf("%02X%s",$s++,$1)/ge; $idstr =~ s/(..)/sprintf("%02X%s",$s++,$1)/ge;
@ -2484,6 +2496,7 @@ sub CUL_HM_updtSDTeam(@){#in: TeamName, optional caller name and its new state
return CUL_HM_UpdtReadSingle($defs{$name},"state",$dStat,1); return CUL_HM_UpdtReadSingle($defs{$name},"state",$dStat,1);
} }
sub CUL_HM_pushEvnts(){######################################################## sub CUL_HM_pushEvnts(){########################################################
#write events to Readings and collect touched devices
my @ent = (); my @ent = ();
@evtEt = sort {($a->[0] cmp $b->[0])|| ($a->[1] cmp $b->[1])} @evtEt; @evtEt = sort {($a->[0] cmp $b->[0])|| ($a->[1] cmp $b->[1])} @evtEt;
$evtDly = 0;# switch delay trigger off $evtDly = 0;# switch delay trigger off
@ -2563,7 +2576,7 @@ sub CUL_HM_Get($@) {#+++++++++++++++++ get command+++++++++++++++++++++++++++++
return $attr{$devName}{$p} if ($attr{$devName}{$p}); return $attr{$devName}{$p} if ($attr{$devName}{$p});
return "undefined"; return "undefined";
} }
elsif($cmd =~ m /^(reg|regVal)$/) { ##################################################### elsif($cmd =~ m /^(reg|regVal)$/) { ########################################
my (undef,undef,$regReq,$list,$peerId) = @a; my (undef,undef,$regReq,$list,$peerId) = @a;
if ($regReq eq 'all'){ if ($regReq eq 'all'){
my @regArr = CUL_HM_getRegN($st,$md,$chn); my @regArr = CUL_HM_getRegN($st,$md,$chn);
@ -2702,6 +2715,19 @@ sub CUL_HM_Get($@) {#+++++++++++++++++ get command+++++++++++++++++++++++++++++
print aSave "\n======= finished ===\n"; print aSave "\n======= finished ===\n";
close(aSave); close(aSave);
} }
elsif($cmd eq "listDevice"){ ###############################################
my @dl = grep !/^$/,
map{AttrVal($_,"IOgrp","") =~ m/^$name/ ? $_ : ""}
keys %defs;
my @rl;
foreach (@dl){
my(undef,$pref) = split":",$attr{$_}{IOgrp},2;
$pref = "---" if (!$pref);
push @rl, "$defs{$_}{IODev}->{NAME} / $pref $_ ";
}
return "devices using $name\ncurrent IO / preferred\n ".join "\n ", sort @rl;
}
Log3 $name,3,"CUL_HM get $name " . join(" ", @a[1..$#a]); Log3 $name,3,"CUL_HM get $name " . join(" ", @a[1..$#a]);
@ -2798,8 +2824,8 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
return "$cmd requires parameter: $h"; return "$cmd requires parameter: $h";
} }
AssignIoPort($defs{$devName}) CUL_HM_assignIO($defs{$devName}) ;
if (!$defs{$devName}{IODev}||!$defs{$devName}{IODev}{NAME});
my $id = CUL_HM_IoId($defs{$devName}); my $id = CUL_HM_IoId($defs{$devName});
return "no IO device identified" if(length($id) != 6 ); return "no IO device identified" if(length($id) != 6 );
@ -4646,14 +4672,13 @@ sub CUL_HM_SndCmd($$) {
$hash = CUL_HM_getDeviceHash($hash); $hash = CUL_HM_getDeviceHash($hash);
return if( AttrVal($hash->{NAME},"ignore","") return if( AttrVal($hash->{NAME},"ignore","")
|| AttrVal($hash->{NAME},"dummy","")); || AttrVal($hash->{NAME},"dummy",""));
if(!defined $hash->{IODev} ||!defined $hash->{IODev}{NAME}){ CUL_HM_assignIO($hash) ;
AssignIoPort($hash);
if(!defined $hash->{IODev} ||!defined $hash->{IODev}{NAME}){ if(!defined $hash->{IODev} ||!defined $hash->{IODev}{NAME}){
CUL_HM_eventP($hash,"IOerr"); CUL_HM_eventP($hash,"IOerr");
CUL_HM_UpdtReadSingle($hash,"state","ERR_IOdev_undefined",1); CUL_HM_UpdtReadSingle($hash,"state","ERR_IOdev_undefined",1);
return; return;
} }
};
my $io = $hash->{IODev}; my $io = $hash->{IODev};
my $ioName = $io->{NAME}; my $ioName = $io->{NAME};
@ -4865,12 +4890,18 @@ sub CUL_HM_FWupdateSteps($){#steps for FW update
my $mIn = shift; my $mIn = shift;
my $step = $modules{CUL_HM}{helper}{updateStep}; my $step = $modules{CUL_HM}{helper}{updateStep};
my $name = $modules{CUL_HM}{helper}{updatingName}; my $name = $modules{CUL_HM}{helper}{updatingName};
my $hash = $defs{$name};
my $dst = $modules{CUL_HM}{helper}{updateDst}; my $dst = $modules{CUL_HM}{helper}{updateDst};
my $id = $modules{CUL_HM}{helper}{updateId}; my $id = $modules{CUL_HM}{helper}{updateId};
my $mNo = $modules{CUL_HM}{helper}{updateNbr}; my $mNo = $modules{CUL_HM}{helper}{updateNbr};
my $hash = $defs{$name};
my $mNoA = sprintf("%02X",$mNo); my $mNoA = sprintf("%02X",$mNo);
return if ($mIn !~ m/$mNoA..02$dst${id}00/&&$mIn !~ m/0010${dst}00000000/);
return if ($mIn !~ m/$mNoA..02$dst${id}00/ && $mIn !~ m/0010${dst}00000000/);
if ($mIn =~ m/$mNoA..02$dst${id}00/){
$modules{CUL_HM}{helper}{updateRetry} = 0;
$modules{CUL_HM}{helper}{updateNbrPassed} = $mNo;
}
if ($step == 0){#check bootloader entered - now change speed if ($step == 0){#check bootloader entered - now change speed
return if ($mIn =~ m/$mNoA..02$dst${id}00/); return if ($mIn =~ m/$mNoA..02$dst${id}00/);
Log3 $name,2,"CUL_HM fwUpdate $name entered mode - switch speed"; Log3 $name,2,"CUL_HM fwUpdate $name entered mode - switch speed";
@ -4920,10 +4951,22 @@ sub CUL_HM_FWupdateSteps($){#steps for FW update
$modules{CUL_HM}{helper}{updateStep}++; $modules{CUL_HM}{helper}{updateStep}++;
$modules{CUL_HM}{helper}{updateNbr} = $mNo; $modules{CUL_HM}{helper}{updateNbr} = $mNo;
#InternalTimer(gettimeofday()+0.3,"CUL_HM_FWupdateSim","${dst}${id}00",0); #InternalTimer(gettimeofday()+0.3,"CUL_HM_FWupdateSim","${dst}${id}00",0);
InternalTimer(gettimeofday()+5,"CUL_HM_FWupdateEnd","fail:Block$step",0); InternalTimer(gettimeofday()+5,"CUL_HM_FWupdateBTo","fail:Block$step",0);
} }
} }
} }
sub CUL_HM_FWupdateBTo($){# FW update block timeout
my $in = shift;
$modules{CUL_HM}{helper}{updateRetry}++;
if ($modules{CUL_HM}{helper}{updateRetry} > 3){#retry exceeded
CUL_HM_FWupdateEnd($in);
}
else{# have a retry
$modules{CUL_HM}{helper}{updateStep}--;
$modules{CUL_HM}{helper}{updateNbr} = $modules{CUL_HM}{helper}{updateNbrPassed};
CUL_HM_FWupdateSteps("0010".$modules{CUL_HM}{helper}{updateDst}."00000000");
}
}
sub CUL_HM_FWupdateEnd($){#end FW update sub CUL_HM_FWupdateEnd($){#end FW update
my $in = shift; my $in = shift;
CUL_HM_UpdtReadSingle($defs{$modules{CUL_HM}{helper}{updatingName}}, CUL_HM_UpdtReadSingle($defs{$modules{CUL_HM}{helper}{updatingName}},
@ -6182,34 +6225,20 @@ sub CUL_HM_storeRssi(@){
$peerName = $h->{NAME}; $peerName = $h->{NAME};
} }
$defs{$name}{helper}{mRssi}{mNo} = "" if (!$defs{$name}{helper}{mRssi}); my ($mVal,$mPn) = ($val,substr($peerName,3));
my ($mVal,$mPn,$hashMax) = ($val,substr($peerName,3),$defs{$name}{helper}{mRssi}); if ($defs{$name}{helper}{mRssi}{mNo} ne $mNo){# new message
if ($hashMax->{mNo} ne $mNo){# new message
delete $defs{$name}{helper}{mRssi}; delete $defs{$name}{helper}{mRssi};
$defs{$name}{helper}{mRssi}{mNo} = $mNo; $defs{$name}{helper}{mRssi}{mNo} = $mNo;
$hashMax = $defs{$name}{helper}{mRssi};
$hashMax->{max} = $mPn;
$mVal +=2 if(CUL_HM_name2IoName($name) eq $mPn);
$hashMax->{io}{$mPn} = $mVal;
} }
else{
if ($mPn =~ m /^rpt_(.*)/){# map repeater to io device, use max rssi if ($mPn =~ m /^rpt_(.*)/){# map repeater to io device, use max rssi
$mPn = $1; $mPn = $1;
$mVal = $hashMax->{io}{$mPn} $mVal = $defs{$name}{helper}{mRssi}{io}{$mPn}
if( $hashMax->{io}{$mPn} if( $defs{$name}{helper}{mRssi}{io}{$mPn}
&& $hashMax->{io}{$mPn} > $mVal && $defs{$name}{helper}{mRssi}{io}{$mPn} > $mVal);
);
} }
$mVal +=2 if(CUL_HM_name2IoName($name) eq $mPn); $mVal +=2 if(CUL_HM_name2IoName($name) eq $mPn);
$hashMax->{io}{$mPn} = $mVal; $defs{$name}{helper}{mRssi}{io}{$mPn} = $mVal;
my $max = -200;
foreach (keys %{$hashMax->{io}}){
if ($hashMax->{io}{$_}>$max){
$hashMax->{max} = $_;
$max = $hashMax->{io}{$_};
}
}
}
$defs{$name}{helper}{rssi}{$peerName}{lst} = $val; $defs{$name}{helper}{rssi}{$peerName}{lst} = $val;
my $rssiP = $defs{$name}{helper}{rssi}{$peerName}; my $rssiP = $defs{$name}{helper}{rssi}{$peerName};
@ -6308,6 +6337,51 @@ sub CUL_HM_UpdtCentralState($){
$state = "IOs_ok" if (!$state); $state = "IOs_ok" if (!$state);
$defs{$name}{STATE} = $state; $defs{$name}{STATE} = $state;
} }
sub CUL_HM_assignIO($){ #check and assign IO
# assign IO device
my $hash = shift;
if ( $hash->{helper}{prt}{sProc} == 1
&& defined $hash->{IODev} ){#don't change while send in process
return;
}
my $hn = $hash->{NAME};
my ($ioCCU,$prefIO) = split(":",AttrVal($hn,"IOgrp","_"),2);
$ioCCU = "" if (!defined $defs{$ioCCU} || AttrVal($ioCCU,"model","") ne "CCU-FHEM");
if ($ioCCU){
my $ccuIOs = AttrVal($ioCCU,"IOList","");
my @ios = sort {$hash->{helper}{mRssi}{io}{$b} <=> $hash->{helper}{mRssi}{io}{$a} }
keys(%{$hash->{helper}{mRssi}{io}});
unshift @ios,$prefIO if ($prefIO);# set prefIO to first choice
foreach my $iom (grep !/^$/,@ios){
if ($ccuIOs =~ m /$iom/){
if ( !$defs{$iom}
|| $defs{$iom}{STATE} !~ m/^(opened|Initialized)$/ # we need to queue
||(defined $defs{$iom}{XmitOpen} && $defs{$iom}{XmitOpen} == 0)){#overload, dont send
next;
}
Log 1,"General change $hn io to $iom" if($hash->{IODev} ne $defs{$iom});
if ( $hash->{IODev}
&& $hash->{IODev} ne $defs{$iom}
&& $hash->{IODev}->{TYPE}
&& $hash->{IODev}->{TYPE} eq "HMLAN"){#if recent io is HMLAN and we have to change remove the device from IO
my $id = CUL_HM_hash2Id($hash);
IOWrite($hash, "", "remove:$id");
}
$hash->{IODev} = $defs{$iom};
return;
}
}
}
# not assigned thru CCU - try normal
my $dIo = AttrVal($hn,"IODev","");
if ($dIo && $defs{$dIo} && $dIo ne $hash->{IODev}->{NAME}){
$hash->{IODev} = $defs{$dIo};
}
else{
AssignIoPort($hash);#let kernal decide
}
}
sub CUL_HM_stateUpdatDly($$){#delayed queue of status-request sub CUL_HM_stateUpdatDly($$){#delayed queue of status-request
my ($name,$time) = @_; my ($name,$time) = @_;
@ -6389,14 +6463,11 @@ sub CUL_HM_procQs($){#process non-wakeup queues
foreach my $q ("qReqStat","qReqConf"){ foreach my $q ("qReqStat","qReqConf"){
if (@{$mq->{$q}}){ if (@{$mq->{$q}}){
my $devN = ${$mq->{$q}}[0]; my $devN = ${$mq->{$q}}[0];
my $ioName = $defs{$devN}{IODev}{NAME}; CUL_HM_assignIO($defs{$devN});
if(!defined $ioName){
AssignIoPort($defs{$devN});
next if(!defined $defs{$devN}{IODev}{NAME}); next if(!defined $defs{$devN}{IODev}{NAME});
$ioName = $defs{$devN}{IODev}{NAME}; my $ioName = $defs{$devN}{IODev}{NAME};
};
if ( ( $ioName if ( ( ReadingsVal($ioName,"cond","") =~ m /^(ok|Overload-released|init)$/
&& ReadingsVal($ioName,"cond","") =~ m /^(ok|Overload-released|init)$/
&& $q eq "qReqStat") && $q eq "qReqStat")
||( CUL_HM_autoReadReady($ioName) ||( CUL_HM_autoReadReady($ioName)
&& !$defs{$devN}{cmdStack} && !$defs{$devN}{cmdStack}
@ -7617,6 +7688,9 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
prior to rewrite data to an entity it is necessary to pair the device with FHEM.<br> prior to rewrite data to an entity it is necessary to pair the device with FHEM.<br>
restore will not delete any peered channels, it will just add peer channels.<br> restore will not delete any peered channels, it will just add peer channels.<br>
</li> </li>
<li><B>listDevice</B><br>
returns a list of Devices using the ccu service to assign an IO.<br>
</li>
<br> <br>
</ul> </ul>
@ -7692,6 +7766,19 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
extert takes benefit of the implementation. extert takes benefit of the implementation.
Nevertheless - by definition - showInternalValues overrules expert. Nevertheless - by definition - showInternalValues overrules expert.
</li> </li>
<li><a name="#CUL_HMIOgrp">IOgrp</a><br>
can be given to devices and shall point to a virtual CCU. As a consequence the
CCU will take care of the assignment to the best suitable IO. It is necessary that a
virtual CCU is defined and all relevant IO devices are assigned to it. Upon sending the CCU will
check which IO is operational and has the best RSSI performance for this device.<br>
Optional a prefered IO can be added. In case this IO is operational it willge selected regardless
of rssi values. <br>
Example:<br>
<ul><code>
attr myDevice1 IOgrp vccu<br>
attr myDevice2 IOgrp vccu:prefIO<br>
</code></ul>
</li>
<li><a name="#CUL_HMlevelRange">levelRange</a><br> <li><a name="#CUL_HMlevelRange">levelRange</a><br>
can be used with dimmer only. It defines the dimmable range to be used with this dimmer-channel. can be used with dimmer only. It defines the dimmable range to be used with this dimmer-channel.
It is meant to support e.g. LED light that starts at 10% and reaches maxbrightness at 40%. It is meant to support e.g. LED light that starts at 10% and reaches maxbrightness at 40%.
@ -7712,10 +7799,6 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
attr myChannel levelRange 10,80<br> attr myChannel levelRange 10,80<br>
</code></ul> </code></ul>
</li> </li>
<li><a name="#CUL_HMtempListTmpl">tempListTmpl</a><br>
Sets the default template for a heating controller.<br>
Format is &lt;file&gt;:&lt;templatename&gt;. lt
</li>
<li><a name="#CUL_HMmodel">model</a>, <li><a name="#CUL_HMmodel">model</a>,
<a name="subType">subType</a><br> <a name="subType">subType</a><br>
These attributes are set automatically after a successful pairing. These attributes are set automatically after a successful pairing.
@ -7747,6 +7830,10 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
written to a reading. User may use this to log and generate a graph of RSSI level.<br> written to a reading. User may use this to log and generate a graph of RSSI level.<br>
Due to amount of readings and events it is NOT RECOMMENDED to switch it on by default. Due to amount of readings and events it is NOT RECOMMENDED to switch it on by default.
</li> </li>
<li><a name="#CUL_HMtempListTmpl">tempListTmpl</a><br>
Sets the default template for a heating controller.<br>
Format is &lt;file&gt;:&lt;templatename&gt;. lt
</li>
<li><a name="unit">unit</a><br> <li><a name="unit">unit</a><br>
set the reported unit by the KFM100 if rawToReadable is active. E.g.<br> set the reported unit by the KFM100 if rawToReadable is active. E.g.<br>
attr KFM100 unit Liter attr KFM100 unit Liter
@ -8813,6 +8900,10 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
vor dem zur&uuml;ckschreiben der Daten eines Eintrags muss das Ger&auml;t mit FHEM verbunden werden.<br> vor dem zur&uuml;ckschreiben der Daten eines Eintrags muss das Ger&auml;t mit FHEM verbunden werden.<br>
"restore" l&ouml;scht keine verkn&uuml;pften Kan&auml;le, es f&uuml;gt nur neue Peers hinzu.<br> "restore" l&ouml;scht keine verkn&uuml;pften Kan&auml;le, es f&uuml;gt nur neue Peers hinzu.<br>
</li> </li>
<li><B>listDevice</B><br>
gibt eine Lister der Devices, welche den ccu service zum zuweisen der IOs zurück<br>
</li>
</ul><br> </ul><br>
<a name="CUL_HMattr"></a><b>Attribute</b> <a name="CUL_HMattr"></a><b>Attribute</b>
<ul> <ul>
@ -8875,6 +8966,19 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
"expert" macht sich diese Implementierung zu Nutze. "expert" macht sich diese Implementierung zu Nutze.
Gleichwohl setzt "showInternalValues" - bei Definition - 'expert' außer Kraft . Gleichwohl setzt "showInternalValues" - bei Definition - 'expert' außer Kraft .
</li> </li>
<li><a name="#CUL_HMIOgrp">IOgrp</a><br>
kann an Devices vergeben werden udn zeigt auf eine virtuelle ccu. Danach wird die ccu
beim Senden das passende IO für das Device auswählen. Es ist notwendig, dass die virtuelle ccu
definiert und alle erlaubten IOs eingetragen sind. Beim Senden wird die ccu prüfen
welches IO operational ist und welches den besten rssi-faktor für das Device hat.<br>
Optional kann ein bevorzugtes IO definiert werden. In diesem Fall wird es, wenn operational,
genutzt - unabhängig von den rssi Werten.<br>
Beispiel:<br>
<ul><code>
attr myDevice1 IOgrp vccu<br>
attr myDevice2 IOgrp vccu:prefIO<br>
</code></ul>
</li>
<li><a name="#CUL_HMlevelRange">levelRange</a><br> <li><a name="#CUL_HMlevelRange">levelRange</a><br>
nur f&uuml;r Dimmer! Der Dimmbereich wird eingeschr&auml;nkt. nur f&uuml;r Dimmer! Der Dimmbereich wird eingeschr&auml;nkt.
Es ist gedacht um z.B. LED Lichter unterst&uuml;tzen welche mit 10% beginnen und bei 40% bereits das Maximum haben. Es ist gedacht um z.B. LED Lichter unterst&uuml;tzen welche mit 10% beginnen und bei 40% bereits das Maximum haben.

View File

@ -461,6 +461,8 @@ sub HMinfo_paramCheck(@) { ####################################################
my @noIoDev; my @noIoDev;
my @noID; my @noID;
my @idMismatch; my @idMismatch;
my @ccuUndef;
my @perfIoUndef;
my @aesInval; my @aesInval;
foreach my $eName (@entities){ foreach my $eName (@entities){
if ($defs{$eName}{helper}{role}{dev}){ if ($defs{$eName}{helper}{role}{dev}){
@ -468,9 +470,24 @@ sub HMinfo_paramCheck(@) { ####################################################
my $pairId = CUL_HM_Get($ehash,$eName,"param","R-pairCentral"); my $pairId = CUL_HM_Get($ehash,$eName,"param","R-pairCentral");
my $IoDev = $ehash->{IODev} if ($ehash->{IODev}); my $IoDev = $ehash->{IODev} if ($ehash->{IODev});
my $ioHmId = AttrVal($IoDev->{NAME},"hmId","-"); my $ioHmId = AttrVal($IoDev->{NAME},"hmId","-");
my ($ioCCU,$prefIO) = split":",AttrVal($eName,"IOgrp","");
if ($ioCCU){
if( !$defs{$ioCCU}
|| AttrVal($ioCCU,"model","") ne "CCU-FHEM"
|| !$defs{$ioCCU}{helper}{role}{dev}){
push @ccuUndef,"$eName ->$ioCCU";
}
else{
$ioHmId = $defs{$ioCCU}{DEF};
if ($prefIO && !$defs{$prefIO}){
push @perfIoUndef,"$eName ->$prefIO";
}
}
}
if (!$IoDev) { push @noIoDev,$eName;} if (!$IoDev) { push @noIoDev,$eName;}
elsif ($pairId eq "undefined"){ push @noID,$eName;} if ($pairId eq "undefined") { push @noID,$eName;}
elsif ($pairId !~ m /$ioHmId/){ push @idMismatch,"$eName paired:$pairId IO attr: $ioHmId";} elsif ($pairId !~ m /$ioHmId/
&& $IoDev ) { push @idMismatch,"$eName paired:$pairId IO attr: $ioHmId";}
elsif (AttrVal($eName,"aesCommReq",0) && $IoDev->{TYPE} ne "HMLAN") elsif (AttrVal($eName,"aesCommReq",0) && $IoDev->{TYPE} ne "HMLAN")
{ push @aesInval,"$eName ";} { push @aesInval,"$eName ";}
@ -480,9 +497,10 @@ sub HMinfo_paramCheck(@) { ####################################################
my $ret = ""; my $ret = "";
$ret .="\n\n no IO device assigned" ."\n ".(join "\n ",sort @noIoDev) if (@noIoDev); $ret .="\n\n no IO device assigned" ."\n ".(join "\n ",sort @noIoDev) if (@noIoDev);
$ret .="\n\n PairedTo missing/unknown" ."\n ".(join "\n ",sort @noID) if (@noID); $ret .="\n\n PairedTo missing/unknown" ."\n ".(join "\n ",sort @noID) if (@noID);
$ret .="\n\n PairedTo mismatch to IODev"."\n ".(join "\n ",sort @idMismatch) if (@idMismatch); $ret .="\n\n PairedTo mismatch to IODev" ."\n ".(join "\n ",sort @idMismatch) if (@idMismatch);
$ret .="\n\n aesCommReq set, IO not compatibel" $ret .="\n\n aesCommReq set, IO not compatibel" ."\n ".(join "\n ",sort @aesInval) if (@aesInval);
."\n ".(join "\n ",sort @aesInval) if (@aesInval); $ret .="\n\n IOgrp: CCU not found" ."\n ".(join "\n ",sort @ccuUndef) if (@ccuUndef);
$ret .="\n\n IOgrp: prefered IO undefined" ."\n ".(join "\n ",sort @perfIoUndef)if (@perfIoUndef);
return $ret; return $ret;
} }
@ -688,14 +706,13 @@ sub HMinfo_getEntities(@) { ###################################################
my $eHash = $modules{CUL_HM}{defptr}{$id}; my $eHash = $modules{CUL_HM}{defptr}{$id};
my $eName = $eHash->{NAME}; my $eName = $eHash->{NAME};
my $isChn = (length($id) != 6 || CUL_HM_Get($eHash,$eName,"param","channel_01") eq "undefined")?1:0; my $isChn = (length($id) != 6 || CUL_HM_Get($eHash,$eName,"param","channel_01") eq "undefined")?1:0;
my $eMd = CUL_HM_Get($eHash,$eName,"param","model");
my $eIg = CUL_HM_Get($eHash,$eName,"param","ignore"); my $eIg = CUL_HM_Get($eHash,$eName,"param","ignore");
$eIg = "" if ($eIg eq "undefined"); $eIg = "" if ($eIg eq "undefined");
next if (!(($doDev && length($id) == 6) || next if (!(($doDev && length($id) == 6) ||
($doChn && $isChn))); ($doChn && $isChn)));
next if (!$doIgn && $eIg); next if (!$doIgn && $eIg);
next if ( $noVrt && $eMd =~ m/^virtual/); next if ( $noVrt && $eHash->{helper}{role}{vrt});
next if ( $noPhy && $eMd !~ m/^virtual/); next if ( $noPhy && !$eHash->{helper}{role}{vrt});
my $eSt = CUL_HM_Get($eHash,$eName,"param","subType"); my $eSt = CUL_HM_Get($eHash,$eName,"param","subType");
next if ( $noSen && $eSt =~ m/^(THSensor|remote|pushButton|threeStateSensor|sensor|motionDetector|swi)$/); next if ( $noSen && $eSt =~ m/^(THSensor|remote|pushButton|threeStateSensor|sensor|motionDetector|swi)$/);
@ -898,7 +915,7 @@ sub HMinfo_GetFn($@) {#########################################################
my $tr = CUL_HM_tempListTmpl($e,"verify",AttrVal($e,"tempListTmpl","tempList.cfg:$e")); my $tr = CUL_HM_tempListTmpl($e,"verify",AttrVal($e,"tempListTmpl","tempList.cfg:$e"));
push @tlr,$tr if($tr); push @tlr,$tr if($tr);
} }
$ret .= "\templist mismatch \n ".join("\n ",@tlr) if (@tlr); $ret .= "\n\n templist mismatch \n ".join("\n ",@tlr) if (@tlr);
} }
elsif($cmd eq "templateChk"){##template: see if it applies ------------------ elsif($cmd eq "templateChk"){##template: see if it applies ------------------
my $repl; my $repl;

View File

@ -654,7 +654,7 @@ my $K_actDetID = '000000'; # id of actionDetector
"0.0K"=>7, "0.5K"=>8, "1.0K"=>9, "1.5K"=>10, "2.0K"=>11, "2.5K"=>12, "3.0K"=>13, "3.5K"=>14}}, "0.0K"=>7, "0.5K"=>8, "1.0K"=>9, "1.5K"=>10, "2.0K"=>11, "2.5K"=>12, "3.0K"=>13, "3.5K"=>14}},
btnNoBckLight =>{a=> 9.4,s=>0.1,l=>7,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"button response without backlight",lit=>{off=>0,on=>1}}, btnNoBckLight =>{a=> 9.4,s=>0.1,l=>7,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"button response without backlight",lit=>{off=>0,on=>1}},
showSetTemp =>{a=> 9.5,s=>0.1,l=>7,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"show set or actual temperature" ,lit=>{actTemp=>0,setTemp=>1}}, showSetTemp =>{a=> 9.5,s=>0.1,l=>7,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"show set or actual temperature" ,lit=>{actTemp=>0,setTemp=>1}},
showHumitidy =>{a=> 9.6,s=>0.1,l=>7,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"show temp only or also humidity" ,lit=>{temp=>0,tempHum=>1}}, showHumidity =>{a=> 9.6,s=>0.1,l=>7,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"show temp only or also humidity" ,lit=>{temp=>0,tempHum=>1}},
sendWeatherData =>{a=> 9.7,s=>0.1,l=>7,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"send weather data" ,lit=>{off=>0,on=>1}}, sendWeatherData =>{a=> 9.7,s=>0.1,l=>7,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"send weather data" ,lit=>{off=>0,on=>1}},
boostPos =>{a=> 10.0,s=>0.5,l=>7,min=>0 ,max=>100 ,c=>'' ,f=>'0.2' ,u=>'%' ,d=>1,t=>"valve boost position"}, boostPos =>{a=> 10.0,s=>0.5,l=>7,min=>0 ,max=>100 ,c=>'' ,f=>'0.2' ,u=>'%' ,d=>1,t=>"valve boost position"},
@ -1003,7 +1003,7 @@ $culHmRegModel{"ROTO_ZEL-STG-RM-FSA"} = $culHmRegModel{"HM-CC-VD"};
"HM-CC-RT-DN06" =>{ CtrlRc =>1,TempRC =>1}, "HM-CC-RT-DN06" =>{ CtrlRc =>1,TempRC =>1},
"HM-TC-IT-WM-W-EU02"=>{ dayTemp =>1,nightTemp =>1,tempMin =>1,tempMax =>1,tempOffset =>1 "HM-TC-IT-WM-W-EU02"=>{ dayTemp =>1,nightTemp =>1,tempMin =>1,tempMax =>1,tempOffset =>1
,hyst2point =>1,heatCool =>1,boostPeriod =>1,winOpnBoost =>1 ,hyst2point =>1,heatCool =>1,boostPeriod =>1,winOpnBoost =>1
,showWeekday =>1,showInfo =>1,showSetTemp =>1,showHumitidy =>1 ,showWeekday =>1,showInfo =>1,showSetTemp =>1,showHumidity =>1
,noMinMax4Manu =>1,daylightSaveTime=>1,sendWeatherData =>1 ,noMinMax4Manu =>1,daylightSaveTime=>1,sendWeatherData =>1
,modePrioParty =>1,modePrioManu =>1,weekPrgSel =>1 ,modePrioParty =>1,modePrioManu =>1,weekPrgSel =>1
}, },
@ -1245,7 +1245,7 @@ $culHmRegChan{"ROTO_ZEL-STG-RM-FWT03"}= $culHmRegChan{"HM-CC-TC03"};
none4Type =>{ "test"=>"" }, none4Type =>{ "test"=>"" },
); );
%culHmModelGets = ( %culHmModelGets = (
none4Mod =>{ "none"=>"" }, "CCU-FHEM" =>{ "listDevice"=>"" },
); );
##############################---set---######################################## ##############################---set---########################################
@ -1735,7 +1735,7 @@ $culHmChanSets{"ROTO_ZEL-STG-RM-FWT02"} = $culHmChanSets{"HM-CC-TC02"};
} }
} }
} }
foreach my $type (keys %culHmRegType){ #update references to register foreach my $type (keys %culHmRegType) { #update references to register
foreach my $reg (keys %{$culHmRegType{$type}}){ foreach my $reg (keys %{$culHmRegType{$type}}){
if ($culHmRegDefShLg{$reg}){ if ($culHmRegDefShLg{$reg}){
delete $culHmRegType{$type}{$reg}; delete $culHmRegType{$type}{$reg};
@ -1744,7 +1744,7 @@ $culHmChanSets{"ROTO_ZEL-STG-RM-FWT02"} = $culHmChanSets{"HM-CC-TC02"};
} }
} }
} }
foreach my $type(keys %culHmRegModel){ #update references to register foreach my $type (keys %culHmRegModel){ #update references to register
foreach my $reg (keys %{$culHmRegModel{$type}}){ foreach my $reg (keys %{$culHmRegModel{$type}}){
if ($culHmRegDefShLg{$reg}){ if ($culHmRegDefShLg{$reg}){
delete $culHmRegModel{$type}{$reg}; delete $culHmRegModel{$type}{$reg};
@ -1753,7 +1753,7 @@ $culHmChanSets{"ROTO_ZEL-STG-RM-FWT02"} = $culHmChanSets{"HM-CC-TC02"};
} }
} }
} }
foreach my $type (keys %culHmRegChan){ #update references to register foreach my $type (keys %culHmRegChan) { #update references to register
foreach my $reg (keys %{$culHmRegChan{$type}}){ foreach my $reg (keys %{$culHmRegChan{$type}}){
if ($culHmRegDefShLg{$reg}){ if ($culHmRegDefShLg{$reg}){
delete $culHmRegChan{$type}{$reg}; delete $culHmRegChan{$type}{$reg};