diff --git a/fhem/CHANGED b/fhem/CHANGED index 9cf32e63f..63ec83dde 100644 --- a/fhem/CHANGED +++ b/fhem/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. + - bugfix: 88_HMCCU: Fixed ePaper and BSL bugs - bugfix: 88_HMCCU: Fixed some bugs - bugfix: 73_km200: Allowing port behind IP address - feature: 6.1 released diff --git a/fhem/FHEM/88_HMCCU.pm b/fhem/FHEM/88_HMCCU.pm index bb5b30b9f..7c437d4dc 100755 --- a/fhem/FHEM/88_HMCCU.pm +++ b/fhem/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 213141800'; +my $HMCCU_VERSION = '5.0 213171649'; # Timeout for CCU requests (seconds) my $HMCCU_TIMEOUT_REQUEST = 4; @@ -194,7 +194,7 @@ sub HMCCU_SubstVariables ($$$); # Update client device readings sub HMCCU_BulkUpdate ($$$;$); sub HMCCU_GetUpdate ($$;$$); -sub HMCCU_RefreshReadings ($); +sub HMCCU_RefreshReadings ($;$); sub HMCCU_UpdateCB ($$$); sub HMCCU_UpdateClients ($$$$;$$); sub HMCCU_UpdateInternalValues ($$$$$); @@ -4686,12 +4686,17 @@ sub HMCCU_UpdateParamsetReadings ($$$;$) # Refresh readings of a client device ###################################################################### -sub HMCCU_RefreshReadings ($) +sub HMCCU_RefreshReadings ($;$) { - my ($clHash) = @_; - - my $ioHash = HMCCU_GetHash ($clHash) // return; + my ($clHash, $attribute) = @_; + my $ioHash = HMCCU_GetHash ($clHash) // return; + my $refreshAttrList = 'ccucalculate|ccuflags|ccureadingfilter|ccureadingformat|'. + 'ccureadingname|ccuReadingPrefix|ccuscaleval|controldatapoint|hmstatevals|'. + 'statedatapoint|statevals|substitute|substexcl|stripnumber'; + + return if (defined($attribute) && $attribute !~ /^($refreshAttrList)$/i); + HMCCU_DeleteReadings ($clHash, '.*'); my %objects; @@ -6870,7 +6875,8 @@ sub HMCCU_UpdateRoleCommands ($$;$) next URCROL if (!defined($role) || !exists($HMCCU_ROLECMDS->{$role})); URCCMD: foreach my $cmdKey (keys %{$HMCCU_ROLECMDS->{$role}}) { - next URCCMD if ($clHash->{TYPE} eq 'HMCCUCHN' && $chnNo ne '' && $chnNo != $channel && $chnNo ne 'd'); +# next URCCMD if ($clHash->{TYPE} eq 'HMCCUCHN' && $chnNo ne '' && $chnNo != $channel && $chnNo ne 'd'); + next URCCMD if ($chnNo ne '' && $chnNo != $channel && $chnNo ne 'd'); my ($cmd, $cmdIf) = split (':', $cmdKey); next URCCMD if (defined($cmdIf) && $clHash->{ccuif} !~ /$cmdIf/); my $cmdSyntax = $HMCCU_ROLECMDS->{$role}{$cmdKey}; @@ -8479,9 +8485,27 @@ sub HMCCU_DetectDevice ($$$) } } - $di{defSDP} = $di{defSCh}.'.'.$di{stateRole}{$di{defSCh}}{datapoint} if ($di{defSCh} != -1); - $di{defCDP} = $di{defCCh}.'.'.$di{controlRole}{$di{defCCh}}{datapoint} if ($di{defCCh} != -1); - + if ($di{defSCh} != -1) { + my $dpn = $di{stateRole}{$di{defSCh}}{datapoint} // ''; + my $dpr = $di{stateRole}{$di{defSCh}}{role} // ''; + if ($dpn eq '') { + HMCCU_Log ($ioHash, 2, "State datapoint not defined for channel $di{defSCh}, role $dpr"); + } + else { + $di{defSDP} = $di{defSCh}.'.'.$dpn; + } + } + if ($di{defCCh} != -1) { + my $dpn = $di{controlRole}{$di{defCCh}}{datapoint} // ''; + my $dpr = $di{controlRole}{$di{defCCh}}{role} // ''; + if ($dpn eq '') { + HMCCU_Log ($ioHash, 2, "Control datapoint not defined for channel $di{defCCh}, role $dpr"); + } + else { + $di{defCDP} = $di{defCCh}.'.'.$dpn; + } + } + return \%di; } @@ -10112,9 +10136,9 @@ sub HMCCU_EncodeEPDisplay ($) my @text = ('', '', ''); my @icon = ('', '', ''); foreach my $tok (split (',', $msg)) { - my ($par, $val) = split (':', $tok); + my ($par, $val) = split (':', $tok, 2); next if (!defined($val)); - if ($par =~ /^text([1-3])$/) { $text[$1-1] = substr ($val, 0, 12); } + if ($par =~ /^text([1-3])$/) { $text[$1-1] = substr($val, 0, 12); } elsif ($par =~ /^icon([1-3])$/) { $icon[$1-1] = $val; } elsif ($par =~ /^(sound|pause|repeat|signal)$/) { $conf{$1} = $val; } } diff --git a/fhem/FHEM/88_HMCCUCHN.pm b/fhem/FHEM/88_HMCCUCHN.pm index abaab6a32..eb0185467 100644 --- a/fhem/FHEM/88_HMCCUCHN.pm +++ b/fhem/FHEM/88_HMCCUCHN.pm @@ -30,7 +30,7 @@ sub HMCCUCHN_Set ($@); sub HMCCUCHN_Get ($@); sub HMCCUCHN_Attr ($@); -my $HMCCUCHN_VERSION = '5.0 213141800'; +my $HMCCUCHN_VERSION = '5.0 213171649'; ###################################################################### # Initialize module @@ -184,7 +184,6 @@ sub HMCCUCHN_InitDevice ($$) my $rc = 0; if ($init_done) { - HMCCU_Log ($devHash, 2, "InitDevice called when init done"); my $detect = HMCCU_DetectDevice ($ioHash, $da, $di); # Interactive device definition @@ -757,7 +756,9 @@ sub HMCCUCHN_Get ($@) channel-name.datapoint. If set to 'datapoint' format is channel-number.datapoint. For HMCCUCHN devices the channel part is ignored. With suffix 'lc' reading names are converted to lowercase. The reading format can also contain format specifiers %a (address), - %n (name) and %c (channel). Use %A, %N, %C for conversion to upper case.

+ %n (name) and %c (channel). Use %A, %N, %C for conversion to upper case. The readings will + be refreshed automatically if this attribute is changed. The default value for this + attribute can be defined by setting attribute ccudef-readingformat in the I/O device.

Example:
attr mydev ccureadingformat HM_%c_%N diff --git a/fhem/FHEM/88_HMCCUDEV.pm b/fhem/FHEM/88_HMCCUDEV.pm index c5587eb9b..484b9a172 100644 --- a/fhem/FHEM/88_HMCCUDEV.pm +++ b/fhem/FHEM/88_HMCCUDEV.pm @@ -31,7 +31,7 @@ sub HMCCUDEV_Set ($@); sub HMCCUDEV_Get ($@); sub HMCCUDEV_Attr ($@); -my $HMCCUDEV_VERSION = '5.0 213141800'; +my $HMCCUDEV_VERSION = '5.0 213171649'; ###################################################################### # Initialize module @@ -209,7 +209,6 @@ sub HMCCUDEV_InitDevice ($$) my $rc = 0; if ($init_done) { - HMCCU_Log ($devHash, 2, "InitDevice called when init done"); my $detect = HMCCU_DetectDevice ($ioHash, $da, $di); return "Specify option 'forceDev' for HMCCUDEV or use HMCCUCHN instead (recommended). Command: define $name HMCCUCHN $detect->{defAdd}" if (defined($detect) && $detect->{defMod} eq 'HMCCUCHN' && $devHash->{hmccu}{forcedev} == 0); @@ -699,17 +698,18 @@ sub HMCCUDEV_Get ($@)
  • ePaper Display

    This display has 5 text lines. The lines 1,2 and 4,5 are accessible via config parameters - TEXTLINE_1 and TEXTLINE_2 in channels 1 and 2. Example:

    + TEXTLINE_1 and TEXTLINE_2 in channels 1 and 2.
    + Example:

    define HM_EPDISP HMCCUDEV CCU_EPDISP
    - set HM_EPDISP config 2 TEXTLINE_1=Line1
    - set HM_EPDISP config 2 TEXTLINE_2=Line2
    - set HM_EPDISP config 1 TEXTLINE_1=Line4
    - set HM_EPDISP config 1 TEXTLINE_2=Line5
    + set HM_EPDISP config 2 TEXTLINE_1=Line1 # Set line 1 to "Line1"
    + set HM_EPDISP config 2 TEXTLINE_2=Line2 # Set line 2 to "Line2"
    + set HM_EPDISP config 1 TEXTLINE_1=Line4 # Set line 4 to "Line4"
    + set HM_EPDISP config 1 TEXTLINE_2=Line5 # Set line 5 to "Line5"

    - The lines 2,3 and 4 of the display can be accessed by setting the datapoint SUBMIT of the - display to a string containing command tokens in format 'parameter=value'. The following + The lines 2,3 and 4 of the display can be modified by setting the datapoint SUBMIT of the + display to a string containing command tokens in format 'parameter:value'. The following commands are allowed:

    diff --git a/fhem/FHEM/88_HMCCURPCPROC.pm b/fhem/FHEM/88_HMCCURPCPROC.pm index 90c671e66..a2d68872a 100755 --- a/fhem/FHEM/88_HMCCURPCPROC.pm +++ b/fhem/FHEM/88_HMCCURPCPROC.pm @@ -39,7 +39,7 @@ require "$attr{global}{modpath}/FHEM/88_HMCCU.pm"; ###################################################################### # HMCCURPC version -my $HMCCURPCPROC_VERSION = '5.0 213141800'; +my $HMCCURPCPROC_VERSION = '5.0 213171649'; # Maximum number of events processed per call of Read() my $HMCCURPCPROC_MAX_EVENTS = 100;