CFM repeat set, SD eliminat forward

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@3087 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-04-19 18:52:25 +00:00
parent 68fd8b5789
commit 3e8512d6df
3 changed files with 171 additions and 176 deletions

View File

@ -124,7 +124,7 @@ sub CUL_HM_autoReadConfig($){
while(@{$modules{CUL_HM}{helper}{updtCfgLst}}){ while(@{$modules{CUL_HM}{helper}{updtCfgLst}}){
my $name = shift(@{$modules{CUL_HM}{helper}{updtCfgLst}}); my $name = shift(@{$modules{CUL_HM}{helper}{updtCfgLst}});
my $hash = CUL_HM_name2Hash($name); my $hash = CUL_HM_name2Hash($name);
if (0 != substr(CUL_HM_Get($hash,$name,"param","autoReadReg"),0,1)){ if (0 != CUL_HM_getARead($name)){
CUL_HM_Set($hash,$name,"getSerial"); CUL_HM_Set($hash,$name,"getSerial");
CUL_HM_Set($hash,$name,"getConfig"); CUL_HM_Set($hash,$name,"getConfig");
CUL_HM_Set($hash,$name,"statusRequest"); CUL_HM_Set($hash,$name,"statusRequest");
@ -166,8 +166,8 @@ sub CUL_HM_updateConfig($){
#delete $attr{$name}{peerIDs}; # remove historical data #delete $attr{$name}{peerIDs}; # remove historical data
} }
my $st = CUL_HM_Get($hash,$name,"param","subType"); my $st = CUL_HM_Get($hash,$name,"param","subType");
my $md = CUL_HM_Get($hash,$name,"param","model"); my $md = CUL_HM_Get($hash,$name,"param","model");
if ("HM-CC-TC" eq $md){ if ("HM-CC-TC" eq $md){
$hash->{helper}{role}{chn} = 1 if (length($id) == 6); #tc special $hash->{helper}{role}{chn} = 1 if (length($id) == 6); #tc special
} }
@ -234,7 +234,7 @@ sub CUL_HM_updateConfig($){
} }
} }
$attr{$name}{webCmd} = $webCmd if ($webCmd); $attr{$name}{webCmd} = $webCmd if ($webCmd);
push @getConfList,$name if (0 != substr(AttrVal($name,"autoReadReg","0"),0,1)); push @getConfList,$name if (0 != CUL_HM_getARead($name));
} }
$modules{CUL_HM}{helper}{updtCfgLst} = \@getConfList; $modules{CUL_HM}{helper}{updtCfgLst} = \@getConfList;
CUL_HM_autoReadConfig("updateConfig"); CUL_HM_autoReadConfig("updateConfig");
@ -952,9 +952,8 @@ sub CUL_HM_Parse($$) {##############################
my $bitLoc = ($msgChn-1)*2;#calculate bit location my $bitLoc = ($msgChn-1)*2;#calculate bit location
my $mask = 3<<$bitLoc; my $mask = 3<<$bitLoc;
my $value = sprintf("%08X",(hex($devState) &~$mask)|($msgState<<$bitLoc)); my $value = sprintf("%08X",(hex($devState) &~$mask)|($msgState<<$bitLoc));
push @entities, push @entities,CUL_HM_UpdtReadBulk($shash,1,"color:".$value,
CUL_HM_UpdtReadBulk($shash,1,"color:".$value, "state:".$value);
"state:".$value);
if ($chnHash){ if ($chnHash){
$shash = $chnHash; $shash = $chnHash;
my %colorTable=("00"=>"off","01"=>"red","02"=>"green","03"=>"orange"); my %colorTable=("00"=>"off","01"=>"red","02"=>"green","03"=>"orange");
@ -1032,46 +1031,30 @@ sub CUL_HM_Parse($$) {##############################
} }
elsif ($msgType eq "41"){ #Alarm detected elsif ($msgType eq "41"){ #Alarm detected
my ($No,$state) = (substr($p,2,2),substr($p,4,2)); my ($No,$state) = (substr($p,2,2),substr($p,4,2));
if($dhash && $dname ne $name){ # update source(ID is reported in $dst...) if(($dhash && $dname ne $name) && # update source(ID is reported in $dst...)
if (!$dhash->{helper}{alarmNo} || $dhash->{helper}{alarmNo} ne $No){ (!$dhash->{helper}{alarmNo} || $dhash->{helper}{alarmNo} ne $No)){
$dhash->{helper}{alarmNo} = $No; $dhash->{helper}{alarmNo} = $No;
push @entities,CUL_HM_UpdtReadSingle($dhash,'state', push @entities,
(($state eq "01")?"off": CUL_HM_UpdtReadBulk($dhash,1,
(($state eq "C7")?"smoke-forward": 'state:'.(($state eq "01")?"off":"smoke-Alarm_".$No),
"smoke-alarm")),1); "eventNo:".$No
} );
} }
# - - - - - - now handle the team - - - - - - # - - - - - - now handle the team - - - - - -
$shash->{helper}{alarmList} = "" if (!$shash->{helper}{alarmList}); $shash->{helper}{alarmList} = "" if (!$shash->{helper}{alarmList});
$shash->{helper}{alarmFwd} = "" if (!$shash->{helper}{alarmFwd});
if ($state eq "01") { # clear Alarm for one sensor if ($state eq "01") { # clear Alarm for one sensor
$shash->{helper}{alarmList} =~ s/",".$dst//; $shash->{helper}{alarmList} =~ s/",".$dst//;
} }
elsif($state eq "C7"){# add alarm forwarding
$shash->{helper}{alarmFwd} .= ",".$dst;
}
else{ # add alarm for Sensor else{ # add alarm for Sensor
$shash->{helper}{alarmList} .= ",".$dst; $shash->{helper}{alarmList} .= ",".$dst;
} }
my $alarmList; # make alarm ID list readable my $alarmList; # make alarm ID list readable
foreach(split(",",$shash->{helper}{alarmList})){ foreach(split(",",$shash->{helper}{alarmList})){
$alarmList .= CUL_HM_id2Name($_)."," if ($_); $alarmList .= CUL_HM_id2Name($_)."," if ($_);
} }
if (!$alarmList){# all alarms are gone - clear forwarding $shash->{helper}{alarmList} = "" if (!$alarmList);
foreach(split(",",$shash->{helper}{alarmFwd})){
my $fHash = CUL_HM_id2Hash($1) if ($1);
push @entities,CUL_HM_UpdtReadSingle($fHash,'state',"off",1)if ($fHash);
}
$shash->{helper}{alarmList} = "";
$shash->{helper}{alarmFwd} = "";
}
my $alarmFwd; # make forward ID list readable
foreach(split(",",$shash->{helper}{alarmFwd})){
$alarmFwd .= CUL_HM_id2Name($_)."," if ($_);
}
push @event,"state:" .($alarmList?"smoke-Alarm":"off" ); push @event,"state:" .($alarmList?"smoke-Alarm":"off" );
push @event,"smoke_detect:" .($alarmList?$alarmList :"none"); push @event,"smoke_detect:" .($alarmList?$alarmList :"none");
push @event,"smoke_forward:".($alarmFwd ?$alarmFwd :"none");
} }
elsif ($msgType eq "01"){ #Configs elsif ($msgType eq "01"){ #Configs
my $sType = substr($p,0,2); my $sType = substr($p,0,2);
@ -1489,8 +1472,8 @@ sub CUL_HM_parseCommon(@){#####################################################
elsif($subType eq "06"){ #reply to status request======================= elsif($subType eq "06"){ #reply to status request=======================
my $rssi = substr($p,8,2);# --calculate RSSI my $rssi = substr($p,8,2);# --calculate RSSI
CUL_HM_storeRssi(CUL_HM_hash2Name($shash), CUL_HM_storeRssi(CUL_HM_hash2Name($shash),
($dhash?CUL_HM_hash2Name($dhash):$shash->{IODev}{NAME}), ($dhash?CUL_HM_hash2Name($dhash):$shash->{IODev}{NAME}),
(-1)*(hex($rssi))) (-1)*(hex($rssi)))
if ($rssi && $rssi ne '00' && $rssi ne'80'); if ($rssi && $rssi ne '00' && $rssi ne'80');
@{$modules{CUL_HM}{helper}{reqStatus}} = grep { $_ != $shash->{NAME} } @{$modules{CUL_HM}{helper}{reqStatus}} = grep { $_ != $shash->{NAME} }
@{$modules{CUL_HM}{helper}{reqStatus}}; @{$modules{CUL_HM}{helper}{reqStatus}};
@ -1505,7 +1488,7 @@ sub CUL_HM_parseCommon(@){#####################################################
my ($chn) = ($1) if($p =~ m/^..(..)/); my ($chn) = ($1) if($p =~ m/^..(..)/);
if ($chn eq "00"){ if ($chn eq "00"){
CUL_HM_queueAutoRead(CUL_HM_hash2Name($shash)) CUL_HM_queueAutoRead(CUL_HM_hash2Name($shash))
if (1 < substr(AttrVal($shash->{NAME},"autoReadReg",0),0,1)); if (1 < CUL_HM_getARead($shash->{NAME}));
return "powerOn" ;# check dst eq "000000" as well? return "powerOn" ;# check dst eq "000000" as well?
} }
} }
@ -2243,32 +2226,36 @@ sub CUL_HM_Set($@) {
} }
} }
elsif($md eq "HM-OU-CFM-PL"){ elsif($md eq "HM-OU-CFM-PL"){
return "use channel 1 of the device for LED" if ($chn != 1);
my %color = (redL =>18,greenL =>34,orangeL =>50, my %color = (redL =>18,greenL =>34,orangeL =>50,
redS =>17,greenS =>33,orangeS =>49); redS =>17,greenS =>33,orangeS =>49);
my @ledList = split(',',$a[2]); my @ledList = split(',',$a[2]);
my $ledBytes; my $repeat = (defined $a[3] && $a[3] =~ m/^(\d+)$/)?$a[3]:1;
return "repetition $repeat out of range [1..255]"
if($repeat < 1 || $repeat > 255);
my $ledBytes = sprintf("%02X",$repeat);
foreach my $led (@ledList){ foreach my $led (@ledList){
if (!$color{$led} ){# wrong parameter if (!$color{$led} ){# wrong parameter
return "'$led' unknown. use: ".join(" ",sort keys(%color)); return "'$led' unknown. use: ".join(" ",sort keys(%color));
} }
$ledBytes .= sprintf("%02X",$color{$led}); $ledBytes .= sprintf("%02X",$color{$led});
} }
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'80'.$chn.'0101'.$ledBytes); CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'80'.$chn.'01'.$ledBytes);
} }
else{ else{
return "device for command cannot be identified"; return "device for command cannot be identified";
} }
} }
elsif($cmd eq "playTone") { ################################################# elsif($cmd eq "playTone") { #################################################
$chn = "02" if (length($hash->{DEF}) == 6);# be nice, select implicite
return "use channel 2 of the device to play MP3" if ($chn != 2);
my @mp3List = split(',',$a[2]); my @mp3List = split(',',$a[2]);
my $mp3Bytes; my $repeat = (defined $a[3] && $a[3] =~ m/^(\d+)$/)?$a[3]:1;
return "repetition $repeat out of range [1..255]"
if($repeat < 1 || $repeat > 255);
my $mp3Bytes = sprintf("%02X",$repeat);
foreach my $mp3 (@mp3List){ foreach my $mp3 (@mp3List){
$mp3Bytes .= sprintf("%02X",$mp3); $mp3Bytes .= sprintf("%02X",$mp3);
} }
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'80'.$chn.'0202'.$mp3Bytes); CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'80'.$chn.'01'.$mp3Bytes);
} }
elsif($cmd eq "ilum") { ################################################# reg elsif($cmd eq "ilum") { ################################################# reg
return "$a[2] not specified. choose 0-15 for brightness" if ($a[2]>15); return "$a[2] not specified. choose 0-15 for brightness" if ($a[2]>15);
@ -2431,7 +2418,7 @@ sub CUL_HM_Set($@) {
} }
} }
elsif($cmd eq "peerChan") { ################################################# elsif($cmd eq "peerChan") { #################################################
#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[5],$a[6]);
$state = ""; $state = "";
return "$bNo is not a button number" if(($bNo < 1) && !$chn); return "$bNo is not a button number" if(($bNo < 1) && !$chn);
@ -2926,8 +2913,8 @@ sub CUL_HM_pushConfig($$$$$$$$) {#generate messages to cnfig data to register
substr($content,$l,$ml)); substr($content,$l,$ml));
} }
CUL_HM_PushCmdStack($hash,"++A001".$src.$dst.$chn."06"); CUL_HM_PushCmdStack($hash,"++A001".$src.$dst.$chn."06");
my $rd = substr(CUL_HM_Get($hash,$hash->{NAME},"param","autoReadReg"),0,1); CUL_HM_queueAutoRead(CUL_HM_hash2Name($hash))
CUL_HM_queueAutoRead(CUL_HM_hash2Name($hash)) if ($rd=~m/\d/ && 2 < $rd); if (2 < CUL_HM_getARead($hash->{NAME}));
} }
sub CUL_HM_Resend($) {#resend a message if there is no answer sub CUL_HM_Resend($) {#resend a message if there is no answer
my $hash = shift; my $hash = shift;
@ -3774,13 +3761,18 @@ sub CUL_HM_qStateUpdat($){#in:name or id, queue send stat-request after 12 sec
$name = CUL_HM_id2Name($name) if ($name =~ m/^[A-F0-9]{6,8}$/i); $name = CUL_HM_id2Name($name) if ($name =~ m/^[A-F0-9]{6,8}$/i);
$name =~ s /_chn:..$//; $name =~ s /_chn:..$//;
return if (!$defs{$name}); #device unknown, ignore return if (!$defs{$name}); #device unknown, ignore
if (substr(AttrVal($name,"autoReadReg",0),0,1) > 3){ if (CUL_HM_getARead($name) > 3){
@{$modules{CUL_HM}{helper}{reqStatus}}= @{$modules{CUL_HM}{helper}{reqStatus}}=
CUL_HM_noDup(@{$modules{CUL_HM}{helper}{reqStatus}},$name); CUL_HM_noDup(@{$modules{CUL_HM}{helper}{reqStatus}},$name);
RemoveInternalTimer("CUL_HM_reqStatus"); RemoveInternalTimer("CUL_HM_reqStatus");
InternalTimer(gettimeofday()+120,"CUL_HM_reqStatus","CUL_HM_reqStatus", 0); InternalTimer(gettimeofday()+120,"CUL_HM_reqStatus","CUL_HM_reqStatus", 0);
} }
} }
sub CUL_HM_getARead($){#return valid autoRegRead as integer
my $name = shift;
my $aRd = CUL_HM_Get($defs{$name},$name,"param","autoReadReg");
return ($aRd eq "undefined")?0:int($aRd);
}
#+++++++++++++++++ external use +++++++++++++++++++++++++++++++++++++++++++++++ #+++++++++++++++++ external use +++++++++++++++++++++++++++++++++++++++++++++++
sub CUL_HM_putHash($) {# provide data for HMinfo sub CUL_HM_putHash($) {# provide data for HMinfo
@ -4157,8 +4149,8 @@ sub CUL_HM_putHash($) {# provide data for HMinfo
activate learn mode. Whether commands are pending is reported on activate learn mode. Whether commands are pending is reported on
device level with parameter 'protCmdPend'. device level with parameter 'protCmdPend'.
<ul> <ul>
<li><B>peerChan &lt;btn_no&gt; &lt;hmDevice&gt; [single|dual] <li><B>peerChan &lt;btn_no&gt; &lt;actChan&gt; [single|<u>dual</u>]
[set|unset] [actor|remote]</B><a name="CUL_HMpeerChan"></a><br> [<u>set</u>|unset] [<u>both</u>|actor|remote]</B><a name="CUL_HMpeerChan"></a><br>
peerChan will establish a connection between a sender-<B>channel</B> and peerChan will establish a connection between a sender-<B>channel</B> and
an actuator-<B>channel</B> called link in HM nomenclatur. Peering must not be an actuator-<B>channel</B> called link in HM nomenclatur. Peering must not be
@ -4189,18 +4181,20 @@ sub CUL_HM_putHash($) {# provide data for HMinfo
well as one sender-channel to multiple Actuator-channel is well as one sender-channel to multiple Actuator-channel is
possible.<br> possible.<br>
&lt;hmDevice&gt; is the actuator-channel to be peered.<br> &lt;actChan&gt; is the actuator-channel to be peered.<br>
&lt;btn_no&gt; is the sender-channel (button) to be peered. If &lt;btn_no&gt; is the sender-channel (button) to be peered. If
'single' is choosen buttons are counted from 1. For 'dual' btn_no is 'single' is choosen buttons are counted from 1. For 'dual' btn_no is
the number of the Button-pair to be used. I.e. '3' in dual is the the number of the Button-pair to be used. I.e. '3' in dual is the
3rd button pair correcponding to button 5 and 6 in single mode.<br> 3rd button pair correcponding to button 5 and 6 in single mode.<br>
If the command is executed on a channel the btn_no is ignored.<br> If the command is executed on a channel the btn_no is ignored.
It needs to be set, should be 0<br>
[single|dual]: this mode impacts the default behavior of the [single|dual]: this mode impacts the default behavior of the
Actuator upon using this button. E.g. a dimmer can be learned to a Actuator upon using this button. E.g. a dimmer can be learned to a
single button or to a button pair. <br> single button or to a button pair. <br>
Defaults to dual.<br>
'dual' (default) Button pairs two buttons to one actuator. With a 'dual' (default) Button pairs two buttons to one actuator. With a
dimmer this means one button for dim-up and one for dim-down. <br> dimmer this means one button for dim-up and one for dim-down. <br>
@ -4209,13 +4203,15 @@ sub CUL_HM_putHash($) {# provide data for HMinfo
simple switch actuator to toggle on/off. Nevertheless also dimmer can simple switch actuator to toggle on/off. Nevertheless also dimmer can
be learned to only one button. <br> be learned to only one button. <br>
[set|unset]: selects either enter a peering or remove it.<br>
Defaults to set.<br>
'set' will setup peering for the channels<br> 'set' will setup peering for the channels<br>
'unset' will remove the peering for the channels<br> 'unset' will remove the peering for the channels<br>
[actor|remote|both] limits the execution to only actor or only remote. [actor|remote|both] limits the execution to only actor or only remote.
This gives the user the option to redo the peering on the remote This gives the user the option to redo the peering on the remote
channel while the settings in the actor will not be removed.<br> channel while the settings in the actor will not be removed.<br>
Defaults to both.<br>
Example: Example:
<ul> <ul>
@ -4322,13 +4318,17 @@ sub CUL_HM_putHash($) {# provide data for HMinfo
<li>OutputUnit (HM-OU-CFM-PL) <li>OutputUnit (HM-OU-CFM-PL)
<ul> <ul>
<li><B>led &lt;color&gt;[,&lt;color&gt;..]</B><br> <li><B>led &lt;color&gt;[,&lt;color&gt;..]</B><br>
Possible colors are [redL|greenL|yellowL|redS|greenS|yellowS]. A Possible colors are [redL|greenL|yellowL|redS|greenS|yellowS]. A
sequence of colors can be given separating the color entries by ','. sequence of colors can be given separating the color entries by ','.
White spaces must not be used in the list. 'S' indicates short and White spaces must not be used in the list. 'S' indicates short and
'L' long ilumination. <br></li> 'L' long ilumination. <br>
<li><B>playTone &lt;MP3No&gt[,&lt;MP3No&gt..]</B><br> repeat defines how many times the sequence is executed. Defaults to 1<br>
Play a series of tones. List is to be entered separated by ','. White </li>
spaces must not be used in the list.<br></li> <li><B>playTone &lt;MP3No&gt[,&lt;MP3No&gt..] [,&lt;repeat&gt..]</B><br>
Play a series of tones. List is to be entered separated by ','. White
spaces must not be used in the list.<br>
repeat defines how many times the sequence is played. Defaults to 1<br>
</li>
</ul><br> </ul><br>
</li> </li>
<li>HM-RC-19xxx <li>HM-RC-19xxx

View File

@ -9,7 +9,6 @@ sub CommandXmlList($$);
sub XmlEscape($); sub XmlEscape($);
use Blocking; use Blocking;
sub HMinfo_Initialize($$) {#################################################### sub HMinfo_Initialize($$) {####################################################
my ($hash) = @_; my ($hash) = @_;
@ -20,7 +19,8 @@ sub HMinfo_Define($$){#########################################################
my ($hash, $def) = @_; my ($hash, $def) = @_;
my @a = split("[ \t][ \t]*", $def); my @a = split("[ \t][ \t]*", $def);
my $name = $hash->{NAME}; my $name = $hash->{NAME};
$hash->{Version} = "Beta-04"; $hash->{Version} = "01";
$attr{$name}{webCmd} = "protoEvents:rssi:peerXref:configCheck:models";
return; return;
} }
sub HMinfo_getParam(@) { ###################################################### sub HMinfo_getParam(@) { ######################################################
@ -55,12 +55,15 @@ sub HMinfo_regCheck(@) { ######################################################
push @peerIdInReg,CUL_HM_name2Id($peer); push @peerIdInReg,CUL_HM_name2Id($peer);
} }
#- - - - check whether peer is required - - - - #- - - - check whether peer is required - - - -
my $peerLinReg = (join ",",sort @peerIdInReg); my $st = CUL_HM_Get($defs{$eName},$eName,"param","subType");
$peerLinReg .= "," if ($peerLinReg); if ($st !~ m/(thermostat|smokeDetector)/){
my $peerIDs = AttrVal($eName,"peerIDs",""); my $peerLinReg = (join ",",sort @peerIdInReg);
$peerIDs =~ s/00000000,//; $peerLinReg .= "," if ($peerLinReg);
push @peerRegsFail,$eName." - found:".$peerLinReg." expected:".$peerIDs my $peerIDs = AttrVal($eName,"peerIDs","");
if ($peerLinReg ne $peerIDs); $peerIDs =~ s/00000000,//;
push @peerRegsFail,$eName." - found:".$peerLinReg." expected:".$peerIDs
if ($peerLinReg ne $peerIDs);
}
} }
return "\n incomplete register set\n " .(join "\n ",sort @regIncompl) return "\n incomplete register set\n " .(join "\n ",sort @regIncompl)
."\n missing Peer Registerset\n ".(join "\n ",sort @peerRegsFail) ."\n missing Peer Registerset\n ".(join "\n ",sort @peerRegsFail)
@ -331,15 +334,6 @@ sub HMinfo_SetFn($$) {#########################################################
elsif($cmd eq "models") {##print capability, models---------------------- elsif($cmd eq "models") {##print capability, models----------------------
my %th = CUL_HM_putHash("culHmModel"); my %th = CUL_HM_putHash("culHmModel");
my @model; my @model;
push @model,sprintf("%4s %-24s %-16s %-13s %-5s %-5s %s"
," ID"
,"name"
,"subType"
,"supportedMode"
,"Info"
,"List"
,"channels"
);
foreach (keys %th){ foreach (keys %th){
my $mode = $th{$_}{rxt}; my $mode = $th{$_}{rxt};
$mode =~ s/c/config/; $mode =~ s/c/config/;
@ -355,17 +349,27 @@ sub HMinfo_SetFn($$) {#########################################################
my ($n,$s,$e) = split(":",$_); my ($n,$s,$e) = split(":",$_);
$chan .= $s.(($s eq $e)?"":("-".$e))." ".$n.", "; $chan .= $s.(($s eq $e)?"":("-".$e))." ".$n.", ";
} }
push @model,sprintf("%4s %-24s %-16s %-13s %-5s %-5s %s" push @model,sprintf("%-16s %-24s %4s %-13s %-5s %-5s %s"
,$_
,$th{$_}{name}
,$th{$_}{st} ,$th{$_}{st}
,$th{$_}{name}
,$_
,$mode ,$mode
,$th{$_}{cyc} ,$th{$_}{cyc}
,$list ,$list
,$chan ,$chan
); );
} }
$ret = $cmd.($filter?" filtered":"").":$filter\n ".join"\n ",grep(/$filter/,sort @model); $ret = $cmd.($filter?" filtered":"").":$filter\n "
.sprintf("%-16s %-24s %4s %-13s %-5s %-5s %s\n "
,"subType"
,"name"
,"ID"
,"supportedMode"
,"Info"
,"List"
,"channels"
)
.join"\n ",grep(/$filter/,sort @model);
} }
elsif($cmd eq "help") { elsif($cmd eq "help") {
$ret = " Unknown argument $cmd, choose one of " $ret = " Unknown argument $cmd, choose one of "
@ -476,114 +480,105 @@ sub HMinfo_post($) {###########################################################
<h3>HMinfo</h3> <h3>HMinfo</h3>
<ul> <ul>
<tr><td> <tr><td>
HMinfo is a module that shall support in getting an overview of HM HMinfo is a module that shall support in getting an overview of
installation and settings. It also allows some HM wide commands such eQ-3 HomeMatic devices as defines in <a href="#CUL_HM">CUL_HM</a>.
as store all collected register settings. It also allows some HM wide commands such
<br> as store all collected register settings.<br><br>
Commands will be executed on all HM entities of the installation. Commands will be executed on all HM entities of the installation.
If applicable and evident execution is restricted to related entities. If applicable and evident execution is restricted to related entities.
This means that rssi is only executed on devices, not in channels. This means that rssi is executed only on devices, never channels since
Channels never have rssi values.<br> they never have support rssi values.<br><br>
Filter can be applied as following:<br> <b>Filter</b>
set &lt;name&gt; &lt;cmd&gt; &lt;filter&gt; [&lt;param&gt;]<br> <ul> can be applied as following:<br><br>
whereby the filter is has the two segments<br> <code>set &lt;name&gt; &lt;cmd&gt; &lt;filter&gt; [&lt;param&gt;]</code><br>
[-dcasev] [-f &lt;filter&gt;]<br> whereby filter has two segments, typefilter and name filter<br>
with filter for types <br> [-dcasev] [-f &lt;filter&gt;]<br><br>
<li> filter for <b>types</b> <br>
d - device :include devices<br> <ul>
c - channels :include channels<br> <li>d - device :include devices</li>
v - virtual :supress fhem virtual<br> <li>c - channels :include channels</li>
p - physical :supress physical<br> <li>v - virtual :supress fhem virtual</li>
a - aktor :supress actor<br> <li>p - physical :supress physical</li>
s - sensor :supress sensor<br> <li>a - aktor :supress actor</li>
e - empty :include results even if requested fields are empty<br> <li>s - sensor :supress sensor</li>
</li> <li>e - empty :include results even if requested fields are empty</li>
and/or a filter for names:<br> </ul>
<li> and/or a filter for <b>names</b>:<br>
-f - filter :regexp to filter entity names <br> <ul>
</li> <li>-f - filter :regexp to filter entity names </li>
example:<br> </ul>
<li> Example:<br>
set hm param -d -f dim state # display param 'state' for all devices whos name contains dim <ul><code>
set hm param -c -f ^dimUG$ peerList # display param 'peerList' for all channels whos name is dimUG set hm param -d -f dim state # display param 'state' for all devices whos name contains dim<br>
set hm param -dcv expert # get attribut expert for all channels,devices or virtuals set hm param -c -f ^dimUG$ peerList # display param 'peerList' for all channels whos name is dimUG<br>
</li> set hm param -dcv expert # get attribut expert for all channels,devices or virtuals<br>
</code></ul>
</ul>
<br> <br>
<a name="HMinfodefine"></a> <a name="HMinfodefine"></a>
<b>Define</b> <b>Define</b>
<ul> <ul>
<code>define &lt;name&gt; HMinfo</code><br> <code>define &lt;name&gt; HMinfo</code><br>
Just one entity needs to be defines, no parameter are necessary.<br>
</ul> </ul>
<br> <br>
<a name="HMinfoset"></a> <a name="HMinfoset"></a>
<b>Set</b> <b>Set</b>
even though the commands are more a get funktion they are implemented
as set to allow simple web interface usage <br>
<ul> <ul>
<li><a href="#models">models</a><br> even though the commands are more a get funktion they are implemented
<li>list all HM models that are supported in FHEM as set to allow simple web interface usage<br>
</li> <ul>
</li> <li><a href="#models">models</a><br>
<li><a href="#param">param &lt;name&gt; &lt;name&gt;...</a><br> list all HM models that are supported in FHEM
<li>returns a table parameter values (attribute, readings,...) </li>
for all entities as a table <li><a href="#param">param &lt;name&gt; &lt;name&gt;...</a><br>
</li> returns a table parameter values (attribute, readings,...)
</li> for all entities as a table
<li><a href="#regCheck">regCheck</a><br> </li>
<li>performs a consistancy check on register readings for completeness <li><a href="#regCheck">regCheck</a><br>
</li> performs a consistancy check on register readings for completeness
</li> </li>
<li><a href="#peerCheck">peerCheck</a><br> <li><a href="#peerCheck">peerCheck</a><br>
<li>performs a consistancy check on peers. If a peer is set in one channel performs a consistancy check on peers. If a peer is set in one channel
this funktion will search wether the peer also exist on the opposit side. this funktion will search wether the peer also exist on the opposit side.
</li> </li>
</li> <li><a href="#configCheck">configCheck</a><br>
<li><a href="#configCheck">configCheck</a><br> performs a consistancy check of HM settings. It includes regCheck and peerCheck
<li>performs a consistancy check of HM settings. It includes regCheck and peerCheck </li>
</li> <li><a href="#peerXref">peerXref</a><br>
</li> provides a cross-reference on peerings, a kind of who-with-who summary over HM
<li><a href="#peerXref">peerXref</a><br> </li>
<li>provides a cross-reference on peerings, a kind of who-with-who summary over HM <li><a href="#saveConfig">saveConfig</a><br>
</li> performs a save for all HM register setting.
</li> </li>
<li><a href="#saveConfig">saveConfig</a><br> <li><a href="#clearProtocol">clearProtocol</a><br>
<li>performs a save for all HM register setting. executes a set clear msgEvents on all HM devices
</li> </li>
</li> <li><a href="#clearReadings">clearReadings</a><br>
<li><a href="#clearProtocol">clearProtocol</a><br> executes a set clear readings on all HM devices
<li>executes a set clear msgEvents on all HM devices </li>
</li> <li><a href="#clearRssi">clearRssi</a><br>
</li> executes a set clear rssi on all HM devices
<li><a href="#clearReadings">clearReadings</a><br> </li>
<li>executes a set clear readings on all HM devices <li><a href="#autoReadReg">autoReadReg</a><br>
</li> stimulates a read of the configuration for the devices.
</li> </li>
<li><a href="#clearRssi">clearRssi</a><br> <li><a href="#sys">sys</a><br>
<li>executes a set clear rssi on all HM devices </li>
</li> </ul>
</li>
<li><a href="#autoReadReg">autoReadReg</a><br>
<li>stimulates a read of the configuration for the devices.
</li>
</li>
<li><a href="#sys">sys</a><br>
</li>
</ul> </ul>
<br> <br>
<a name="HMinfoget"></a> <a name="HMinfoget"></a>
<b>Get</b> <b>Get</b>
<ul> <ul> N/A </ul>
N/A
</ul>
<br><br> <br><br>
<a name="HMinfoattr"></a> <a name="HMinfoattr"></a>
<b>Attributes</b> <b>Attributes</b>
<ul> <ul>N/A</ul>
N/A
</ul>
</ul> </ul>
=end html =end html
=cut =cut

View File

@ -752,13 +752,13 @@ my %culHmSubTypeSets = (# channels of this subtype
up => "[<changeValue>] [ontime] [ramptime]...", up => "[<changeValue>] [ontime] [ramptime]...",
down => "[<changeValue>] [ontime] [ramptime]..." down => "[<changeValue>] [ontime] [ramptime]..."
}, },
remote =>{ peerChan => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]",}, remote =>{ peerChan => "<btnNumber> <actChn> ... [single|dual] [set|unset] [actor|remote|both]",},
threeStateSensor =>{ peerChan => "<btnNumber> device ... single [set|unset] [actor|remote|both]",}, threeStateSensor =>{ peerChan => "<btnNumber> <actChn> ... single [set|unset] [actor|remote|both]",},
virtual =>{ peerChan => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]", virtual =>{ peerChan => "<btnNumber> <actChn> ... [single|dual] [set|unset] [actor|remote|both]",
press => "[long|short]...", press => "[long|short]...",
valvePos => "position", },#acting as TC valvePos => "position", },#acting as TC
smokeDetector =>{ test => "", alarmOn=>"", alarmOff=>"", smokeDetector =>{ test => "", alarmOn=>"", alarmOff=>"",
peerChan => "<btnNumber> device ... single [set|unset] actor",}, peerChan => "<btnNumber> <actChn> ... single [set|unset] actor",},
winMatic =>{ matic => "<btn>", winMatic =>{ matic => "<btn>",
keydef => "<btn> <txt1> <txt2>", keydef => "<btn> <txt1> <txt2>",
create => "<txt>" }, create => "<txt>" },
@ -779,9 +779,7 @@ my %culHmModelSets = (# channels of this subtype-------------
"HM-PB-4DIS-WM"=>{text => "<btn> [on|off] <txt1> <txt2>"}, "HM-PB-4DIS-WM"=>{text => "<btn> [on|off] <txt1> <txt2>"},
"HM-OU-LED16" =>{led =>"[off|red|green|orange]" , "HM-OU-LED16" =>{led =>"[off|red|green|orange]" ,
ilum =>"[0-15] [0-127]" }, ilum =>"[0-15] [0-127]" },
"HM-OU-CFM-PL" =>{led => "<color>[,<color>..]", "HM-OU-CFM-PL" =>{press => "[long|short] [on|off] ..."},
playTone => "<MP3No>[,<MP3No>..]",
press => "[long|short] [on|off] ..."},
"HM-Sys-sRP-Pl"=>{setRepeat => "[no1..36] <sendName> <recName> [bdcast-yes|no]"}, "HM-Sys-sRP-Pl"=>{setRepeat => "[no1..36] <sendName> <recName> [bdcast-yes|no]"},
); );
# clones- - - - - - - - - - - - - - - - - # clones- - - - - - - - - - - - - - - - -
@ -791,7 +789,7 @@ $culHmModelSets{"HM-RC-19-SW"} = $culHmModelSets{"HM-RC-19"};
my %culHmChanSets = ( my %culHmChanSets = (
"HM-CC-TC02" =>{ "HM-CC-TC02" =>{
peerChan => "<btnNumber> device ... single [set|unset] [actor|remote|both]", peerChan => "<btnNumber> <actChn> ... single [set|unset] [actor|remote|both]",
"day-temp" => "[on,off,6.0..30.0]", "day-temp" => "[on,off,6.0..30.0]",
"night-temp" => "[on,off,6.0..30.0]", "night-temp" => "[on,off,6.0..30.0]",
"party-temp" => "[on,off,6.0..30.0]", "party-temp" => "[on,off,6.0..30.0]",
@ -811,6 +809,8 @@ my %culHmChanSets = (
sysTime => "" }, sysTime => "" },
"HM-SEC-WIN01"=>{ stop =>"", "HM-SEC-WIN01"=>{ stop =>"",
level =>"<level> <relockDly> <speed>..."}, level =>"<level> <relockDly> <speed>..."},
"HM-OU-CFM-PL01" =>{led => "<color>[,<color>...] [<repeat>]"},
"HM-OU-CFM-PL02" =>{playTone => "<MP3No>[,<MP3No>...] [<repeat>]"},
); );
# clones- - - - - - - - - - - - - - - - - # clones- - - - - - - - - - - - - - - - -
$culHmChanSets{"HM-CC-TC00"} = $culHmChanSets{"HM-CC-TC02"}; $culHmChanSets{"HM-CC-TC00"} = $culHmChanSets{"HM-CC-TC02"};