mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
HMCCU: Version 3.9.001
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@13300 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ff2808e462
commit
b32f0cbaac
1
CHANGED
1
CHANGED
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- update: 88_HMCCU.pm: version 3.9.001 with minor changes
|
||||
- update: 98_DOIFtools: add attribute to move event monitor directly above
|
||||
readings section in detail view of DOIF
|
||||
- update: 93_DbLog: update to version 2.11.1, solves some issues since
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Version 3.9
|
||||
# Version 3.9.001
|
||||
#
|
||||
# Module for communication between FHEM and Homematic CCU2.
|
||||
# Supports BidCos-RF, BidCos-Wired, HmIP-RF, virtual CCU channels,
|
||||
@ -56,6 +56,7 @@
|
||||
# attr <name> ccutrace {<ccudevname_exp>|<ccudevaddr_exp>}
|
||||
# attr <name> parfile <parfile>
|
||||
# attr <name> rpcevtimeout <seconds>
|
||||
# attr <name> rpcinterfaces { BidCos-Wired, BidCos-RF, HmIP-RF, VirtualDevices, Homegear }
|
||||
# attr <name> rpcinterval <seconds>
|
||||
# attr <name> rpcport <ccu_rpc_port>
|
||||
# attr <name> rpcqueue <file>
|
||||
@ -103,9 +104,13 @@ my %HMCCU_CUST_CHN_DEFAULTS;
|
||||
my %HMCCU_CUST_DEV_DEFAULTS;
|
||||
|
||||
# HMCCU version
|
||||
my $HMCCU_VERSION = '3.9';
|
||||
my $HMCCU_VERSION = '3.9.001';
|
||||
|
||||
# RPC Ports and URL extensions
|
||||
my %HMCCU_RPC_NUMPORT = (
|
||||
2000 => 'BidCos-Wired', 2001 => 'BidCos-RF', 2010 => 'HmIP-RF', 9292 => 'VirtualDevices',
|
||||
2003 => 'Homegear'
|
||||
);
|
||||
my %HMCCU_RPC_PORT = (
|
||||
'BidCos-Wired', 2000, 'BidCos-RF', 2001, 'HmIP-RF', 2010, 'VirtualDevices', 9292,
|
||||
'Homegear', 2003
|
||||
@ -302,7 +307,7 @@ sub HMCCU_Initialize ($)
|
||||
$hash->{ShutdownFn} = "HMCCU_Shutdown";
|
||||
$hash->{parseParams} = 1;
|
||||
|
||||
$hash->{AttrList} = "stripchar stripnumber ccuackstate:0,1 ccuaggregate:textField-long ccudefaults ccudef-hmstatevals:textField-long ccudef-substitute:textField-long ccudef-readingname:textField-long ccudef-readingfilter:textField-long ccudef-readingformat:name,namelc,address,addresslc,datapoint,datapointlc ccuflags:multiple-strict,intrpc,dptnocheck,noagg,nohmstate ccureadings:0,1 ccureadingfilter ccureadingformat:name,namelc,address,addresslc,datapoint,datapointlc rpcinterval:2,3,5,7,10 rpcqueue rpcport:multiple-strict,2000,2001,2003,2010,9292 rpcserver:on,off rpcserveraddr rpcserverport rpctimeout rpcevtimeout parfile substitute ccutrace ccuget:Value,State ". $readingFnAttributes;
|
||||
$hash->{AttrList} = "stripchar stripnumber ccuackstate:0,1 ccuaggregate:textField-long ccudefaults rpcinterfaces:multiple-strict,".join(',',sort keys %HMCCU_RPC_PORT)." ccudef-hmstatevals:textField-long ccudef-substitute:textField-long ccudef-readingname:textField-long ccudef-readingfilter:textField-long ccudef-readingformat:name,namelc,address,addresslc,datapoint,datapointlc ccuflags:multiple-strict,intrpc,dptnocheck,noagg,nohmstate ccureadings:0,1 ccureadingfilter ccureadingformat:name,namelc,address,addresslc,datapoint,datapointlc rpcinterval:2,3,5,7,10 rpcqueue rpcport:multiple-strict,".join(',',sort keys %HMCCU_RPC_NUMPORT)." rpcserver:on,off rpcserveraddr rpcserverport rpctimeout rpcevtimeout parfile substitute ccutrace ccuget:Value,State ". $readingFnAttributes;
|
||||
}
|
||||
|
||||
##################################################
|
||||
@ -339,6 +344,7 @@ sub HMCCU_Define ($$)
|
||||
$hash->{hmccu}{evtimeout} = 0;
|
||||
$hash->{hmccu}{updatetime} = 0;
|
||||
$hash->{hmccu}{rpccount} = 0;
|
||||
$hash->{hmccu}{rpcports} = '2001';
|
||||
|
||||
readingsBeginUpdate ($hash);
|
||||
readingsBulkUpdate ($hash, "state", "Initialized");
|
||||
@ -374,11 +380,36 @@ sub HMCCU_Attr ($@)
|
||||
$rc = HMCCU_AggregationRules ($hash, $attrval);
|
||||
return HMCCU_SetError ($hash, "Syntax error in attribute ccuaggregate") if ($rc == 0);
|
||||
}
|
||||
elsif ($attrname eq 'rpcinterfaces') {
|
||||
my @ports = split (',', $attrval);
|
||||
my @plist = ();
|
||||
foreach my $p (@ports) {
|
||||
return "Illegal RPC interface $p" if (!exists ($HMCCU_RPC_PORT{$p}));
|
||||
push (@plist, $HMCCU_RPC_PORT{$p});
|
||||
}
|
||||
return "No RPC interface specified" if (scalar (@plist) == 0);
|
||||
$hash->{hmccu}{rpcports} = join (',', @plist);
|
||||
$attr{$name}{"rpcport"} = $hash->{hmccu}{rpcports};
|
||||
}
|
||||
elsif ($attrname eq 'rpcport') {
|
||||
my @ports = split (',', $attrval);
|
||||
my @ilist = ();
|
||||
foreach my $p (@ports) {
|
||||
return "Illegal RPC port $p" if (!exists ($HMCCU_RPC_NUMPORT{$p}));
|
||||
push (@ilist, $HMCCU_RPC_NUMPORT{$p});
|
||||
}
|
||||
return "No RPC port specified" if (scalar (@ilist) == 0);
|
||||
$hash->{hmccu}{rpcports} = $attrval;
|
||||
$attr{$name}{"rpcinterfaces"} = join (',', @ilist);
|
||||
}
|
||||
}
|
||||
elsif ($cmd eq 'del') {
|
||||
if ($attrname eq 'ccuaggregate') {
|
||||
HMCCU_AggregationRules ($hash, '');
|
||||
}
|
||||
elsif ($attrname eq 'rpcport' || $attrname eq 'rpcinterfaces') {
|
||||
$hash->{hmccu}{rpcports} = '2001';
|
||||
}
|
||||
}
|
||||
|
||||
return undef;
|
||||
@ -1115,7 +1146,8 @@ sub HMCCU_Get ($@)
|
||||
my $parfile = AttrVal ($name, "parfile", '');
|
||||
# my ($sc, $statedatapoint, $cc, $cd) = HMCCU_GetSpecialDatapoints ($hash, '', 'STATE', '', '');
|
||||
# my $substitute = AttrVal ($name, 'substitute', '');
|
||||
my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
# my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
my $rpcport = $hash->{hmccu}{rpcports};
|
||||
|
||||
my $readname;
|
||||
my $readaddr;
|
||||
@ -1469,7 +1501,7 @@ sub HMCCU_ParseObject ($$$)
|
||||
$f = $HMCCU_FLAG_ADDRESS;
|
||||
$a = $1;
|
||||
}
|
||||
elsif ($object =~ /^(.+?)\.(.+)$/) {
|
||||
elsif ($object =~ /^(.+?)\.([A-Z_]+)$/) {
|
||||
#
|
||||
# Name.Datapoint
|
||||
#
|
||||
@ -1668,7 +1700,7 @@ sub HMCCU_GetReadingName ($$$$$$$)
|
||||
# 0 = Preserve all digits
|
||||
# 1 = Preserve 1 digit
|
||||
# 2 = Remove trailing zeroes
|
||||
# -n = Round value to specified number of digits
|
||||
# -n = Round value to specified number of digits (-0 is valid)
|
||||
######################################################################
|
||||
|
||||
sub HMCCU_FormatReadingValue ($$)
|
||||
@ -1692,9 +1724,9 @@ sub HMCCU_FormatReadingValue ($$)
|
||||
return $value;
|
||||
}
|
||||
|
||||
##################################################################
|
||||
######################################################################
|
||||
# Set error state and write log file message
|
||||
##################################################################
|
||||
######################################################################
|
||||
|
||||
sub HMCCU_SetError ($$)
|
||||
{
|
||||
@ -1857,8 +1889,9 @@ sub HMCCU_SubstVariables ($$)
|
||||
foreach my $dp (keys %{$clhash->{hmccu}{dp}}) {
|
||||
my ($chn,$dpt) = split (/\./, $dp);
|
||||
if (defined ($clhash->{hmccu}{dp}{$dp}{VAL})) {
|
||||
$text =~ s/\$\{$dp\}/$clhash->{hmccu}{dp}{$dp}{VAL}/g;
|
||||
$text =~ s/\$\{$dpt\}/$clhash->{hmccu}{dp}{$dp}{VAL}/g;
|
||||
my $value = HMCCU_FormatReadingValue ($clhash, $clhash->{hmccu}{dp}{$dp}{VAL});
|
||||
$text =~ s/\$\{$dp\}/$value/g;
|
||||
$text =~ s/\$\{$dpt\}/$value/g;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2124,7 +2157,8 @@ sub HMCCU_RPCRegisterCallback ($)
|
||||
my $serveraddr = $hash->{host};
|
||||
my $localaddr = $hash->{hmccu}{localaddr};
|
||||
|
||||
my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
# my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
my $rpcport = $hash->{hmccu}{rpcports};
|
||||
my $rpcinterval = AttrVal ($name, 'rpcinterval', $HMCCU_INIT_INTERVAL2);
|
||||
my $rpcserveraddr = AttrVal ($name, 'rpcserveraddr', $localaddr);
|
||||
my $ccuflags = AttrVal ($name, 'ccuflags', 'null');
|
||||
@ -2207,7 +2241,8 @@ sub HMCCU_StartExtRPCServer ($)
|
||||
my $modpath = AttrVal ('global', 'modpath', '/opt/fhem');
|
||||
my $logfile = $modpath."/log/ccurpcd";
|
||||
my $rpcqueue = AttrVal ($name, 'rpcqueue', '/tmp/ccuqueue');
|
||||
my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
# my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
my $rpcport = $hash->{hmccu}{rpcports};
|
||||
my $rpcserverport = AttrVal ($name, 'rpcserverport', 5400);
|
||||
my $rpcinterval = AttrVal ($name, 'rpcinterval', $HMCCU_INIT_INTERVAL1);
|
||||
my $verbose = AttrVal ($name, 'verbose', -1);
|
||||
@ -2339,7 +2374,8 @@ sub HMCCU_StartIntRPCServer ($)
|
||||
|
||||
# Address and ports
|
||||
my $rpcqueue = AttrVal ($name, 'rpcqueue', '/tmp/ccuqueue');
|
||||
my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
# my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
my $rpcport = $hash->{hmccu}{rpcports};
|
||||
my $rpcserverport = AttrVal ($name, 'rpcserverport', 5400);
|
||||
my $rpcinterval = AttrVal ($name, 'rpcinterval', $HMCCU_INIT_INTERVAL1);
|
||||
my @rpcportlist = split (",", $rpcport);
|
||||
@ -2450,7 +2486,8 @@ sub HMCCU_StopRPCServer ($)
|
||||
my $pid = 0;
|
||||
|
||||
my $ccuflags = AttrVal ($name, 'ccuflags', 'null');
|
||||
my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
# my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
my $rpcport = $hash->{hmccu}{rpcports};
|
||||
my $serveraddr = $hash->{host};
|
||||
|
||||
# Deregister callback URLs in CCU
|
||||
@ -3806,7 +3843,8 @@ sub HMCCU_ReadRPCQueue ($)
|
||||
my $ccuflags = AttrVal ($name, 'ccuflags', 'null');
|
||||
my $rpcinterval = AttrVal ($name, 'rpcinterval', 5);
|
||||
my $rpcqueue = AttrVal ($name, 'rpcqueue', '/tmp/ccuqueue');
|
||||
my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
# my $rpcport = AttrVal ($name, 'rpcport', 2001);
|
||||
my $rpcport = $hash->{hmccu}{rpcports};
|
||||
my $rpctimeout = AttrVal ($name, 'rpcevtimeout', 300);
|
||||
my $maxevents = $rpcinterval*10;
|
||||
$maxevents = 50 if ($maxevents > 50);
|
||||
@ -4987,7 +5025,7 @@ sub HMCCU_AggReadings ($$$$$)
|
||||
|
||||
sub HMCCU_GetTimeSpec ($)
|
||||
{
|
||||
my $ts = @_;
|
||||
my ($ts) = @_;
|
||||
|
||||
return -1 if ($ts !~ /^[0-9]{2}:[0-9]{2}$/ && $ts !~ /^[0-9]{2}:[0-9]{2}:[0-9]{2}$/);
|
||||
|
||||
@ -5570,7 +5608,7 @@ sub HMCCU_CCURPC_GetEventsCB ($$)
|
||||
For automatic update of Homematic device datapoints and FHEM readings one have to:
|
||||
<br/><br/>
|
||||
<ul>
|
||||
<li>Define used RPC interfaces with attribute 'rpcport'</li>
|
||||
<li>Define used RPC interfaces with attribute 'rpcinterfaces'</li>
|
||||
<li>Start RPC servers with command 'set rpcserver on'</li>
|
||||
<li>Optionally enable automatic start of RPC servers with attribute 'rpcserver'</li>
|
||||
</ul><br/>
|
||||
@ -5615,7 +5653,7 @@ sub HMCCU_CCURPC_GetEventsCB ($$)
|
||||
</li><br/>
|
||||
<li><b>set <name> rpcserver {on | off | restart}</b><br/>
|
||||
Start, stop or restart RPC server(s). This command executed with option 'on'
|
||||
will fork a RPC server process for each RPC port defined in attribute 'rpcport'.
|
||||
will fork a RPC server process for each RPC interface defined in attribute 'rpcinterfaces'.
|
||||
Until operation is completed only a few set/get commands are available and you
|
||||
may get the error message 'CCU busy'.
|
||||
</li><br/>
|
||||
@ -5798,11 +5836,23 @@ sub HMCCU_CCURPC_GetEventsCB ($$)
|
||||
<li><b>parfile <filename></b><br/>
|
||||
Define parameter file for command 'get parfile'.
|
||||
</li><br/>
|
||||
<li><b>rpcinterfaces <interface>[,...]</b><br/>
|
||||
Specify list of CCU RPC interfaces. HMCCU will register a RPC server for each interface.
|
||||
Valid interfaces are:<br/><br/>
|
||||
<ul>
|
||||
<li>BidCos-Wired (Port 2000)</li>
|
||||
<li>BidCos-RF (Port 2001)</li>
|
||||
<li>Homegear (Port 2003)</li>
|
||||
<li>HmIP (Port 2010)</li>
|
||||
<li>VirtualDevice (Port 9292)</li>
|
||||
</ul>
|
||||
</li><br/>
|
||||
<li><b>rpcinterval <Seconds></b><br/>
|
||||
Specifiy how often RPC queue is read. Default is 5 seconds.
|
||||
</li><br/>
|
||||
<li><b>rpcport <value[,...]></b><br/>
|
||||
Specify list of RPC ports on CCU. Default is 2001. Valid RPC ports are:<br/><br/>
|
||||
Deprecated, use 'rpcinterfaces' instead. Specify list of RPC ports on CCU. Default is
|
||||
2001. Valid RPC ports are:<br/><br/>
|
||||
<ul>
|
||||
<li>2000 = Wired components</li>
|
||||
<li>2001 = BidCos-RF (wireless 868 MHz components with BidCos protocol)</li>
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Version 3.9
|
||||
# Version 3.9.001
|
||||
#
|
||||
# (c) 2016 zap (zap01 <at> t-online <dot> de)
|
||||
#
|
||||
@ -13,7 +13,7 @@
|
||||
# define <name> HMCCUCHN <ccudev> [readonly] [defaults]
|
||||
# [iodev=<iodevname>]
|
||||
#
|
||||
# set <name> config <parameter>=<value> [...]
|
||||
# set <name> config [device] <parameter>=<value> [...]
|
||||
# set <name> control <value>
|
||||
# set <name> datapoint <datapoint> <value>
|
||||
# set <name> defaults
|
||||
@ -24,11 +24,12 @@
|
||||
# set <name> pct <level> [{ <ontime> | 0 } [<ramptime>]]
|
||||
# set <name> toggle
|
||||
#
|
||||
# get <name> config [<filter-expr>]
|
||||
# get <name> configdesc
|
||||
# get <name> configlist
|
||||
# get <name> config [device] [<filter-expr>]
|
||||
# get <name> configdesc [device]
|
||||
# get <name> configlist [device] [<filtet-expr>]
|
||||
# get <name> datapoint <datapoint>
|
||||
# get <name> defaults
|
||||
# get <name> deviceinfo
|
||||
# get <name> devstate
|
||||
# get <name> update
|
||||
#
|
||||
@ -407,10 +408,15 @@ sub HMCCUCHN_Set ($@)
|
||||
}
|
||||
}
|
||||
elsif ($opt eq 'config') {
|
||||
return HMCCU_SetError ($hash, "Usage: set $name config {parameter}={value} [...]")
|
||||
return HMCCU_SetError ($hash, "Usage: set $name config [device] {parameter}={value} [...]")
|
||||
if ((scalar keys %{$h}) < 1);
|
||||
|
||||
my $rc = HMCCU_RPCSetConfig ($hash, $ccuaddr, $h);
|
||||
my $ccuobj = $ccuaddr;
|
||||
my $par = shift @$a;
|
||||
if (defined ($par) && $par eq 'device') {
|
||||
($ccuobj, undef) = HMCCU_SplitChnAddr ($ccuaddr);
|
||||
}
|
||||
my $rc = HMCCU_RPCSetConfig ($hash, $ccuobj, $h);
|
||||
return HMCCU_SetError ($hash, $rc) if ($rc < 0);
|
||||
HMCCU_SetState ($hash, "OK");
|
||||
return undef;
|
||||
@ -521,6 +527,12 @@ sub HMCCUCHN_Get ($@)
|
||||
elsif ($opt eq 'config') {
|
||||
my $ccuobj = $ccuaddr;
|
||||
my $par = shift @$a;
|
||||
if (defined ($par)) {
|
||||
if ($par eq 'device') {
|
||||
($ccuobj, undef) = HMCCU_SplitChnAddr ($ccuaddr);
|
||||
$par = shift @$a;
|
||||
}
|
||||
}
|
||||
$par = '.*' if (!defined ($par));
|
||||
|
||||
my ($rc, $res) = HMCCU_RPCGetConfig ($hash, $ccuobj, "getParamset", $par);
|
||||
@ -530,6 +542,12 @@ sub HMCCUCHN_Get ($@)
|
||||
elsif ($opt eq 'configlist') {
|
||||
my $ccuobj = $ccuaddr;
|
||||
my $par = shift @$a;
|
||||
if (defined ($par)) {
|
||||
if ($par eq 'device') {
|
||||
($ccuobj, undef) = HMCCU_SplitChnAddr ($ccuaddr);
|
||||
$par = shift @$a;
|
||||
}
|
||||
}
|
||||
$par = '.*' if (!defined ($par));
|
||||
|
||||
my ($rc, $res) = HMCCU_RPCGetConfig ($hash, $ccuobj, "listParamset", $par);
|
||||
@ -538,6 +556,10 @@ sub HMCCUCHN_Get ($@)
|
||||
}
|
||||
elsif ($opt eq 'configdesc') {
|
||||
my $ccuobj = $ccuaddr;
|
||||
my $par = shift @$a;
|
||||
if (defined ($par) && $par eq 'device') {
|
||||
($ccuobj, undef) = HMCCU_SplitChnAddr ($ccuaddr);
|
||||
}
|
||||
|
||||
my ($rc, $res) = HMCCU_RPCGetConfig ($hash, $ccuobj, "getParamsetDescription", undef);
|
||||
return HMCCU_SetError ($hash, $rc) if ($rc < 0);
|
||||
@ -633,10 +655,11 @@ sub HMCCUCHN_SetError ($$)
|
||||
Delete readings matching specified reading name expression. Default expression is '.*'.
|
||||
Readings 'state' and 'control' are not deleted.
|
||||
</li><br/>
|
||||
<li><b>set <name> config [<rpcport>] <parameter>=<value>]
|
||||
<li><b>set <name> config [device] [<rpcport>] <parameter>=<value>]
|
||||
[...]</b><br/>
|
||||
Set config parameters of CCU channel. This is equal to setting device parameters in CCU.
|
||||
Valid parameters can be listed by using command 'get configdesc'.
|
||||
Valid parameters can be listed by using commands 'get configdesc' or 'get configlist'.
|
||||
With option 'device' specified parameters are set in device instead of channel.
|
||||
</li><br/>
|
||||
<li><b>set <name> datapoint <datapoint> <value></b><br/>
|
||||
Set value of a datapoint of a CCU channel. If parameter <i>value</i> contains special
|
||||
@ -719,16 +742,19 @@ sub HMCCUCHN_SetError ($$)
|
||||
<a name="HMCCUCHNget"></a>
|
||||
<b>Get</b><br/><br/>
|
||||
<ul>
|
||||
<li><b>get <name> config [<filter-expr>]</b><br/>
|
||||
<li><b>get <name> config [device] [<filter-expr>]</b><br/>
|
||||
Get configuration parameters of CCU channel. If attribute 'ccureadings' is 0 results
|
||||
are displayed in browser window. Parameters can be filtered by <i>filter-expr</i>.
|
||||
Parameters to be stored as readings must be part of 'ccureadingfilter'. If option
|
||||
'device' is specified parameters of device are read.
|
||||
</li><br/>
|
||||
<li><b>get <name> configdesc</b><br/>
|
||||
Get description of configuration parameters of CCU channel.
|
||||
<li><b>get <name> configdesc [device]</b><br/>
|
||||
Get description of configuration parameters of CCU channel or device if option 'device'
|
||||
is specified.
|
||||
</li><br/>
|
||||
<li><b>get <name> configlist [<filter-expr>]</b><br/>
|
||||
<li><b>get <name> configlist [device] [<filter-expr>]</b><br/>
|
||||
Get configuration parameters of CCU channel. Parameters can be filtered by
|
||||
<i>filter-expr</i>.
|
||||
<i>filter-expr</i>. With option 'device' device parameters are listed.
|
||||
</li><br/>
|
||||
<li><b>get <name> datapoint <datapoint></b><br/>
|
||||
Get value of a CCU channel datapoint.
|
||||
@ -898,8 +924,9 @@ sub HMCCUCHN_SetError ($$)
|
||||
<li><b>substitute <subst-rule>[;...]</b><br/>
|
||||
Define substitutions for datapoint/reading values. Syntax of <i>subst-rule</i> is<br/><br/>
|
||||
[[<channelno.>]<datapoint>[,...]!]<{#n1-m1|regexp}>:<text>[,...]
|
||||
<br/>
|
||||
Parameter text can contain variables in format ${<i>varname</i>}. The variable $value is
|
||||
<br/><br/>
|
||||
Parameter <i>text</i> can contain variables in format ${<i>varname</i>}. The variable
|
||||
${value} is
|
||||
substituted by the original datapoint value. All other variables must match with a valid
|
||||
datapoint name or a combination of channel number and datapoint name seperated by a '.'.
|
||||
<br/><br/>
|
||||
|
@ -290,8 +290,20 @@ sub HMCCUDEV_Set ($@)
|
||||
my $objname = shift @$a;
|
||||
my $objvalue = shift @$a;
|
||||
|
||||
if ($ccutype eq 'HM-Dis-EP-WM55' && !defined ($objvalue)) {
|
||||
$objvalue = '';
|
||||
foreach my $t (keys %{$h}) {
|
||||
if ($objvalue eq '') {
|
||||
$objvalue = $t.'='.$h->{$t};
|
||||
}
|
||||
else {
|
||||
$objvalue .= ','.$t.'='.$h->{$t};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return HMCCU_SetError ($hash, "Usage: set $name datapoint [{channel-number}.]{datapoint} {value}")
|
||||
if (!defined ($objname) || !defined ($objvalue));
|
||||
if (!defined ($objname) || !defined ($objvalue) || $objvalue eq '');
|
||||
|
||||
if ($objname =~ /^([0-9]+)\..+$/) {
|
||||
my $chn = $1;
|
||||
|
@ -166,6 +166,21 @@ use vars qw(%HMCCU_DEV_DEFAULTS);
|
||||
statevals => "on:true,off:false",
|
||||
substitute => "STATE!(1|true):on,(0|false):off"
|
||||
},
|
||||
"HM-LC-Bl1PBU-FM|HM-LC-Bl1-FM|HM-LC-Bl1-SM|HM-LC-BlX|HM-LC-Bl1-SM-2|HM-LC-Bl1-FM-2" => {
|
||||
_description => "Jalousienaktor",
|
||||
_channels => "1",
|
||||
ccureadingfilter => "(LEVEL|INHIBIT|DIRECTION|WORKING)",
|
||||
ccuscaleval => "LEVEL:0:1:0:100",
|
||||
cmdIcon => "up:fts_shutter_up stop:fts_shutter_manual down:fts_shutter_down",
|
||||
controldatapoint => "LEVEL",
|
||||
eventMap => "/datapoint STOP true:stop/datapoint LEVEL 0:down/datapoint LEVEL 100:up/",
|
||||
statedatapoint => "LEVEL",
|
||||
stripnumber => 1,
|
||||
substexcl => "control",
|
||||
substitute => "LEVEL!#0-0:closed,#100-100:open;DIRECTION!0:stop,1:up,2:down,3:undefined;WORKING!(0|false):no,(1|true):yes",
|
||||
webCmd => "control:up:stop:down",
|
||||
widgetOverride => "control:slider,0,10,100"
|
||||
},
|
||||
"HM-WDS40-TH-I|HM-WDS10-TH-O|HM-WDS20-TH-O|IS-WDS-TH-OD-S-R3|ASH550I|ASH550" => {
|
||||
_description => "Temperatur/Luftfeuchte Sensor",
|
||||
_channels => "1",
|
||||
@ -326,9 +341,9 @@ use vars qw(%HMCCU_DEV_DEFAULTS);
|
||||
},
|
||||
"HMIP-PSM" => {
|
||||
_description => "Steckdose mit Energiemessung IP",
|
||||
ccureadingfilter => "(STATE|CURRENT|ENERGY_COUNTER|POWER)",
|
||||
ccureadingfilter => "(STATE|CURRENT|^ENERGY_COUNTER$|POWER)",
|
||||
controldatapoint => "3.STATE",
|
||||
statedatapoin => "3.STATE",
|
||||
statedatapoint => "3.STATE",
|
||||
statevals => "on:true,off:false",
|
||||
stripnumber => 1,
|
||||
substitute => "STATE!(true|1):on,(false|0):off",
|
||||
@ -400,16 +415,16 @@ use vars qw(%HMCCU_DEV_DEFAULTS);
|
||||
substitute => "STATE!(1|true):on,(0|false):off"
|
||||
},
|
||||
"HM-LC-Bl1PBU-FM|HM-LC-Bl1-FM|HM-LC-Bl1-SM|HM-LC-BlX|HM-LC-Bl1-SM-2|HM-LC-Bl1-FM-2" => {
|
||||
_description => "Jalousieaktor",
|
||||
ccureadingfilter => "(LEVEL|INHIBIT|DIRECTION)",
|
||||
_description => "Jalousienaktor",
|
||||
ccureadingfilter => "(LEVEL|INHIBIT|DIRECTION|WORKING)",
|
||||
ccuscaleval => "LEVEL:0:1:0:100",
|
||||
cmdIcon => "up:fts_shutter_up stop:fts_shutter_manual down:fts_shutter_down",
|
||||
controldatapoint => "1.LEVEL",
|
||||
eventMap => "/datapoint 1.STOP 1:stop/datapoint 1.LEVEL 0:down/datapoint 1.LEVEL 100:up/datapoint 1.STOP true:stop/",
|
||||
eventMap => "/datapoint 1.STOP true:stop/datapoint 1.LEVEL 0:down/datapoint 1.LEVEL 100:up/",
|
||||
statedatapoint => "1.LEVEL",
|
||||
stripnumber => 1,
|
||||
substexcl => "control",
|
||||
substitute => "LEVEL!#0-0:closed,#100-100:open;DIRECTION!0:none,1:up,2:down,3:undefined",
|
||||
substitute => "LEVEL!#0-0:closed,#100-100:open;DIRECTION!0:none,1:up,2:down,3:undefined;WORKING!(0|false):no,(1|true):yes",
|
||||
webCmd => "control:up:stop:down",
|
||||
widgetOverride => "control:slider,0,10,100"
|
||||
},
|
||||
@ -590,7 +605,10 @@ use vars qw(%HMCCU_DEV_DEFAULTS);
|
||||
"HM-Dis-EP-WM55|HM-Dis-WM55" => {
|
||||
_description => "E-Paper Display, Display Statusanzeige",
|
||||
ccureadingfilter => "PRESS",
|
||||
substitute => "PRESS_LONG,PRESS_SHORT,PRESS_CONT!(1|true):pressed,(0|false):notPressed;PRESS_LONG_RELEASE!(1|true):release"
|
||||
eventMap => "/datapoint 3.SUBMIT:display/",
|
||||
substitute => "PRESS_LONG,PRESS_SHORT,PRESS_CONT!(1|true):pressed,(0|false):notPressed;PRESS_LONG_RELEASE!(1|true):release",
|
||||
widgetOverride => "display:textField"
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user