diff --git a/fhem/FHEM/88_HMCCU.pm b/fhem/FHEM/88_HMCCU.pm index 9f7ba873f..1c7bda00a 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 2024-02'; +my $HMCCU_VERSION = '5.0 2024-03'; # Timeout for CCU requests (seconds) my $HMCCU_TIMEOUT_REQUEST = 4; @@ -6635,9 +6635,14 @@ sub HMCCU_UpdateRoleCommands ($$) my $cmdChn = $channel; my $cmdType = 'set'; - if ($cmd =~ /^(set|get) (.+)$/) { + my $forceRPC = 0; + if ($cmd =~ /^(set|get|rpcset|rpcget) (.+)$/) { $cmdType = $1; $cmd = $2; + if ($cmdType =~ /^rpc/) { + $forceRPC = 1; + $cmdType =~ s/rpc//; + } } next URCCMD if (exists($clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}) && defined($clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}{channel}) && $cc ne '' && "$clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}{channel}" eq "$cc"); @@ -6656,6 +6661,7 @@ sub HMCCU_UpdateRoleCommands ($$) $clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}{syntax} = $cmdSyntax; $clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}{role} = $role; + $clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}{rpc} = $forceRPC; my $cnt = 0; my $cmdDef = $cmd; @@ -6676,9 +6682,15 @@ sub HMCCU_UpdateRoleCommands ($$) my ($ps, $dptList, $par, $fnc) = @subCmdList; my $psName = $ps eq 'I' ? 'VALUES' : $pset{$ps}; if (!defined($psName)) { - HMCCU_Log ($clHash, 4, "HMCCUConf: Invalid or undefined parameter set in role $role, command $cmd $subCmd"); + HMCCU_Log ($clHash, 2, "HMCCUConf: Invalid or undefined parameter set in role $role, command $cmd $subCmd"); next URCSUB; } + $clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}{ps} //= $psName; + if ($forceRPC && $psName ne $clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}{ps}) { + HMCCU_Log ($clHash, 2, "HMCCUConf: RPC mode doesn't allow mixed paramsets in one command"); + next URCSUB; + } + $cmdChn = 'd' if ($ps eq 'D'); # Allow different datapoint/config parameter names for same command, if name depends on firmware revision of device type @@ -6701,13 +6713,13 @@ sub HMCCU_UpdateRoleCommands ($$) } } if (!$dptValid) { - HMCCU_Log ($clHash, 4, "HMCCUConf: Invalid parameter $addr:$cmdChn $psName $dpt $parAccess in role $role, command $cmd $subCmd"); + HMCCU_Log ($clHash, 2, "HMCCUConf: Invalid parameter $addr:$cmdChn $psName $dpt $parAccess in role $role, command $cmd $subCmd"); next URCSUB; } my $paramDef = HMCCU_GetParamDef ($ioHash, "$addr:$cmdChn", $psName, $dpt); if (!defined($paramDef)) { - HMCCU_Log ($ioHash, 4, "HMCCUConf: Can't get definition of datapoint $addr:$cmdChn.$dpt. Ignoring command $cmd in role $role for device $clHash->{NAME}"); + HMCCU_Log ($ioHash, 2, "HMCCUConf: Can't get definition of datapoint $addr:$cmdChn.$dpt. Ignoring command $cmd in role $role for device $clHash->{NAME}"); next URCCMD; } $clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}{subcmd}{$scn}{scn} = sprintf("%03d", $subCmdNo); @@ -6735,6 +6747,9 @@ sub HMCCU_UpdateRoleCommands ($$) my ($cNam, $cVal) = split (':', $e); if (defined($cVal)) { push @cNames, $cNam; + if (!HMCCU_IsFltNum($cVal)) { + HMCCU_Log ($clHash, 2, "cVal $cVal is not numeric. Enum = $el, type = $clHash->{ccutype}, dpt=$dpt, role=$role"); + } $min = $cVal if (!defined($min) || $cVal<$min); $max = $cVal if (!defined($max) || $cVal>$max); $clHash->{hmccu}{roleCmds}{$cmdType}{$cmd}{subcmd}{$scn}{look}{$cNam} = $cVal; @@ -6936,6 +6951,8 @@ sub HMCCU_ExecuteRoleCommand ($@) my %cmdFnc; my ($devAddr, undef) = HMCCU_SplitChnAddr ($clHash->{ccuaddr}); my $usage = $clHash->{hmccu}{roleCmds}{$mode}{$command}{usage}; + my $forceRPC = $clHash->{hmccu}{roleCmds}{$mode}{$command}{rpc}; + my $psName = $clHash->{hmccu}{roleCmds}{$mode}{$command}{ps} // 'MASTER'; my $channel = $clHash->{hmccu}{roleCmds}{$mode}{$command}{channel} // '?'; if ("$channel" eq '?') { @@ -7003,7 +7020,7 @@ sub HMCCU_ExecuteRoleCommand ($@) elsif ($cmd->{partype} == 2) { # Normal value $value = shift @$a // $cmd->{args}; - return HMCCU_SetError ($clHash, "Missing parameter $cmd->{parname}. Usage: $mode $name $usage") + return HMCCU_SetError ($clHash, "Missing parameter $cmd->{parname}.\nUsage: $mode $name $usage") if ($value eq ''); return HMCCU_SetError ($clHash, "Usage: $mode $name $usage") if ($value eq '?'); @@ -7049,22 +7066,22 @@ sub HMCCU_ExecuteRoleCommand ($@) # HMCCU_Trace ($clHash, 2, "scMin=$scMin, scMax=$scMax, scVal=$value"); # } - if ($cmd->{ps} eq 'VALUES') { - if ($cmd->{type} eq 'BOOL' && HMCCU_IsIntNum($value)) { - $value = $value > 0 ? 'true' : 'false'; - } - if ($combDpt eq '') { + if ($combDpt eq '') { + if ($cmd->{ps} eq 'VALUES' && !$forceRPC) { + if ($cmd->{type} eq 'BOOL' && HMCCU_IsIntNum($value)) { + $value = $value > 0 ? 'true' : 'false'; + } $dpval{"$cmd->{scn}.$clHash->{ccuif}.$chnAddr.$cmd->{dpt}"} = $value; } + elsif ($cmd->{ps} eq 'INTERNAL') { + $inval{$cmd->{parname}} = $value; + } else { - push @combArgs, $value; + $cfval{$cmd->{dpt}} = $value; } } - elsif ($cmd->{ps} eq 'INTERNAL') { - $inval{$cmd->{parname}} = $value; - } else { - $cfval{$cmd->{dpt}} = $value; + push @combArgs, $value; } push @par, $value if (defined($value)); @@ -7073,7 +7090,12 @@ sub HMCCU_ExecuteRoleCommand ($@) } if (scalar(@combArgs) > 0) { - $dpval{"000.$clHash->{ccuif}.$chnAddr.$combDpt"} = sprintf($combStr, @combArgs); + if ($forceRPC) { + $cfval{$combDpt} = sprintf($combStr, @combArgs); + } + else { + $dpval{"000.$clHash->{ccuif}.$chnAddr.$combDpt"} = sprintf($combStr, @combArgs); + } } my $ndpval = scalar(keys %dpval); @@ -7099,7 +7121,7 @@ sub HMCCU_ExecuteRoleCommand ($@) if ($ncfval > 0) { # Config commands foreach my $pv (keys %cfval) { HMCCU_Trace ($clHash, 2, "Parameter $pv=$cfval{$pv}"); } - ($rc, undef) = HMCCU_SetMultipleParameters ($clHash, $chnAddr, \%cfval, 'MASTER'); + ($rc, undef) = HMCCU_SetMultipleParameters ($clHash, $chnAddr, \%cfval, $psName); return HMCCU_SetError ($clHash, HMCCU_Min(0, $rc)); } } diff --git a/fhem/FHEM/88_HMCCUCHN.pm b/fhem/FHEM/88_HMCCUCHN.pm index 4229d5b7a..c21d4bd62 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 2024-02'; +my $HMCCUCHN_VERSION = '5.0 2024-03'; ###################################################################### # Initialize module @@ -523,6 +523,12 @@ sub HMCCUCHN_Get ($@)
  • set <name> armState {DISARMED|EXTSENS_ARMED|ALLSENS_ARMED|ALARM_BLOCKED}
    [alarm siren] Set arm state.

  • +
  • set <name> auto
    + [thermostat] Turn auto mode on. +

  • +
  • set <name> boost {on|off}
    + [thermostat] Turn boost mode on or off +

  • set <name> calibrate {START|STOP}
    [blind] Run calibration.

  • @@ -593,14 +599,17 @@ sub HMCCUCHN_Get ($@) [dimmer, blind] Decrement value of datapoint LEVEL. This command is only available if channel contains a datapoint LEVEL. Default for value is 20.
    +
  • set <name> manu [<temperature>]
    + [thermostat] Set manual mode. Default temperature is 20. +

  • set <name> off
    - Turn device off. + [switch,thermostat,dimmer] Turn device off.

  • set <name> oldLevel
    [dimmer, blind, jalousie, shutter] Set level to previous value.

  • set <name> on
    - Turn device on. + [switch,thermostat,dimmer] Turn device on.

  • set <name> on-for-timer <ontime>
    [switch] Switch device on for specified number of seconds. This command is only available if @@ -617,6 +626,9 @@ sub HMCCUCHN_Get ($@)
  • set <name> open
    [blind,door] Set level of a shutter or blind to 100%.

  • +
  • set <name> party <temperature> <start-time> <end-time>
    + [thermostat] Turn party mode on. Timestamps must be in format "YYYY_MM_DD HH:MM". +

  • set <name> pct <value> [<ontime> [<ramptime>]]
    [dimmer,blind] Set datapoint LEVEL of a channel to the specified value. Optionally a ontime and a ramptime (both in seconds) can be specified. This command is only available @@ -645,14 +657,7 @@ sub HMCCUCHN_Get ($@) channel contains a datapoint STOP.

  • set <name> toggle
    - Toggle state datapoint between values defined by attribute 'statevals' or by channel role. This command is - only available if state values can be detected or are defined by using attribute - 'statevals'. Toggling supports more than two state values.

    - Example: Toggle blind actor between states 'open', 'half' and 'close'
    - - attr myswitch statevals open:100,half:50,close:0
    - set myswitch toggle -
    + [switch,dimmer,blind] Toggle state between values on/off or open/close.

  • set <name> up [<value>]
    [blind,dimmer] Increment value of datapoint LEVEL. This command is only available diff --git a/fhem/FHEM/88_HMCCUDEV.pm b/fhem/FHEM/88_HMCCUDEV.pm index 910cb96a6..77944091a 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 2024-02'; +my $HMCCUDEV_VERSION = '5.0 2024-03'; ###################################################################### # Initialize module diff --git a/fhem/FHEM/88_HMCCURPCPROC.pm b/fhem/FHEM/88_HMCCURPCPROC.pm index 9a43304e9..48496dda9 100755 --- a/fhem/FHEM/88_HMCCURPCPROC.pm +++ b/fhem/FHEM/88_HMCCURPCPROC.pm @@ -36,7 +36,7 @@ use SetExtensions; ###################################################################### # HMCCURPC version -my $HMCCURPCPROC_VERSION = '5.0 2024-02'; +my $HMCCURPCPROC_VERSION = '5.0 2024-03'; # Maximum number of events processed per call of Read() my $HMCCURPCPROC_MAX_EVENTS = 100; diff --git a/fhem/FHEM/HMCCUConf.pm b/fhem/FHEM/HMCCUConf.pm index 63c862c97..6c1d6b6e8 100644 --- a/fhem/FHEM/HMCCUConf.pm +++ b/fhem/FHEM/HMCCUConf.pm @@ -264,6 +264,7 @@ $HMCCU_CONFIG_VERSION = '5.0'; '^(C#\.)?ACTUAL_TEMPERATURE$:+measured-temp;'. '^(C#\.)?ACTUAL_HUMIDITY$:+humidity;'. '^(C#\.)?SET_TEMPERATURE$:+desired-temp', + '^(C#\.)?BOOST_MODE$:+boost', 'CLIMATE_TRANSCEIVER' => '^(C#\.)?ACTUAL_TEMPERATURE$:+measured-temp;'. '^(C#\.)?ACTUAL_HUMIDITY$:+humidity', @@ -284,6 +285,7 @@ $HMCCU_CONFIG_VERSION = '5.0'; '^(C#\.)?HUMIDITY$:+humidity;'. '^(C#\.)?ACTUAL_HUMIDITY$:+humidity;'. '^(C#\.)?SET_POINT_TEMPERATURE$:+desired-temp', + '^(C#\.)?BOOST_MODE$:+boost', 'JALOUSIE' => '^(C#\.)?LEVEL$:+pct,+level;(C#\.)?LEVEL_SLATS$:+pctSlats', 'KEY' => @@ -308,6 +310,7 @@ $HMCCU_CONFIG_VERSION = '5.0'; '^(C#\.)?ACTUAL_TEMPERATURE$:+measured-temp;'. '^(C#\.)?ACTUAL_HUMIDITY$:+humidity;'. '^(C#\.)?SET_TEMPERATURE$:+desired-temp', + '^(C#\.)?BOOST_MODE$:+boost', 'VIRTUAL_KEY' => '^(C#\.)?PRESS_(SHORT|LONG)$:+pressed', 'WEATHER' => @@ -350,12 +353,12 @@ $HMCCU_CONFIG_VERSION = '5.0'; # Command with one parameter: Paramset:Datapoints:?Parameter # Optional parameter with default: Paramset:Datapoints:?Parameter=Default-Value # List of values: Paramset:Datapoints:#Parameter[=Value[,...]] -# Internal value (paramset "I"): Paramset:Datapoints:*Parameter=Default-Value +# Internal value (paramset "I"): I:Datapoints:*Parameter=Default-Value # Paramset: # V=VALUES, M=MASTER (channel), D=MASTER (device), I=INTERNAL, S=VALUE_STRING # Datapoints: # List of datapoint or config parameter names separated by ','. Multiple names can -# be specified to support multiple firmware revesions with different names. +# be specified to support multiple firmware revisions with different names. # Parameter characters: # ? = any value is accepted # # = If datapoint is of type ENUM, values are taken from parameter set description. @@ -425,7 +428,7 @@ $HMCCU_CONFIG_VERSION = '5.0'; 'on' => 'V:MANU_MODE:30.5', 'off' => 'V:MANU_MODE:4.5', 'auto' => 'V:AUTO_MODE:1', - 'boost' => 'V:BOOST_MODE:1', + 'boost' => 'V:BOOST_MODE:#boost=0,1', 'week-program:VirtualDevices' => 'D:WEEK_PROGRAM_POINTER:#program', 'get week-program:VirtualDevices' => 'D:WEEK_PROGRAM_POINTER:#program:HMCCU_DisplayWeekProgram' }, @@ -469,11 +472,15 @@ $HMCCU_CONFIG_VERSION = '5.0'; 'ventilate' => 'V:DOOR_COMMAND:4' }, 'HEATING_CLIMATECONTROL_TRANSCEIVER' => { + # CONTROL_MODE (write): 0=Auto, 1=Manual, 2=Holiday/Party 3=NoFunction + # SET_POINT_MODE (read): 0=Auto, 1=Manual, 2=Holiday/Party + # Party: CONTROL_MODE=2, PARTY_TIME_START=Ts, PARTY_TIME_END=Ts, Ts="YYYY_MM_DD HH:MM" 'desired-temp' => 'V:SET_POINT_TEMPERATURE:?temperature', 'auto' => 'V:CONTROL_MODE:0', - 'manu' => 'V:CONTROL_MODE:1', - 'holiday' => 'V:CONTROL_MODE:2', - 'boost' => 'V:BOOST_MODE:1', + 'manu' => 'V:CONTROL_MODE:1 V:SET_POINT_TEMPERATURE:?temperature=20', + 'rpcset holiday' => 'V:SET_POINT_MODE:2 V:SET_POINT_TEMPERATURE:?temperature V:PARTY_TIME_START:?timeStart V:PARTY_TIME_END:?timeEnd', + 'rpcset party' => 'V:SET_POINT_MODE:2 V:SET_POINT_TEMPERATURE:?temperature V:PARTY_TIME_START:?timeStart V:PARTY_TIME_END:?timeEnd', + 'boost' => 'V:BOOST_MODE:#boost=0,1', 'on' => 'V:CONTROL_MODE:1 V:SET_POINT_TEMPERATURE:30.5', 'off' => 'V:CONTROL_MODE:1 V:SET_POINT_TEMPERATURE:4.5' }, @@ -573,7 +580,7 @@ $HMCCU_CONFIG_VERSION = '5.0'; 'on' => 'V:MANU_MODE:30.5', 'off' => 'V:MANU_MODE:4.5', 'auto' => 'V:AUTO_MODE:1', - 'boost' => 'V:BOOST_MODE:1', + 'boost' => 'V:BOOST_MODE:#boost=0,1', 'week-program' => 'D:WEEK_PROGRAM_POINTER:#program', 'get week-program' => 'D:WEEK_PROGRAM_POINTER:#program:HMCCU_DisplayWeekProgram' }, @@ -705,7 +712,7 @@ $HMCCU_CONFIG_VERSION = '5.0'; }, 'THERMALCONTROL_TRANSMIT' => { 'substexcl' => 'desired-temp', - 'cmdIcon' => 'auto:sani_heating_automatic manu:sani_heating_manual boost:sani_heating_boost on:general_an off:general_aus', + 'cmdIcon' => 'auto:sani_heating_automatic manu:sani_heating_manual on:general_an off:general_aus', 'webCmd' => 'desired-temp:auto:manu:boost:on:off', 'widgetOverride' => 'desired-temp:slider,4.5,0.5,30.5,1' }, @@ -717,13 +724,13 @@ $HMCCU_CONFIG_VERSION = '5.0'; }, 'CLIMATECONTROL_RT_TRANSCEIVER' => { 'substexcl' => 'desired-temp', - 'cmdIcon' => 'auto:sani_heating_automatic manu:sani_heating_manual boost:sani_heating_boost on:general_an off:general_aus', + 'cmdIcon' => 'auto:sani_heating_automatic manu:sani_heating_manual on:general_an off:general_aus', 'webCmd' => 'desired-temp:auto:manu:boost:on:off', 'widgetOverride' => 'desired-temp:slider,4.5,0.5,30.5,1' }, 'HEATING_CLIMATECONTROL_TRANSCEIVER' => { 'substexcl' => 'desired-temp', - 'cmdIcon' => 'auto:sani_heating_automatic manu:sani_heating_manual boost:sani_heating_boost on:general_an off:general_aus', + 'cmdIcon' => 'auto:sani_heating_automatic manu:sani_heating_manual on:general_an off:general_aus', 'webCmd' => 'desired-temp:auto:manu:boost:on:off', 'widgetOverride' => 'desired-temp:slider,4.5,0.5,30.5,1' }, @@ -862,15 +869,18 @@ $HMCCU_CONFIG_VERSION = '5.0'; }, 'THERMALCONTROL_TRANSMIT' => { 'SET_TEMPERATURE' => { '4.5' => 'off', '30.5' => 'on' }, - 'WINDOW_OPEN_REPORTING' => { '0' => 'closed', '1' => 'open', 'false' => 'closed', 'true' => 'open' } + 'WINDOW_OPEN_REPORTING' => { '0' => 'closed', '1' => 'open', 'false' => 'closed', 'true' => 'open' }, + 'BOOST_MODE' => { '0' => 'boostOff', '1' => 'boostOn', 'false' => 'boostOff', 'true' => 'boostOn' } }, 'CLIMATECONTROL_RT_TRANSCEIVER' => { - 'SET_TEMPERATURE' => { '4.5' => 'off', '30.5' => 'on' } + 'SET_TEMPERATURE' => { '4.5' => 'off', '30.5' => 'on' }, + 'BOOST_MODE' => { '0' => 'boostOff', '1' => 'boostOn', 'false' => 'boostOff', 'true' => 'boostOn' } }, 'HEATING_CLIMATECONTROL_TRANSCEIVER' => { 'SET_POINT_TEMPERATURE' => { '4.5' => 'off', '30.5' => 'on' }, - 'SET_POINT_MODE' => { '0' => 'auto', '1' => 'manual', '2' => 'boost', '3' => 'off' }, - 'WINDOW_STATE' => { '0' => 'closed', '1' => 'open', 'false' => 'closed', 'true' => 'open' } + 'SET_POINT_MODE' => { '0' => 'auto', '1' => 'manual', '2' => 'party/holiday', '3' => 'off' }, + 'WINDOW_STATE' => { '0' => 'closed', '1' => 'open', 'false' => 'closed', 'true' => 'open' }, + 'BOOST_MODE' => { '0' => 'boostOff', '1' => 'boostOn', 'false' => 'boostOff', 'true' => 'boostOn' } }, 'CLIMATECONTROL_REGULATOR' => { 'SETPOINT' => { '4.5' => 'off', '30.5' => 'on' }