2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 16:46:35 +00:00

HMCCU: Updated 4.4 Beta in contrib

git-svn-id: https://svn.fhem.de/fhem/trunk@23439 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
zap 2020-12-31 10:21:16 +00:00
parent 92e0ee22bf
commit c22732e3fd
5 changed files with 1043 additions and 486 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
#
# $Id: 88_HMCCUCHN.pm 18552 2019-02-10 11:52:28Z zap $
#
# Version 4.4.029
# Version 4.4.031
#
# (c) 2020 zap (zap01 <at> t-online <dot> de)
#
@ -47,12 +47,12 @@ sub HMCCUCHN_Initialize ($)
$hash->{parseParams} = 1;
$hash->{AttrList} = 'IODev ccucalculate '.
'ccuflags:multiple-strict,ackState,logCommand,noReadings,trace,showMasterReadings,showLinkReadings,showDeviceReadings '.
'ccuflags:multiple-strict,ackState,logCommand,noReadings,trace,showMasterReadings,showLinkReadings,showDeviceReadings,showServiceReadings '.
'ccureadingfilter:textField-long '.
'ccureadingformat:name,namelc,address,addresslc '.
'ccureadingname:textField-long ccuSetOnChange ccuReadingPrefix '.
'ccuscaleval ccuverify:0,1,2 ccuget:State,Value controldatapoint '.
'disable:0,1 hmstatevals:textField-long statedatapoint statevals substitute:textField-long '.
'ccuscaleval ccuverify:0,1,2 ccuget:State,Value '.
'disable:0,1 hmstatevals:textField-long statevals substitute:textField-long '.
'substexcl stripnumber peer:textField-long traceFilter '. $readingFnAttributes;
}
@ -158,13 +158,16 @@ sub HMCCUCHN_InitDevice ($$)
$devHash->{ccutype} = $dt;
$devHash->{ccudevstate} = 'active';
# Initialize user attributes
HMCCU_SetSCAttributes ($ioHash, $devHash);
if ($init_done) {
# Interactive device definition
HMCCU_AddDevice ($ioHash, $di, $da, $devHash->{NAME});
HMCCU_UpdateDevice ($ioHash, $devHash);
HMCCU_UpdateDeviceRoles ($ioHash, $devHash);
my ($sc, $sd, $cc, $cd, $sdCnt, $cdCnt) = HMCCU_GetSpecialDatapoints ($devHash);
my ($sc, $sd, $cc, $cd, $sdCnt, $cdCnt) = HMCCU_GetSCDatapoints ($devHash);
HMCCU_UpdateRoleCommands ($ioHash, $devHash, $cc);
HMCCU_UpdateAdditionalCommands ($ioHash, $devHash, $cc, $cd);
@ -252,13 +255,13 @@ sub HMCCUCHN_Set ($@)
my ($hash, $a, $h) = @_;
my $name = shift @$a;
my $opt = shift @$a // return 'No set command specified';
$opt = lc($opt);
my $lcopt = lc($opt);
# Check device state
return "Device state doesn't allow set commands"
if (!defined($hash->{ccudevstate}) ||
$hash->{ccudevstate} eq 'pending' || !defined($hash->{IODev}) ||
($hash->{readonly} eq 'yes' && $opt !~ /^(\?|clear|config|defaults)$/) ||
($hash->{readonly} eq 'yes' && $lcopt !~ /^(\?|clear|config|defaults)$/) ||
AttrVal ($name, 'disable', 0) == 1);
my $ioHash = $hash->{IODev};
@ -267,7 +270,7 @@ sub HMCCUCHN_Set ($@)
if (HMCCU_IsRPCStateBlocking ($ioHash));
# Get state and control datapoints
my ($sc, $sd, $cc, $cd) = HMCCU_GetSpecialDatapoints ($hash);
my ($sc, $sd, $cc, $cd) = HMCCU_GetSCDatapoints ($hash);
# Additional commands, including state commands
my $cmdList = $hash->{hmccu}{cmdlist}{set} // '';
@ -275,7 +278,7 @@ sub HMCCUCHN_Set ($@)
# Some commands require a control datapoint
if ($opt =~ /^(control|toggle)$/) {
return HMCCU_SetError ($hash, -14) if ($cd eq '');
return HMCCU_SetError ($hash, -8)
return HMCCU_SetError ($hash, -8, $cd)
if (!HMCCU_IsValidDatapoint ($hash, $hash->{ccutype}, $hash->{ccuaddr}, $cd, 2));
}
@ -286,7 +289,7 @@ sub HMCCUCHN_Set ($@)
HMCCU_Log ($hash, 3, "set $name $opt ".join (' ', @$a))
if ($opt ne '?' && (HMCCU_IsFlag ($name, 'logCommand') || HMCCU_IsFlag ($ioName, 'logCommand')));
if ($opt eq 'control') {
if ($lcopt eq 'control') {
my $value = shift @$a // return HMCCU_SetError ($hash, "Usage: set $name control {value}");
my $stateVals = HMCCU_GetStateValues ($hash, $cd, $cc);
$rc = HMCCU_SetMultipleDatapoints ($hash,
@ -294,10 +297,10 @@ sub HMCCUCHN_Set ($@)
);
return HMCCU_SetError ($hash, HMCCU_Min(0, $rc));
}
elsif ($opt eq 'datapoint') {
elsif ($lcopt eq 'datapoint') {
return HMCCU_ExecuteSetDatapointCommand ($hash, $a, $h, $cc, $cd);
}
elsif ($opt eq 'toggle') {
elsif ($lcopt eq 'toggle') {
return HMCCU_ExecuteToggleCommand ($hash, $cc, $cd);
}
elsif (exists($hash->{hmccu}{roleCmds}{set}{$opt})) {
@ -306,10 +309,10 @@ sub HMCCUCHN_Set ($@)
elsif ($opt eq 'clear') {
return HMCCU_ExecuteSetClearCommand ($hash, $a);
}
elsif ($opt =~ /^(config|values)$/) {
return HMCCU_ExecuteSetParameterCommand ($ioHash, $hash, $opt, $a, $h);
elsif ($lcopt =~ /^(config|values)$/) {
return HMCCU_ExecuteSetParameterCommand ($ioHash, $hash, $lcopt, $a, $h);
}
elsif ($opt eq 'defaults') {
elsif ($lcopt eq 'defaults') {
my $mode = shift @$a // 'update';
$rc = HMCCU_SetDefaultAttributes ($hash, { mode => $mode, role => undef, ctrlChn => $cc });
$rc = HMCCU_SetDefaults ($hash) if (!$rc);
@ -319,10 +322,14 @@ sub HMCCUCHN_Set ($@)
else {
my $retmsg = "clear defaults:reset,update";
if ($hash->{readonly} ne 'yes') {
$retmsg .= ' config datapoint';
$retmsg .= ' config';
my ($a, $c) = split(":", $hash->{ccuaddr});
my $dpCount = HMCCU_GetValidDatapoints ($hash, $hash->{ccutype}, $c, 2);
$retmsg .= ' datapoint' if ($dpCount > 0);
$retmsg .= " $cmdList" if ($cmdList ne '');
}
return AttrTemplate_Set ($hash, $retmsg, $name, $opt, @$a);
# return AttrTemplate_Set ($hash, $retmsg, $name, $opt, @$a);
return $retmsg;
}
}
@ -335,7 +342,7 @@ sub HMCCUCHN_Get ($@)
my ($hash, $a, $h) = @_;
my $name = shift @$a;
my $opt = shift @$a // return 'No get command specified';
$opt = lc($opt);
my $lcopt = lc($opt);
return undef if (!defined ($hash->{ccudevstate}) || $hash->{ccudevstate} eq 'pending' ||
!defined ($hash->{IODev}));
@ -353,7 +360,7 @@ sub HMCCUCHN_Get ($@)
my $ccuaddr = $hash->{ccuaddr};
my $ccuif = $hash->{ccuif};
my $ccuflags = AttrVal ($name, 'ccuflags', 'null');
my ($sc, $sd, $cc, $cd) = HMCCU_GetSpecialDatapoints ($hash);
my ($sc, $sd, $cc, $cd) = HMCCU_GetSCDatapoints ($hash);
# Additional commands, including state commands
my $cmdList = $hash->{hmccu}{cmdlist}{get} // '';
@ -365,45 +372,40 @@ sub HMCCUCHN_Get ($@)
HMCCU_Log ($hash, 3, "get $name $opt ".join (' ', @$a))
if ($opt ne '?' && $ccuflags =~ /logCommand/ || HMCCU_IsFlag ($ioName, 'logCommand'));
if ($opt eq 'datapoint') {
if ($lcopt eq 'datapoint') {
my $objname = shift @$a // return HMCCU_SetError ($hash, "Usage: get $name datapoint {datapoint}");
return HMCCU_SetError ($hash, -8)
return HMCCU_SetError ($hash, -8, $objname)
if (!HMCCU_IsValidDatapoint ($hash, $ccutype, $ccuaddr, $objname, 1));
$objname = $ccuif.'.'.$ccuaddr.'.'.$objname;
($rc, $result) = HMCCU_GetDatapoint ($hash, $objname, 0);
return $rc < 0 ? HMCCU_SetError ($hash, $rc, $result) : $result;
}
elsif ($opt eq 'deviceinfo') {
elsif ($lcopt eq 'deviceinfo') {
my ($devAddr, undef) = HMCCU_SplitChnAddr ($ccuaddr);
return HMCCU_ExecuteGetDeviceInfoCommand ($ioHash, $hash, $devAddr, $sc, $sd, $cc, $cd);
}
elsif ($opt =~ /^(config|values|update)$/) {
elsif ($lcopt =~ /^(config|values|update)$/) {
my ($devAddr, undef) = HMCCU_SplitChnAddr ($ccuaddr);
my @addList = ($devAddr, "$devAddr:0", $ccuaddr);
my $resp = HMCCU_ExecuteGetParameterCommand ($ioHash, $hash, $opt, \@addList);
my $resp = HMCCU_ExecuteGetParameterCommand ($ioHash, $hash, $lcopt, \@addList);
return HMCCU_SetError ($hash, "Can't get device description") if (!defined($resp));
return HMCCU_DisplayGetParameterResult ($ioHash, $hash, $resp);
}
elsif ($opt eq 'paramsetdesc') {
elsif ($lcopt eq 'paramsetdesc') {
$result = HMCCU_ParamsetDescToStr ($ioHash, $hash);
return defined($result) ? $result : HMCCU_SetError ($hash, "Can't get device model");
}
elsif (exists($hash->{hmccu}{roleCmds}{get}{$opt})) {
return HMCCU_ExecuteRoleCommand ($ioHash, $hash, 'get', $opt, $cc, $a, $h);
}
elsif ($opt eq 'defaults') {
return HMCCU_GetDefaults ($hash, 0);
}
else {
my $retmsg = "HMCCUCHN: Unknown argument $opt, choose one of defaults:noArg datapoint";
my $retmsg = "HMCCUCHN: Unknown argument $opt, choose one of";
$retmsg .= ' update:noArg deviceInfo:noArg config:noArg paramsetDesc:noArg values:noArg';
my ($a, $c) = split(":", $hash->{ccuaddr});
my @valuelist;
my $valuecount = HMCCU_GetValidDatapoints ($hash, $hash->{ccutype}, $c, 1, \@valuelist);
$retmsg .= ":".join(",",@valuelist) if ($valuecount > 0);
$retmsg .= " update:noArg deviceInfo:noArg config:noArg".
" paramsetDesc:noArg values:noArg";
my @dpList;
my $dpCount = HMCCU_GetValidDatapoints ($hash, $hash->{ccutype}, $c, 1, \@dpList);
$retmsg .= ' datapoint:'.join(",",@dpList) if ($dpCount > 0);
$retmsg .= " $cmdList" if ($cmdList ne '');
return $retmsg;
@ -422,8 +424,8 @@ sub HMCCUCHN_Get ($@)
<h3>HMCCUCHN</h3>
<ul>
The module implements Homematic CCU channels as client devices for HMCCU. A HMCCU I/O device must
exist before a client device can be defined. If a CCU channel is not found execute command
'get devicelist' in I/O device. This will synchronize devices and channels between CCU
exist before a client device can be defined. If a CCU channel is not found, execute command
'get ccuConfig' in I/O device. This will synchronize devices and channels between CCU
and HMCCU.
</br></br>
<a name="HMCCUCHNdefine"></a>
@ -440,9 +442,23 @@ sub HMCCUCHN_Get ($@)
<code>define window_living HMCCUCHN WIN-LIV-1 readonly</code><br/>
<code>define temp_control HMCCUCHN BidCos-RF.LEQ1234567:1</code>
<br/><br/>
The interface part of a channel address is optional.
Channel addresses can be found with command 'get deviceinfo &lt;CCU-DeviceName&gt;' executed
in I/O device.
The interface part of a channel address is optional. Channel addresses can be found with command
'get deviceinfo &lt;CCU-DeviceName&gt;' executed in I/O device.<br/><br/>
Internals:<br/>
<ul>
<li>ccuaddr: Address of channel in CCU</li>
<li>ccudevstate: State of device in CCU (active/inactive/dead)</li>
<li>ccuif: Interface of device</li>
<li>ccuname: Name of channel in CCU</li>
<li>ccurole: Role of channel</li>
<li>ccusubtype: Homematic subtype of device (different from ccutype for HmIP devices)</li>
<li>ccutype: Homematic type of device</li>
<li>readonly: Indicates whether FHEM device is writeable</li>
<li>receiver: List of peered devices with role 'receiver'. If no FHEM device exists for a receiver, the
name of the CCU device is displayed preceeded by 'ccu:'</li>
<li>sender: List of peered devices with role 'sender'. If no FHEM device exists for a sender, the
name of the CCU device is displayed preceeded by 'ccu:'</li>
</ul>
</ul>
<br/>
@ -480,7 +496,7 @@ sub HMCCUCHN_Get ($@)
</li><br/>
<li><b>set &lt;name&gt; datapoint &lt;datapoint&gt; &lt;value&gt; | &lt;datapoint&gt=&lt;value&gt; [...]</b><br/>
Set datapoint values of a CCU channel. If value contains blank characters it must be
enclosed in double quotes.<br/><br/>
enclosed in double quotes. This command is only available, if channel contains a writeable datapoint.<br/><br/>
Examples:<br/>
<code>set temp_control datapoint SET_TEMPERATURE 21</code><br/>
<code>set temp_control datapoint AUTO_MODE 1 SET_TEMPERATURE=21</code>
@ -523,14 +539,14 @@ sub HMCCUCHN_Get ($@)
channel contains a datapoint STOP.
</li><br/>
<li><b>set &lt;name&gt; toggle</b><br/>
Toggle state datapoint between values defined by attribute 'statevals'. This command is
only available if state values can be detected or are defined by using attribute
'statevals'. Toggling supports more than two state values.<br/><br/>
Example: Toggle blind actor<br/>
<code>
attr myswitch statevals up:100,down:0<br/>
set myswitch toggle
</code>
Toggle state datapoint between values defined by attribute 'statevals'. This command is
only available if state values can be detected or are defined by using attribute
'statevals'. Toggling supports more than two state values.<br/><br/>
Example: Toggle blind actor<br/>
<code>
attr myswitch statevals up:100,down:0<br/>
set myswitch toggle
</code>
</li><br/>
<li><b>set &lt;name&gt; up [&lt;value&gt;]</b><br/>
[blind,dimmer] Increment value of datapoint LEVEL. This command is only available
@ -549,38 +565,51 @@ sub HMCCUCHN_Get ($@)
<b>Get</b><br/><br/>
<ul>
<li><b>get &lt;name&gt; config</b><br/>
Get configuration parameters of device and channel.
Values related to configuration or link parameters are stored as readings beginning
with "R-" for MASTER parameter set and "L-" for LINK parameter set.
Prefixes can be modified with attribute 'ccuReadingPrefix'. Whether parameters are
stored as readings or not, can be controlled by setting the following flags in
attribute ccuflags:<br/>
noReadings: Do not store any reading.<br/>
showMasterReadings: Store configuration readings of current channel.<br/>
showDeviceReadings: Store readings of device and channel 0.<br/>
showLinkReadings: Store readings of links.<br/>
If non of the flags is set, only readings belonging to parameter set VALUES (datapoints)
are stored.
Get configuration parameters of device and channel.
Values related to configuration or link parameters are stored as readings beginning
with "R-" for MASTER parameter set and "L-" for LINK parameter set.
Prefixes "R-" and "L-" can be modified with attribute 'ccuReadingPrefix'. Whether parameters are
stored as readings or not, can be controlled by setting the following flags in
attribute ccuflags:<br/>
<ul>
<li>noReadings: Do not store any reading.</li>
<li>showMasterReadings: Store configuration readings of parameter set 'MASTER' of current channel.</li>
<li>showDeviceReadings: Store configuration readings of device and value readings of channel 0.</li>
<li>showLinkReadings: Store readings of links.</li>
<li>showServiceReadings: Store readings of parameter set 'SERVICE'</li>
</ul>
If non of the flags is set, only readings belonging to parameter set VALUES (datapoints)
are stored.
</li><br/>
<li><b>get &lt;name&gt; datapoint &lt;datapoint&gt;</b><br/>
Get value of a CCU channel datapoint.
Get value of a CCU channel datapoint. Format of <i>datapoint</i> is ChannelNo.DatapointName.
For HMCCUCHN devices the ChannelNo is not needed. This command is only available if a
readable datapoint exists.
</li><br/>
<li><b>get &lt;name&gt; defaults</b><br/>
Display default attributes for CCU device type.
This command has been removed in version 4.4. The default attributes are included in the
output of command 'get deviceInfo'.
</li><br/>
<li><b>get &lt;name&gt; deviceInfo</b><br/>
Display information about device and channels:<br/>
<ul>
<li>all channels and datapoints of device with datapoint values and types</li>
<li>statedatapoint and controldatapoint</li>
<li>device and channel description</li>
</ul>
Display information about device type and channels:<br/>
<ul>
<li>all channels and datapoints of device with datapoint values and types</li>
<li>statedatapoint and controldatapoint</li>
<li>device and channel description</li>
<li>default attributes (if device is not supported by built in functionality)</li>
</ul>
The output of this command is helpful to gather information about new / not yet supported devices.
Please add this information to your post in the FHEM forum, if you have a question about
the integration of a new device. See also command 'get paramsetDesc'.
</li><br/>
<li><b>get &lt;name&gt; paramsetDesc</b><br/>
Display description of parameter sets of channel and device.
Display description of parameter sets of channel and device. The output of this command
is helpful to gather information about new / not yet supported devices. Please add this
information to your post in the FHEM forum, if you have a question about
the integration of a new device. See also command 'get deviceInfo'.
</li><br/>
<li><b>get &lt;name&gt; update</b><br/>
Update all readings for all parameters of all parameter sets (MASTER, LINK, VALUES).
Update all readings for all parameters of all parameter sets (MASTER, LINK, VALUES).
</li><br/>
<li><b>get &lt;name&gt; values</b><br/>
Update all readings for all parameters of parameter set VALUES (datapoints).
@ -624,6 +653,7 @@ sub HMCCUCHN_Get ($@)
showDeviceReadings: Show readings of device and channel 0.<br/>
showLinkReadings: Show link readings.<br/>
showMasterReadings: Show configuration readings.<br/>
showServiceReadings: Show service readings (HmIP only)<br/>
trace: Write log file information for operations related to this device.
</li><br/>
<a name="ccuget"></a>
@ -686,8 +716,12 @@ sub HMCCUCHN_Get ($@)
</li><br/>
<a name="ccuReadingPrefix"></a>
<li><b>ccuReadingPrefix &lt;paramset&gt;:&lt;prefix&gt;[,...]</b><br/>
Set reading name prefix for parameter sets. The special parameter set 'peer' can
be used for link readings.
Set reading name prefix for parameter sets. Default values for parameter sets are:<br/>
VALUES (state values): No prefix<br/>
MASTER (configuration parameters): 'R-'<br/>
LINK (links parameters): 'L-'<br/>
PEER (peering parameters): 'P-'<br/>
SERVICE (service parameters): S-<br/>
</li><br/>
<a name="ccuscaleval"></a>
<li><b>ccuscaleval &lt;[channelno.]datapoint&gt;:&lt;factor&gt;[,...]</b><br/>

View File

@ -4,7 +4,7 @@
#
# $Id: 88_HMCCUDEV.pm 18552 2019-02-10 11:52:28Z zap $
#
# Version 4.4.034
# Version 4.4.037
#
# (c) 2020 zap (zap01 <at> t-online <dot> de)
#
@ -47,13 +47,13 @@ sub HMCCUDEV_Initialize ($)
$hash->{parseParams} = 1;
$hash->{AttrList} = 'IODev ccuaggregate:textField-long ccucalculate:textField-long '.
'ccuflags:multiple-strict,ackState,logCommand,noReadings,trace,showMasterReadings,showLinkReadings,showDeviceReadings '.
'ccuflags:multiple-strict,ackState,logCommand,noReadings,trace,showMasterReadings,showLinkReadings,showDeviceReadings,showServiceReadings '.
'ccureadingfilter:textField-long '.
'ccureadingformat:name,namelc,address,addresslc,datapoint,datapointlc '.
'ccureadingname:textField-long ccuSetOnChange ccuReadingPrefix '.
'ccuget:State,Value ccuscaleval ccuverify:0,1,2 disable:0,1 '.
'hmstatevals:textField-long statevals substexcl substitute:textField-long statechannel '.
'controlchannel statedatapoint controldatapoint stripnumber peer:textField-long traceFilter '.
'controlchannel stripnumber peer:textField-long traceFilter '.
$readingFnAttributes;
}
@ -67,7 +67,7 @@ sub HMCCUDEV_Define ($@)
my $name = $hash->{NAME};
my $usage = "Usage: define $name HMCCUDEV {device|'virtual'} [control-channel] ".
"['readonly'] ['noDefaults'|'defaults'] [iodev={iodev-name}] [address={virtual-device-no}]".
"['readonly'] ['noDefaults'|'defaults'] [force] [iodev={iodev-name}] [address={virtual-device-no}]".
"[{groupexp=regexp|group={device|channel}[,...]]";
return $usage if (scalar(@$a) < 3);
@ -80,7 +80,7 @@ sub HMCCUDEV_Define ($@)
"Type of virtual device not defined",
"Device type not found",
"Too many virtual devices",
"Control channel ambiguous. Please specify control channel in device definition"
"Use HMCCUCHN instead"
);
my @warnmsg = (
@ -112,6 +112,7 @@ sub HMCCUDEV_Define ($@)
if ($arg eq 'readonly') { $hash->{readonly} = 'yes'; }
elsif (lc($arg) eq 'nodefaults' && $init_done) { $hash->{hmccu}{nodefaults} = 1; }
elsif ($arg eq 'defaults' && $init_done) { $hash->{hmccu}{nodefaults} = 0; }
elsif ($arg eq 'force') { $hash->{hmccu}{forcedev} = 1; }
elsif ($arg =~ /^[0-9]+$/) { $attr{$name}{controlchannel} = $arg; }
else { return $usage; }
}
@ -146,9 +147,14 @@ sub HMCCUDEV_Define ($@)
# Initialize FHEM device, set IO device
my $rc = HMCCUDEV_InitDevice ($ioHash, $hash);
return $errmsg[$rc] if ($rc > 0 && $rc < scalar(@errmsg));
HMCCU_LogDisplay ($hash, 2, $warnmsg[-$rc]) if ($init_done && $rc < 0 && -$rc < scalar(@warnmsg));
return undef;
if (HMCCU_IsIntNum ($rc)) {
return $errmsg[$rc] if ($rc > 0 && $rc < scalar(@errmsg));
HMCCU_LogDisplay ($hash, 2, $warnmsg[-$rc]) if ($init_done && $rc < 0 && -$rc < scalar(@warnmsg));
return undef;
}
else {
return $rc;
}
}
######################################################################
@ -205,33 +211,42 @@ sub HMCCUDEV_InitDevice ($$)
my ($di, $da, $dn, $dt, $dc) = HMCCU_GetCCUDeviceParam ($ioHash, $devspec);
return 1 if (!defined($da));
$gdname = $dn;
# Inform HMCCU device about client device
return 2 if (!HMCCU_AssignIODevice ($devHash, $ioHash->{NAME}));
$devHash->{ccuif} = $di;
$devHash->{ccuaddr} = $da;
$devHash->{ccuname} = $dn;
$devHash->{ccutype} = $dt;
$devHash->{ccudevstate} = 'active';
$devHash->{hmccu}{channels} = $dc;
# Initialize user attributes
my $detect = HMCCU_DetectDevice ($ioHash, $da, $di);
HMCCU_SetSCAttributes ($ioHash, $devHash, $detect);
# Inform HMCCU device about client device
return 2 if (!HMCCU_AssignIODevice ($devHash, $ioHash->{NAME}));
$devHash->{ccudevstate} = 'active';
if ($init_done) {
return "Specify option 'force' for HMCCUDEV or use HMCCUCHN instead (recommended). Command: define $name HMCCUCHN $detect->{defAdd}"
if (defined($detect) && $detect->{defMod} eq 'HMCCUCHN' && $devHash->{hmccu}{forcedev} == 0);
# Interactive device definition
HMCCU_AddDevice ($ioHash, $di, $da, $devHash->{NAME});
HMCCU_UpdateDevice ($ioHash, $devHash);
HMCCU_UpdateDeviceRoles ($ioHash, $devHash);
my ($sc, $sd, $cc, $cd, $sdCnt, $cdCnt) = HMCCU_GetSpecialDatapoints ($devHash);
return -1 if ($cdCnt > 2);
my ($sc, $sd, $cc, $cd, $sdCnt, $cdCnt) = HMCCU_GetSCDatapoints ($devHash);
return -1 if ($cdCnt >= 2);
HMCCU_UpdateRoleCommands ($ioHash, $devHash, $cc);
HMCCU_UpdateAdditionalCommands ($ioHash, $devHash, $cc, $cd);
if (!exists($devHash->{hmccu}{nodefaults}) || $devHash->{hmccu}{nodefaults} == 0) {
my $chn = $cc eq '' ? ($sc eq '' ? undef : $sc) : $cc;
if (!HMCCU_SetDefaultAttributes ($devHash, {
mode => 'update', role => undef, ctrlChn => $cc eq '' ? undef : $cc
mode => 'update', role => undef, roleChn => $chn,
})) {
HMCCU_Log ($devHash, 2, "No role attributes found");
HMCCU_SetDefaults ($devHash);
@ -387,7 +402,7 @@ sub HMCCUDEV_Set ($@)
my ($hash, $a, $h) = @_;
my $name = shift @$a;
my $opt = shift @$a // return 'No set command specified';
$opt = lc($opt);
my $lcopt = lc($opt);
# Check device state
return "Device state doesn't allow set commands"
@ -401,16 +416,16 @@ sub HMCCUDEV_Set ($@)
if (HMCCU_IsRPCStateBlocking ($ioHash));
# Get state and control datapoints
my ($sc, $sd, $cc, $cd) = HMCCU_GetSpecialDatapoints ($hash);
my ($sc, $sd, $cc, $cd) = HMCCU_GetSCDatapoints ($hash);
# Get additional commands
my $cmdList = $hash->{hmccu}{cmdlist}{set} // '';
# Some commands require a control channel and datapoint
if ($opt =~ /^(control|toggle)$/) {
if ($lcopt =~ /^(control|toggle)$/) {
return HMCCU_SetError ($hash, -14) if ($cd eq '');
return HMCCU_SetError ($hash, -12) if ($cc eq '');
return HMCCU_SetError ($hash, -8)
return HMCCU_SetError ($hash, -8, $cd)
if (!HMCCU_IsValidDatapoint ($hash, $hash->{ccutype}, $cc, $cd, 2));
return HMCCU_SetError ($hash, -7) if ($cc >= $hash->{hmccu}{channels});
}
@ -422,7 +437,7 @@ sub HMCCUDEV_Set ($@)
HMCCU_Log ($hash, 3, "set $name $opt ".join (' ', @$a))
if ($opt ne '?' && (HMCCU_IsFlag ($name, 'logCommand') || HMCCU_IsFlag ($ioName, 'logCommand')));
if ($opt eq 'control') {
if ($lcopt eq 'control') {
my $value = shift @$a // return HMCCU_SetError ($hash, "Usage: set $name control {value}");
my $stateVals = HMCCU_GetStateValues ($hash, $cd, $cc);
$rc = HMCCU_SetMultipleDatapoints ($hash,
@ -430,22 +445,22 @@ sub HMCCUDEV_Set ($@)
);
return HMCCU_SetError ($hash, HMCCU_Min(0, $rc));
}
elsif ($opt eq 'datapoint') {
elsif ($lcopt eq 'datapoint') {
return HMCCU_ExecuteSetDatapointCommand ($hash, $a, $h, $cc, $cd);
}
elsif ($opt eq 'toggle') {
elsif ($lcopt eq 'toggle') {
return HMCCU_ExecuteToggleCommand ($hash, $cc, $cd);
}
elsif (exists($hash->{hmccu}{roleCmds}{set}{$opt})) {
return HMCCU_ExecuteRoleCommand ($ioHash, $hash, 'set', $opt, $cc, $a, $h);
}
elsif ($opt eq 'clear') {
elsif ($lcopt eq 'clear') {
return HMCCU_ExecuteSetClearCommand ($hash, $a);
}
elsif ($opt =~ /^(config|values)$/) {
elsif ($lcopt =~ /^(config|values)$/) {
return HMCCU_ExecuteSetParameterCommand ($ioHash, $hash, $opt, $a, $h);
}
elsif ($opt eq 'defaults') {
elsif ($lcopt eq 'defaults') {
my $mode = shift @$a // 'update';
$rc = HMCCU_SetDefaultAttributes ($hash, { mode => $mode, role => undef, ctrlChn => $cc });
$rc = HMCCU_SetDefaults ($hash) if (!$rc);
@ -456,10 +471,13 @@ sub HMCCUDEV_Set ($@)
my $retmsg = 'clear defaults:reset,update';
if ($hash->{readonly} ne 'yes') {
$retmsg .= ' config datapoint';
$retmsg .= ' config';
my $dpCount = HMCCU_GetValidDatapoints ($hash, $hash->{ccutype}, -1, 2);
$retmsg .= ' datapoint' if ($dpCount > 0);
$retmsg .= " $cmdList" if ($cmdList ne '');
}
return AttrTemplate_Set ($hash, $retmsg, $name, $opt, @$a);
# return AttrTemplate_Set ($hash, $retmsg, $name, $opt, @$a);
return $retmsg;
}
}
@ -472,7 +490,7 @@ sub HMCCUDEV_Get ($@)
my ($hash, $a, $h) = @_;
my $name = shift @$a;
my $opt = shift @$a // return 'No get command specified';
$opt = lc($opt);
my $lcopt = lc($opt);
# Get I/O device
return "Device state doesn't allow set commands"
@ -490,7 +508,7 @@ sub HMCCUDEV_Get ($@)
my $ccuaddr = $hash->{ccuaddr};
my $ccuif = $hash->{ccuif};
my $ccuflags = AttrVal ($name, 'ccuflags', 'null');
my ($sc, $sd, $cc, $cd) = HMCCU_GetSpecialDatapoints ($hash);
my ($sc, $sd, $cc, $cd) = HMCCU_GetSCDatapoints ($hash);
# Get additional commands
my $cmdList = $hash->{hmccu}{cmdlist}{get} // '';
@ -506,7 +524,7 @@ sub HMCCUDEV_Get ($@)
HMCCU_Log ($hash, 3, "get $name $opt ".join (' ', @$a))
if ($opt ne '?' && $ccuflags =~ /logCommand/ || HMCCU_IsFlag ($ioName, 'logCommand'));
if ($opt eq 'datapoint') {
if ($lcopt eq 'datapoint') {
my $objname = shift @$a // return HMCCU_SetError ($hash, "Usage: get $name datapoint [{channel-number}.]{datapoint}");
if ($objname =~ /^([0-9]+)\..+$/) {
@ -518,7 +536,7 @@ sub HMCCUDEV_Get ($@)
$objname = $sc.'.'.$objname;
}
return HMCCU_SetError ($hash, -8)
return HMCCU_SetError ($hash, -8, $objname)
if (!HMCCU_IsValidDatapoint ($hash, $ccutype, undef, $objname, 1));
$objname = $ccuif.'.'.$ccuaddr.':'.$objname;
@ -528,39 +546,33 @@ sub HMCCUDEV_Get ($@)
HMCCU_SetState ($hash, "OK") if (exists ($hash->{STATE}) && $hash->{STATE} eq "Error");
return $result;
}
elsif ($opt eq 'deviceinfo') {
elsif ($lcopt eq 'deviceinfo') {
return HMCCU_ExecuteGetDeviceInfoCommand ($ioHash, $hash, $ccuaddr, $sc, $sd, $cc, $cd);
}
elsif ($opt =~ /^(config|values|update)$/) {
elsif ($lcopt =~ /^(config|values|update)$/) {
my @addList = ($ccuaddr);
my $devDesc = HMCCU_GetDeviceDesc ($ioHash, $ccuaddr, $ccuif);
return HMCCU_SetError ($hash, "Can't get device description") if (!defined($devDesc));
push @addList, split (',', $devDesc->{CHILDREN});
my $resp = HMCCU_ExecuteGetParameterCommand ($ioHash, $hash, $opt, \@addList);
my $resp = HMCCU_ExecuteGetParameterCommand ($ioHash, $hash, $lcopt, \@addList);
return HMCCU_SetError ($hash, "Can't get device description") if (!defined($resp));
return HMCCU_DisplayGetParameterResult ($ioHash, $hash, $resp);
}
elsif ($opt eq 'paramsetdesc') {
elsif ($lcopt eq 'paramsetdesc') {
$result = HMCCU_ParamsetDescToStr ($ioHash, $hash);
return defined($result) ? $result : HMCCU_SetError ($hash, "Can't get device model");
}
elsif (exists($hash->{hmccu}{roleCmds}{get}{$opt})) {
return HMCCU_ExecuteRoleCommand ($ioHash, $hash, 'get', $opt, $cc, $a, $h);
}
elsif ($opt eq 'defaults') {
$result = HMCCU_GetDefaults ($hash, 0);
return $result;
}
else {
my $retmsg = "HMCCUDEV: Unknown argument $opt, choose one of datapoint";
my @valuelist;
my $valuecount = HMCCU_GetValidDatapoints ($hash, $ccutype, -1, 1, \@valuelist);
$retmsg .= ':'.join(",", @valuelist) if ($valuecount > 0);
$retmsg .= ' defaults:noArg update:noArg config:noArg'.
' paramsetDesc:noArg deviceInfo:noArg values:noArg';
my $retmsg = "HMCCUDEV: Unknown argument $opt, choose one of";
$retmsg .= ' update:noArg config:noArg paramsetDesc:noArg deviceInfo:noArg values:noArg';
my @dpList;
my $dpCount = HMCCU_GetValidDatapoints ($hash, $ccutype, -1, 1, \@dpList);
$retmsg .= ' datapoint:'.join(",", @dpList) if ($dpCount > 0);
$retmsg .= " $cmdList" if ($cmdList ne '');
return $retmsg;
@ -587,12 +599,14 @@ sub HMCCUDEV_Get ($@)
<b>Define</b><br/><br/>
<ul>
<code>define &lt;name&gt; HMCCUDEV {&lt;device&gt; | 'virtual'} [&lt;controlchannel&gt;]
[readonly] [<u>defaults</u>|noDefaults] [{group={device|channel}[,...]|groupexp=regexp]
[readonly] [<u>defaults</u>|noDefaults] [force] {group={device|channel}[,...]|groupexp=regexp]
[iodev=&lt;iodev-name&gt;]</code>
<br/><br/>
If option 'readonly' is specified no set command will be available. With option 'defaults'
some default attributes depending on CCU device type will be set. Default attributes are only
available for some device types. The option is ignored during FHEM start.
Option 'force' must be specified to define a HMCCUDEV device even if the preferred and
recommended type is HMCCUCHN.<br/>
Parameter <i>controlchannel</i> corresponds to attribute 'controlchannel'. If a device
has several identical channels, some commands need to know the channel number for
controlling the device.<br/>
@ -616,8 +630,23 @@ sub HMCCUDEV_Get ($@)
# Group device by using CCU group device and 3 group members<br/>
define heating_living HMCCUDEV GRP-LIV group=WIN-LIV,HEAT-LIV,THERM-LIV
</code>
<br/>
</ul>
<br/><br/>
Internals:<br/>
<ul>
<li>ccuaddr: Address of device in CCU</li>
<li>ccudevstate: State of device in CCU (active/inactive/dead)</li>
<li>ccuif: Interface of device</li>
<li>ccuname: Name of device in CCU</li>
<li>ccurole: Role of device</li>
<li>ccusubtype: Homematic subtype of device (different from ccutype for HmIP devices)</li>
<li>ccutype: Homematic type of device</li>
<li>readonly: Indicates whether FHEM device is writeable</li>
<li>receiver: List of peered devices with role 'receiver'. If no FHEM device exists for a receiver, the
name of the CCU device is displayed preceeded by 'ccu:'</li>
<li>sender: List of peered devices with role 'sender'. If no FHEM device exists for a sender, the
name of the CCU device is displayed preceeded by 'ccu:'</li>
</ul>
</ul>
<br/>
<a name="HMCCUDEVset"></a>

View File

@ -4,7 +4,7 @@
#
# $Id: HMCCUConf.pm 18552 2019-02-10 11:52:28Z zap $
#
# Version 4.8.010
# Version 4.8.015
#
# Configuration parameters for HomeMatic devices.
#
@ -18,6 +18,7 @@ use strict;
use warnings;
use vars qw($HMCCU_CONFIG_VERSION);
use vars qw(%HMCCU_DEF_ROLE);
use vars qw(%HMCCU_STATECONTROL);
use vars qw(%HMCCU_READINGS);
use vars qw(%HMCCU_ROLECMDS);
@ -27,83 +28,97 @@ use vars qw(%HMCCU_CHN_DEFAULTS);
use vars qw(%HMCCU_DEV_DEFAULTS);
use vars qw(%HMCCU_SCRIPTS);
$HMCCU_CONFIG_VERSION = '4.8.010';
$HMCCU_CONFIG_VERSION = '4.8.015';
######################################################################
# Map subtype to default role. Subtype is only available for HMIP
# devices.
# Used by HMCCU to detect control channel of HMCCUDEV devices.
######################################################################
%HMCCU_DEF_ROLE = (
'ASIR' => 'ALARM_SWITCH_VIRTUAL_RECEIVER',
'PSM' => 'SWITCH_VIRTUAL_RECEIVER',
'SD' => 'SMOKE_DETECTOR'
);
######################################################################
# Channel roles with state and control datapoints
# F: 1=Channel/HMCCUCHN, 2=Device/HMCCUDEV, 3=Both
# S: State datapoint, C: Control datapoint, V: Control values
# P: Priority (used by HMCCUDEV if more than 1 channel role fits)
# 1=lowest priority
######################################################################
%HMCCU_STATECONTROL = (
'SHUTTER_CONTACT' => {
F => 3, S => 'STATE', C => '', V => ''
F => 3, S => 'STATE', C => '', V => '', P => 2
},
'SHUTTER_CONTACT_TRANSCEIVER' => {
F => 3, S => 'STATE', C => '', V => ''
F => 3, S => 'STATE', C => '', V => '', P => 2
},
'ROTARY_HANDLE_SENSOR' => {
F => 3, S => 'STATE', C => '', V => ''
F => 3, S => 'STATE', C => '', V => '', P => 2
},
'ROTARY_HANDLE_TRANSCEIVER' => {
F => 3, S => 'STATE', C => '', V => ''
F => 3, S => 'STATE', C => '', V => '', P => 2
},
'ALARM_SWITCH_VIRTUAL_RECEIVER' => {
F => 3, S => 'STATE', C => '', V => ''
F => 3, S => 'ACOUSTIC_ALARM_ACTIVE', C => 'ACOUSTIC_ALARM_SELECTION', V => '', P => 2
},
'SMOKE_DETECTOR' => {
F => 3, S => 'SMOKE_DETECTOR_ALARM_STATUS', C => '', V => ''
F => 3, S => 'SMOKE_DETECTOR_ALARM_STATUS', C => '', V => '', P => 2
},
'LUXMETER' => {
F => 3, S => 'LUX', C => '', V => ''
F => 3, S => 'LUX', C => '', V => '', P => 2
},
'MOTIONDETECTOR_TRANSCEIVER' => {
F => 3, S => 'MOTION', C => 'MOTION_DETECTION_ACTIVE', V => 'on:true,off:false'
F => 3, S => 'MOTION', C => 'MOTION_DETECTION_ACTIVE', V => 'on:true,off:false', P => 2
},
'KEY' => {
F => 3, S => 'PRESS_SHORT', C => 'PRESS_SHORT', V => 'pressed:true'
F => 3, S => 'PRESS_SHORT', C => 'PRESS_SHORT', V => 'pressed:true', P => 1
},
'KEY_TRANSCEIVER' => {
F => 3, S => 'PRESS_SHORT', C => 'PRESS_SHORT', V => 'pressed:true'
F => 3, S => 'PRESS_SHORT', C => 'PRESS_SHORT', V => 'pressed:true', P => 1
},
'VIRTUAL_KEY' => {
F => 3, S => 'PRESS_SHORT', C => 'PRESS_SHORT', V => 'pressed:true'
F => 3, S => 'PRESS_SHORT', C => 'PRESS_SHORT', V => 'pressed:true', P => 1
},
'BLIND' => {
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'open:100,close:0'
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'open:100,close:0', P => 2
},
'BLIND_VIRTUAL_RECEIVER' => {
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'open:100,close:0'
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'open:100,close:0', P => 2
},
'SWITCH' => {
F => 3, S => 'STATE', C => 'STATE', V => 'on:true,off:false'
F => 3, S => 'STATE', C => 'STATE', V => 'on:true,off:false', P => 2
},
'SWITCH_VIRTUAL_RECEIVER' => {
F => 3, S => 'STATE', C => 'STATE', V => 'on:true,off:false'
F => 3, S => 'STATE', C => 'STATE', V => 'on:true,off:false', P => 2
},
'DIMMER' => {
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'on:100,off:0'
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'on:100,off:0', P => 2
},
'DIMMER_VIRTUAL_RECEIVER' => {
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'on:100,off:0'
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'on:100,off:0', P => 2
},
'WEATHER' => {
F => 3, S => 'TEMPERATURE', C => 'TEMPERATURE', V => ''
F => 3, S => 'TEMPERATURE', C => '', V => '', P => 1
},
'WEATHER_TRANSMIT' => {
F => 3, S => 'TEMPERATURE', C => 'TEMPERATURE', V => ''
F => 3, S => 'TEMPERATURE', C => '', V => '', P => 1
},
'CLIMATE_TRANSCEIVER' => {
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'ACTUAL_TEMPERATURE', V => ''
F => 3, S => 'ACTUAL_TEMPERATURE', C => '', V => '', P => 1
},
'THERMALCONTROL_TRANSMIT' => {
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'SET_TEMPERATURE', V => 'on:30.5,off:4.5'
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'SET_TEMPERATURE', V => 'on:30.5,off:4.5', P => 2
},
'CLIMATECONTROL_RT_TRANSCEIVER' => {
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'SET_TEMPERATURE', V => 'on:30.5,off:4.5'
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'SET_TEMPERATURE', V => 'on:30.5,off:4.5', P => 2
},
'HEATING_CLIMATECONTROL_TRANSCEIVER' => {
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'SET_POINT_TEMPERATURE', V => 'on:30.5,off:4.5'
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'SET_POINT_TEMPERATURE', V => 'on:30.5,off:4.5', P => 2
}
);
@ -157,17 +172,22 @@ $HMCCU_CONFIG_VERSION = '4.8.010';
# Set commands related to channel role
# Role => { Command-Definition, ... }
# Command-Defintion:
# Command => 'Datapoint-Definition [...]'
# Command => 'Datapoint-Definition[:Function] [...]'
# Function:
# A Perl function name
# Datapoint-Definition:
# Paramset:Datapoint:[Parameter=]FixedValue[,FixedValue]
# Paramset:Datapoint:?Parameter
# Paramset:Datapoint:?Parameter=Default-Value
# Paramset:Datapoint:#Parameter
# Paramset:Datapoint:*Parameter=Default-Value
# Paramset:
# V=VALUES, M=MASTER (channel), D=MASTER (device)
# If Parameter is preceded by ? any value is accepted.
# If Parameter is preceded by # Datapoint must have type ENUM and
# valid values are taken from parameter set description.
# V=VALUES, M=MASTER (channel), D=MASTER (device), I=INTERNAL
# Parameter characters:
# ? = any value is accepted
# # = datapoint must have type ENUM. Valid values are taken from
# parameter set description.
# * = internal value $hash->{hmccu}{values}{parameterName}
# If Default-Value is preceeded by + or -, value is added to or
# subtracted from current datapoint value
######################################################################
@ -180,6 +200,11 @@ $HMCCU_CONFIG_VERSION = '4.8.010';
'SMOKE_DETECTOR' => {
'command' => 'V:SMOKE_DETECTOR_COMMAND:#command'
},
'ALARM_SWITCH_VIRTUAL_RECEIVER' => {
'opticalAlarm' => 'V:OPTICAL_ALARM_SELECTION:#alarmMode V:ACOUSTIC_ALARM_SELECTION:0 V:DURATION_UNIT:*unit=0 V:DURATION_VALUE:*duration=10',
'acousticAlarm' => 'V:ACOUSTIC_ALARM_SELECTION:#alarmMode V:OPTICAL_ALARM_SELECTION:0 V:DURATION_UNIT:0 V:DURATION_VALUE:10',
'duration' => 'I:DURATION_VALUE:?duration I:DURATION_UNIT:#unit'
},
'KEY' => {
'on' => 'V:PRESS_SHORT:1',
'off' => 'V:PRESS_SHORT:1',
@ -199,44 +224,44 @@ $HMCCU_CONFIG_VERSION = '4.8.010';
'pct' => 'V:LEVEL:?level',
'open' => 'V:LEVEL:100',
'close' => 'V:LEVEL:0',
'up' => 'V:LEVEL:?delta=+10',
'down' => 'V:LEVEL:?delta=-10',
'up' => 'V:LEVEL:?delta=+20',
'down' => 'V:LEVEL:?delta=-20',
'stop' => 'V:STOP:1'
},
'BLIND_VIRTUAL_RECEIVER' => {
'pct' => 'V:LEVEL:?level',
'open' => 'V:LEVEL:100',
'close' => 'V:LEVEL:0',
'up' => 'V:LEVEL:?delta=+10',
'down' => 'V:LEVEL:?delta=-10',
'up' => 'V:LEVEL:?delta=+20',
'down' => 'V:LEVEL:?delta=-20',
'stop' => 'V:STOP:1'
},
'SHUTTER_VIRTUAL_RECEIVER' => {
'pct' => 'V:LEVEL:?level',
'open' => 'V:LEVEL:100',
'close' => 'V:LEVEL:0',
'up' => 'V:LEVEL:?delta=+10',
'down' => 'V:LEVEL:?delta=-10',
'up' => 'V:LEVEL:?delta=+20',
'down' => 'V:LEVEL:?delta=-20',
'stop' => 'V:STOP:1'
},
'SWITCH' => {
'on' => 'V:STATE:1',
'off' => 'V:STATE:0',
'on-for-timer' => 'V:ON_TIME:?duration V:STATE:1',
'on-till' => 'V:ON_TIME:?duration V:STATE:1'
'on-till' => 'V:ON_TIME:?time V:STATE:1'
},
'SWITCH_VIRTUAL_RECEIVER' => {
'on' => 'V:STATE:1',
'off' => 'V:STATE:0',
'on-for-timer' => 'V:ON_TIME:?duration V:STATE:1',
'on-till' => 'V:ON_TIME:?duration V:STATE:1'
'on-till' => 'V:ON_TIME:?time V:STATE:1'
},
'DIMMER' => {
'pct' => 'V:LEVEL:?level V:ON_TIME:?time=0.0 V:RAMP_TIME:?ramp=0.5',
'on' => 'V:LEVEL:100',
'off' => 'V:LEVEL:0',
'on-for-timer' => 'V:ON_TIME:?duration V:STATE:1',
'on-till' => 'V:ON_TIME:?duration V:STATE:1',
'on-till' => 'V:ON_TIME:?time V:STATE:1',
'stop' => 'V:RAMP_STOP:1'
},
'DIMMER_VIRTUAL_RECEIVER' => {
@ -244,7 +269,7 @@ $HMCCU_CONFIG_VERSION = '4.8.010';
'on' => 'V:LEVEL:100',
'off' => 'V:LEVEL:0',
'on-for-timer' => 'V:ON_TIME:?duration V:STATE:1',
'on-till' => 'V:ON_TIME:?duration V:STATE:1'
'on-till' => 'V:ON_TIME:?time V:STATE:1'
},
'THERMALCONTROL_TRANSMIT' => {
'desired-temp' => 'V:SET_TEMPERATURE:?temperature',
@ -279,41 +304,58 @@ $HMCCU_CONFIG_VERSION = '4.8.010';
######################################################################
# Channel roles with attributes
# If key '_none_' exists, role doesn't have default attributes
######################################################################
%HMCCU_ATTR = (
'SHUTTER_CONTACT' => {
'_none_' => ''
},
'SHUTTER_CONTACT_TRANSCEIVER' => {
'_none_' => ''
},
'KEY' => {
'event-on-update-reading' => '.*',
'cmdIcon' => 'press:taster',
'webCmd' => 'press'
},
'KEY_TRANSCEIVER' => {
'event-on-update-reading' => '.*',
'cmdIcon' => 'press:taster',
'webCmd' => 'press'
},
'BLIND' => {
'substexcl' => 'pct',
'cmdIcon' => 'open:fts_shutter_up stop:fts_shutter_manual close:fts_shutter_down',
'webCmd' => 'open:close:stop:pct',
'webCmd' => 'pct:open:close:stop',
'widgetOverride' => 'pct:slider,0,10,100'
},
'BLIND_VIRTUAL_RECEIVER' => {
'substexcl' => 'pct',
'cmdIcon' => 'open:fts_shutter_up stop:fts_shutter_manual close:fts_shutter_down',
'webCmd' => 'open:close:stop:pct',
'webCmd' => 'pct:open:close:stop',
'widgetOverride' => 'pct:slider,0,10,100'
},
'SHUTTER_VIRTUAL_RECEIVER' => {
'substexcl' => 'pct',
'cmdIcon' => 'open:fts_shutter_up stop:fts_shutter_manual close:fts_shutter_down',
'webCmd' => 'open:close:stop:pct',
'webCmd' => 'pct:open:close:stop',
'widgetOverride' => 'pct:slider,0,10,100'
},
'SWITCH' => {
'webCmd' => 'toggle',
'widgetOverride' => 'toggle:uzsuToggle,off,on'
'cmdIcon' => 'on:general_an off:general_aus'
},
'SWITCH_VIRTUAL_RECEIVER' => {
'webCmd' => 'toggle',
'widgetOverride' => 'toggle:uzsuToggle,off,on'
'cmdIcon' => 'on:general_an off:general_aus'
},
'DIMMER' => {
'cmdIcon' => 'on:general_an off:general_aus',
'substexcl' => 'pct',
'webCmd' => 'pct',
'widgetOverride' => 'pct:slider,0,10,100'
},
'DIMMER_VIRTUAL_RECEIVER' => {
'cmdIcon' => 'on:general_an off:general_aus',
'substexcl' => 'pct',
'webCmd' => 'pct',
'widgetOverride' => 'pct:slider,0,10,100'

View File

@ -1,5 +1,5 @@
UPD 2020-11-12_19:39:34 102657 FHEM/88_HMCCURPCPROC.pm
UPD 2020-11-12_19:40:01 76540 FHEM/HMCCUConf.pm
UPD 2020-11-12_19:39:14 39378 FHEM/88_HMCCUCHN.pm
UPD 2020-11-12_19:39:06 302472 FHEM/88_HMCCU.pm
UPD 2020-11-12_19:39:22 30769 FHEM/88_HMCCUDEV.pm
UPD 2020-12-31_11:18:05 102657 FHEM/88_HMCCURPCPROC.pm
UPD 2020-12-31_11:18:05 78208 FHEM/HMCCUConf.pm
UPD 2020-12-31_11:18:05 41583 FHEM/88_HMCCUCHN.pm
UPD 2020-12-31_11:18:05 320619 FHEM/88_HMCCU.pm
UPD 2020-12-31_11:18:05 32244 FHEM/88_HMCCUDEV.pm