2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

HMCCUDEV: added command get devstate

git-svn-id: https://svn.fhem.de/fhem/trunk@9485 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
fhemzap 2015-10-17 16:34:05 +00:00
parent 38fa59d377
commit d7e00777ea

View File

@ -4,7 +4,7 @@
# #
# $Id:$ # $Id:$
# #
# Version 1.0 # Version 1.1
# #
# (c) 2015 zap (zap01 <at> t-online <dot> de) # (c) 2015 zap (zap01 <at> t-online <dot> de)
# #
@ -16,6 +16,7 @@
# set <name> devstate <value> # set <name> devstate <value>
# set <name> <stateval_cmds> # set <name> <stateval_cmds>
# #
# get <name> devstate
# get <name> datapoint <channel>.<datapoint> # get <name> datapoint <channel>.<datapoint>
# get <name> update # get <name> update
# #
@ -219,7 +220,17 @@ sub HMCCUDEV_Get ($@)
my $hmccu_name = $hash->{IODev}->{NAME}; my $hmccu_name = $hash->{IODev}->{NAME};
my $ccudev = $hash->{ccudev}; my $ccudev = $hash->{ccudev};
if ($opt eq 'datapoint') { if ($opt eq 'devstate') {
my $statechannel = AttrVal ($name, 'statechannel', '');
if ($statechannel ne '') {
my $objname = $ccudev.':'.$statechannel;
HMCCU_Get ($hmccu_hash, $hmccu_name, 'devstate', $objname);
}
return undef;
}
elsif ($opt eq 'datapoint') {
my $objname = shift @a; my $objname = shift @a;
if (!defined ($objname) || $objname !~ /^[0-9]+\..*$/) { if (!defined ($objname) || $objname !~ /^[0-9]+\..*$/) {
return HMCCUDEV_SetError ($hash, "Usage: get <device> datapoint <channel>.<datapoint>"); return HMCCUDEV_SetError ($hash, "Usage: get <device> datapoint <channel>.<datapoint>");
@ -243,7 +254,7 @@ sub HMCCUDEV_Get ($@)
} }
} }
else { else {
return "HMCCUDEV: Unknown argument $opt, choose one of datapoint update:noArg"; return "HMCCUDEV: Unknown argument $opt, choose one of devstate:noArg datapoint update:noArg";
} }
} }
@ -281,10 +292,9 @@ sub HMCCUDEV_SetError ($$)
<code>define &lt;name&gt; HMCCUDEV &lt;<i>CCU_Device</i>&gt; [readonly]</code> <code>define &lt;name&gt; HMCCUDEV &lt;<i>CCU_Device</i>&gt; [readonly]</code>
<br/><br/> <br/><br/>
If <i>readonly</i> parameter is specified no set command will be available. If <i>readonly</i> parameter is specified no set command will be available.
<br/> <br/><br/>
Examples: Examples:<br/>
<br/> <code>define window_living HMCCUDEV WIN-LIV-1 readonly</code><br/>
<code>define window_living HMCCUDEV WIN-LIV-1 readonly</code>
<code>define temp_control HMCCUDEV TEMP-CONTROL</code> <code>define temp_control HMCCUDEV TEMP-CONTROL</code>
<br/><br/> <br/><br/>
<i>CCU_Device</i> - Name of device in CCU without channel or datapoint. <i>CCU_Device</i> - Name of device in CCU without channel or datapoint.
@ -306,13 +316,14 @@ sub HMCCUDEV_SetError ($$)
</li><br/> </li><br/>
<li>set &lt;<i>Name</i>&gt; &lt;<i>StateValue</i>&gt; <li>set &lt;<i>Name</i>&gt; &lt;<i>StateValue</i>&gt;
<br/> <br/>
State of a CCU device channel is set to state value. Channel must State of a CCU device channel is set to <i>StateValue</i>. Channel must
be defined as attribute statechannel. State values can be replaced be defined as attribute statechannel. State values can be replaced
by setting attribute stateval. by setting attribute stateval.
<br/><br/> <br/><br/>
Example:<br/>
<code> <code>
attr myswitch statechannel 1 attr myswitch statechannel 1<br/>
attr myswitch stateval on:true,off:false attr myswitch stateval on:true,off:false<br/>
set myswitch on set myswitch on
</code> </code>
</li><br/> </li><br/>
@ -330,9 +341,13 @@ sub HMCCUDEV_SetError ($$)
<b>Get</b><br/> <b>Get</b><br/>
<ul> <ul>
<br/> <br/>
<li>get &lt;<i>Name</i>&gt; devstate
<br/>
Get state of CCU device. Attribute 'statechannel' must be set.
</li><br/>
<li>get &lt;<i>Name</i>&gt; datapoint &lt;<i>Device</i>:<i>Channel</i>.<i>datapoint</i>&gt; <li>get &lt;<i>Name</i>&gt; datapoint &lt;<i>Device</i>:<i>Channel</i>.<i>datapoint</i>&gt;
<br/> <br/>
Get state of a CCU device datapoint. Get value of a CCU device datapoint.
</li><br/> </li><br/>
<li>get &lt;<i>Name</i>&gt; update <li>get &lt;<i>Name</i>&gt; update
<br/> <br/>