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:
parent
38fa59d377
commit
d7e00777ea
@ -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 <name> HMCCUDEV <<i>CCU_Device</i>> [readonly]</code>
|
<code>define <name> HMCCUDEV <<i>CCU_Device</i>> [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 <<i>Name</i>> <<i>StateValue</i>>
|
<li>set <<i>Name</i>> <<i>StateValue</i>>
|
||||||
<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 <<i>Name</i>> devstate
|
||||||
|
<br/>
|
||||||
|
Get state of CCU device. Attribute 'statechannel' must be set.
|
||||||
|
</li><br/>
|
||||||
<li>get <<i>Name</i>> datapoint <<i>Device</i>:<i>Channel</i>.<i>datapoint</i>>
|
<li>get <<i>Name</i>> datapoint <<i>Device</i>:<i>Channel</i>.<i>datapoint</i>>
|
||||||
<br/>
|
<br/>
|
||||||
Get state of a CCU device datapoint.
|
Get value of a CCU device datapoint.
|
||||||
</li><br/>
|
</li><br/>
|
||||||
<li>get <<i>Name</i>> update
|
<li>get <<i>Name</i>> update
|
||||||
<br/>
|
<br/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user