diff --git a/fhem/contrib/HMCCU/FHEM/88_HMCCU.pm b/fhem/contrib/HMCCU/FHEM/88_HMCCU.pm index 48b5ee703..ae5cc5f76 100644 --- a/fhem/contrib/HMCCU/FHEM/88_HMCCU.pm +++ b/fhem/contrib/HMCCU/FHEM/88_HMCCU.pm @@ -57,7 +57,7 @@ my %HMCCU_CUST_CHN_DEFAULTS; my %HMCCU_CUST_DEV_DEFAULTS; # HMCCU version -my $HMCCU_VERSION = '5.0'; +my $HMCCU_VERSION = '5.0 212691835'; # Timeout for CCU requests (seconds) my $HMCCU_TIMEOUT_REQUEST = 4; @@ -193,7 +193,7 @@ sub HMCCU_SubstVariables ($$$); # Update client device readings sub HMCCU_BulkUpdate ($$$;$); -sub HMCCU_GetUpdate ($$$); +sub HMCCU_GetUpdate ($$;$$); sub HMCCU_RefreshReadings ($); sub HMCCU_UpdateCB ($$$); sub HMCCU_UpdateClients ($$$$;$$); @@ -9093,12 +9093,14 @@ sub HMCCU_SetVariable ($$$$$) # Update all datapoints / readings of device or channel considering # attribute ccureadingfilter. # Parameter $ccuget can be 'State', 'Value' or 'Attr'. -# Return 1 on success, <= 0 on error +# Return 1 on success, < 0 on error ###################################################################### -sub HMCCU_GetUpdate ($$$) +sub HMCCU_GetUpdate ($$;$$) { - my ($clHash, $addr, $ccuget) = @_; + my ($clHash, $addr, $filter, $ccuget) = @_; + $filter //= '.*'; + $ccuget //= 'Value'; my $name = $clHash->{NAME}; my $type = $clHash->{TYPE}; @@ -9140,7 +9142,7 @@ sub HMCCU_GetUpdate ($$$) if (HMCCU_IsFlag ($ioHash->{NAME}, 'nonBlocking')) { # Non blocking request HMCCU_HMScriptExt ($ioHash, $script, { list => $list, ccuget => $ccuget }, - \&HMCCU_UpdateCB); + \&HMCCU_UpdateCB, { filter => $filter }); return 1; } @@ -9151,7 +9153,7 @@ sub HMCCU_GetUpdate ($$$) "Script response = \n".$response); return -2 if ($response eq '' || $response =~ /^ERROR:.*/); - HMCCU_UpdateCB ({ ioHash => $ioHash }, undef, $response); + HMCCU_UpdateCB ({ ioHash => $ioHash, filter => $filter }, undef, $response); return 1; } @@ -9173,6 +9175,7 @@ sub HMCCU_UpdateCB ($$$) } my $hash = $param->{ioHash}; + my $filter = $param->{filter} // '.*'; my $logcount = exists($param->{logCount}) && $param->{logCount} == 1 ? 1 : 0; my $count = 0; @@ -9186,7 +9189,7 @@ sub HMCCU_UpdateCB ($$$) my ($chnname, $dpspec, $value) = split /=/, $dp; next if (!defined($value)); my ($iface, $chnadd, $dpt) = split /\./, $dpspec; - next if (!defined($dpt)); + next if (!defined($dpt) || $dpt !~ /$filter/); my ($add, $chn) = ('', ''); if ($iface eq 'sysvar' && $chnadd eq 'link') { ($add, $chn) = HMCCU_GetAddress ($hash, $chnname); diff --git a/fhem/contrib/HMCCU/FHEM/88_HMCCUCHN.pm b/fhem/contrib/HMCCU/FHEM/88_HMCCUCHN.pm index 023ba0f6c..970c8a0e4 100644 --- a/fhem/contrib/HMCCU/FHEM/88_HMCCUCHN.pm +++ b/fhem/contrib/HMCCU/FHEM/88_HMCCUCHN.pm @@ -100,10 +100,10 @@ sub HMCCUCHN_Define ($@) my $n = 0; while (my $arg = shift @$a) { return $usage if ($n == 3); - if ($arg eq 'readonly') { $hash->{readonly} = 'yes'; } - elsif (lc($arg) eq 'nodefaults' && $init_done) { $hash->{hmccu}{nodefaults} = 1; } - elsif (lc($arg) eq 'defaults' && $init_done) { $hash->{hmccu}{nodefaults} = 0; } - else { return $usage; } + if ($arg eq 'readonly') { $hash->{readonly} = 'yes'; } + elsif (lc($arg) eq 'nodefaults') { $hash->{hmccu}{nodefaults} = 1 if ($init_done); } + elsif (lc($arg) eq 'defaults') { $hash->{hmccu}{nodefaults} = 0 if ($init_done); } + else { return $usage; } $n++; } @@ -390,7 +390,7 @@ sub HMCCUCHN_Get ($@) my $ccuflags = AttrVal ($name, 'ccuflags', 'null'); # Build set command syntax - my $syntax = 'update:noArg config:noArg paramsetDesc:noArg deviceInfo:noArg values:noArg'; + my $syntax = 'update config paramsetDesc:noArg deviceInfo:noArg values extValues'; # Command datapoint depends on readable datapoints my ($add, $chn) = split(":", $hash->{ccuaddr}); @@ -428,6 +428,11 @@ sub HMCCUCHN_Get ($@) return HMCCU_SetError ($hash, "Can't get device description") if (!defined($result)); return HMCCU_DisplayGetParameterResult ($ioHash, $hash, $result); } + elsif ($lcopt eq 'extvalues') { + my $filter = shift @$a; + my $rc = HMCCU_GetUpdate ($hash, $ccuaddr, $filter); + return $rc < 0 ? HMCCU_SetError ($hash, $rc) : 'OK'; + } elsif ($lcopt eq 'paramsetdesc') { my $result = HMCCU_ParamsetDescToStr ($ioHash, $hash); return defined($result) ? $result : HMCCU_SetError ($hash, "Can't get device model"); @@ -636,6 +641,11 @@ sub HMCCUCHN_Get ($@) 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'.
+
  • get <name> extValues [<filter-expr>]
    + Update all readings for all parameters of parameter set VALUES (datapoints) and connected system + variables by using CCU Rega (Homematic script). + If filter-expr is specified, only datapoints matching the expression are stored as readings. +

  • get <name> paramsetDesc
    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 diff --git a/fhem/contrib/HMCCU/FHEM/88_HMCCUDEV.pm b/fhem/contrib/HMCCU/FHEM/88_HMCCUDEV.pm index e63b40ec2..70e270c97 100644 --- a/fhem/contrib/HMCCU/FHEM/88_HMCCUDEV.pm +++ b/fhem/contrib/HMCCU/FHEM/88_HMCCUDEV.pm @@ -110,12 +110,12 @@ sub HMCCUDEV_Define ($@) # Parse optional command line parameters foreach my $arg (@$a) { - if (lc($arg) eq 'readonly') { $hash->{readonly} = 'yes'; } - elsif (lc($arg) eq 'nodefaults' && $init_done) { $hash->{hmccu}{nodefaults} = 1; } - elsif (lc($arg) eq 'defaults' && $init_done) { $hash->{hmccu}{nodefaults} = 0; } - elsif (lc($arg) eq 'forcedev') { $hash->{hmccu}{forcedev} = 1; } - elsif ($arg =~ /^[0-9]+$/) { $attr{$name}{controlchannel} = $arg; } - else { return $usage; } + if (lc($arg) eq 'readonly') { $hash->{readonly} = 'yes'; } + elsif (lc($arg) eq 'nodefaults') { $hash->{hmccu}{nodefaults} = 1 if ($init_done); } + elsif (lc($arg) eq 'defaults') { $hash->{hmccu}{nodefaults} = 0 if ($init_done); } + elsif (lc($arg) eq 'forcedev') { $hash->{hmccu}{forcedev} = 1; } + elsif ($arg =~ /^[0-9]+$/) { $attr{$name}{controlchannel} = $arg; } + else { return $usage; } } # IO device can be set by command line parameter iodev, otherwise try to detect IO device @@ -466,7 +466,7 @@ sub HMCCUDEV_Get ($@) my $ccuflags = AttrVal ($name, 'ccuflags', 'null'); # Build set command syntax - my $syntax = 'update:noArg config:noArg paramsetDesc:noArg deviceInfo:noArg values:noArg'; + my $syntax = 'update config paramsetDesc:noArg deviceInfo:noArg values extValues'; # Command datapoint depends on readable datapoints my @dpRList; @@ -519,6 +519,11 @@ sub HMCCUDEV_Get ($@) return HMCCU_SetError ($hash, "Can't get device description") if (!defined($result)); return HMCCU_DisplayGetParameterResult ($ioHash, $hash, $result); } + elsif ($lcopt eq 'extvalues') { + my $filter = shift @$a; + my $rc = HMCCU_GetUpdate ($hash, $ccuaddr, $filter); + return $rc < 0 ? HMCCU_SetError ($hash, $rc) : 'OK'; + } elsif ($lcopt eq 'paramsetdesc') { my $result = HMCCU_ParamsetDescToStr ($ioHash, $hash); return defined($result) ? $result : HMCCU_SetError ($hash, "Can't get device model"); @@ -718,7 +723,10 @@ sub HMCCUDEV_Get ($@)
  • device and channel description

  • -
  • get <name> update [{State | Value}]
    +
  • get <name> extValues [<filter-expr>]
    + see HMCCUCHN +

  • +
  • get <name> update [{State | Value}]
    see HMCCUCHN

  • get <name> weekProgram [<program-number>|all]
    diff --git a/fhem/contrib/HMCCU/controls_HMCCU.txt b/fhem/contrib/HMCCU/controls_HMCCU.txt index d363d3a25..8540797fc 100644 --- a/fhem/contrib/HMCCU/controls_HMCCU.txt +++ b/fhem/contrib/HMCCU/controls_HMCCU.txt @@ -1,5 +1,5 @@ UPD 2021-09-09_19:12:29 103713 FHEM/88_HMCCURPCPROC.pm UPD 2021-09-11_15:40:16 84901 FHEM/HMCCUConf.pm -UPD 2021-09-02_19:33:39 43994 FHEM/88_HMCCUCHN.pm -UPD 2021-09-11_16:31:05 358198 FHEM/88_HMCCU.pm -UPD 2021-09-02_19:33:39 31267 FHEM/88_HMCCUDEV.pm +UPD 2021-09-27_10:23:35 44472 FHEM/88_HMCCUCHN.pm +UPD 2021-09-27_10:29:06 358364 FHEM/88_HMCCU.pm +UPD 2021-09-27_10:19:43 31506 FHEM/88_HMCCUDEV.pm