From d7e00777ea432801d3a3177417e902ce9ed06549 Mon Sep 17 00:00:00 2001 From: fhemzap <> Date: Sat, 17 Oct 2015 16:34:05 +0000 Subject: [PATCH] HMCCUDEV: added command get devstate git-svn-id: https://svn.fhem.de/fhem/trunk@9485 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/HMCCU/88_HMCCUDEV.pm | 37 ++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/fhem/contrib/HMCCU/88_HMCCUDEV.pm b/fhem/contrib/HMCCU/88_HMCCUDEV.pm index 3b7c19524..16a47ff04 100644 --- a/fhem/contrib/HMCCU/88_HMCCUDEV.pm +++ b/fhem/contrib/HMCCU/88_HMCCUDEV.pm @@ -4,7 +4,7 @@ # # $Id:$ # -# Version 1.0 +# Version 1.1 # # (c) 2015 zap (zap01 t-online de) # @@ -16,6 +16,7 @@ # set devstate # set # +# get devstate # get datapoint . # get update # @@ -219,7 +220,17 @@ sub HMCCUDEV_Get ($@) my $hmccu_name = $hash->{IODev}->{NAME}; 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; if (!defined ($objname) || $objname !~ /^[0-9]+\..*$/) { return HMCCUDEV_SetError ($hash, "Usage: get datapoint ."); @@ -243,7 +254,7 @@ sub HMCCUDEV_Get ($@) } } 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 ($$) define <name> HMCCUDEV <CCU_Device> [readonly]

If readonly parameter is specified no set command will be available. -
- Examples: -
- define window_living HMCCUDEV WIN-LIV-1 readonly +

+ Examples:
+ define window_living HMCCUDEV WIN-LIV-1 readonly
define temp_control HMCCUDEV TEMP-CONTROL

CCU_Device - Name of device in CCU without channel or datapoint. @@ -306,13 +316,14 @@ sub HMCCUDEV_SetError ($$)
  • set <Name> <StateValue>
    - State of a CCU device channel is set to state value. Channel must + State of a CCU device channel is set to StateValue. Channel must be defined as attribute statechannel. State values can be replaced by setting attribute stateval.

    + Example:
    - attr myswitch statechannel 1 - attr myswitch stateval on:true,off:false + attr myswitch statechannel 1
    + attr myswitch stateval on:true,off:false
    set myswitch on

  • @@ -330,9 +341,13 @@ sub HMCCUDEV_SetError ($$) Get

      +
    • get <Name> devstate +
      + Get state of CCU device. Attribute 'statechannel' must be set. +

    • get <Name> datapoint <Device:Channel.datapoint>
      - Get state of a CCU device datapoint. + Get value of a CCU device datapoint.

    • get <Name> update