HMCCU: Added auto detect for some devices

git-svn-id: https://svn.fhem.de/fhem/trunk@25429 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
zap 2022-01-06 17:27:06 +00:00
parent fe26d61111
commit c049a67e7c
5 changed files with 45 additions and 15 deletions

View File

@ -57,7 +57,7 @@ my %HMCCU_CUST_CHN_DEFAULTS;
my %HMCCU_CUST_DEV_DEFAULTS;
# HMCCU version
my $HMCCU_VERSION = '5.0 220021858';
my $HMCCU_VERSION = '5.0 220061807';
# Timeout for CCU requests (seconds)
my $HMCCU_TIMEOUT_REQUEST = 4;
@ -2413,7 +2413,7 @@ sub HMCCU_GetReadingName ($$$$$;$$$)
push @rnlist, $newReadings{$d};
}
# Build list of reading name rules
# Build list of reading name rul
my @srl = ();
my $crn = AttrVal ($name, 'ccureadingname', '');
push @srl, split(';', $crn) if ($crn ne '');
@ -4476,7 +4476,7 @@ sub HMCCU_GetEnumValues ($$$;$)
$i--;
my $j = $i;
my @valList = split(',',$paramDef->{VALUE_LIST});
my %valIndex = map { $i++; $_ => $i if ($_ ne '') } @valList; # Consider blanks in value list
my %valIndex = map { $i++; $_ ne '' ? ($_ => $i) : () } @valList; # Consider blanks in value list
if (defined($value)) {
if ($value eq '#') {
# Return list of Constant:Value pairs
@ -8970,6 +8970,7 @@ sub HMCCU_HMCommandNB ($$$)
my $ccureqtimeout = AttrVal ($ioHash->{NAME}, 'ccuReqTimeout', $HMCCU_TIMEOUT_REQUEST);
my $url = HMCCU_BuildURL ($ioHash, 'rega');
HMCCU_Trace ($ioHash, 2, "Executing command $cmd non blocking");
HMCCU_Trace ($clHash, 2, "URL=$url");
my $param = { url => $url, timeout => $ccureqtimeout, data => $cmd, method => "POST",
@ -9062,6 +9063,7 @@ sub HMCCU_HMScriptExt ($$;$$$)
my $url = HMCCU_BuildURL ($hash, 'rega');
if (defined($cbFunc)) {
# Non blocking
HMCCU_Trace ($hash, 2, "Executing $hmscript non blocking");
my $param = { url => $url, timeout => $ccureqtimeout, data => $code, method => "POST",
callback => \&HMCCU_HMScriptCB, cbFunc => $cbFunc, devhash => $hash, ioHash => $ioHash };
if (defined($cbParam)) {

View File

@ -30,7 +30,7 @@ sub HMCCUCHN_Set ($@);
sub HMCCUCHN_Get ($@);
sub HMCCUCHN_Attr ($@);
my $HMCCUCHN_VERSION = '5.0 220021858';
my $HMCCUCHN_VERSION = '5.0 220061807';
######################################################################
# Initialize module
@ -532,7 +532,7 @@ sub HMCCUCHN_Get ($@)
and all internally stored device parameter values are deleted.
</li><br/>
<li><b>set &lt;name&gt; close</b><br/>
[blind] Set level of a shutter or blind to 0%.
[blind,door] Set level of a shutter or blind to 0%.
</li><br/>
<li><b>set &lt;name&gt; color &lt;color-name&gt;</b><br/>
[light] Set color of LED light.
@ -609,7 +609,7 @@ sub HMCCUCHN_Get ($@)
ON_TIME.
</li><br/>
<li><b>set &lt;name&gt; open</b><br/>
[blind] Set level of a shutter or blind to 100%.
[blind,door] Set level of a shutter or blind to 100%.
</li><br/>
<li><b>set &lt;name&gt; pct &lt;value&gt; [&lt;ontime&gt; [&lt;ramptime&gt;]]</b><br/>
[dimmer,blind] Set datapoint LEVEL of a channel to the specified <i>value</i>. Optionally a <i>ontime</i>
@ -624,12 +624,18 @@ sub HMCCUCHN_Get ($@)
<li><b>set &lt;name&gt; pctSlats &lt;value&gt;</b><br/>
[blind] Like command 'set pct', but changes the level of slats (if available).
</li><br/>
<li><b>set &lt;name&gt; readingFilter &lt;datapoint-list&gt;</b><br/>
Set attribute ccureadingfilter by selecting a list of datapoints. Parameter <i>datapoint-list</i>
is a comma seperated list of datapoints.
</li><br/>
<li><b>set &lt;name&gt; press</b><br/>
[key] Submit a short key press.
</li><br/>
<li><b>set &lt;name&gt; pressLong</b><br/>
[key] Submit a long key press.
</li><br/>
<li><b>set &lt;name&gt; readingFilter &lt;datapoint-list&gt;</b><br/>
Set attribute ccureadingfilter by selecting a list of datapoints. Parameter <i>datapoint-list</i>
is a comma seperated list of datapoints.
</li><br/>
<li><b>set &lt;name&gt; stop</b><br/>
[blind] Set datapoint STOP of a channel to true. This command is only available, if the
[blind,door] Set datapoint STOP of a channel to true. This command is only available, if the
channel contains a datapoint STOP.
</li><br/>
<li><b>set &lt;name&gt; toggle</b><br/>
@ -651,7 +657,10 @@ sub HMCCUCHN_Get ($@)
must be a valid datapoint name. If <i>type</i> is not specified, it's taken from
parameter set definition. The default <i>type</i> is STRING.
Valid types are STRING, BOOL, INTEGER, FLOAT, DOUBLE.
</li>
</li><br/>
<li><b>set &lt;name&gt; ventilate</b><br/>
[garage door] Set door position to ventilation.
</li>
</ul>
<br/>

View File

@ -31,7 +31,7 @@ sub HMCCUDEV_Set ($@);
sub HMCCUDEV_Get ($@);
sub HMCCUDEV_Attr ($@);
my $HMCCUDEV_VERSION = '5.0 220021858';
my $HMCCUDEV_VERSION = '5.0 220061807';
######################################################################
# Initialize module

View File

@ -39,7 +39,7 @@ require "$attr{global}{modpath}/FHEM/88_HMCCU.pm";
######################################################################
# HMCCURPC version
my $HMCCURPCPROC_VERSION = '5.0 220021858';
my $HMCCURPCPROC_VERSION = '5.0 220061807';
# Maximum number of events processed per call of Read()
my $HMCCURPCPROC_MAX_EVENTS = 100;

View File

@ -112,9 +112,15 @@ $HMCCU_CONFIG_VERSION = '5.0';
'DOOR_LOCK_STATE_TRANSMITTER' => {
F => 3, S => 'LOCK_STATE', C => 'LOCK_TARGET_LEVEL', V => 'open:2,unlocked:1,locked:0'
},
'DOOR_RECEIVER' => {
F => 3, S => 'DOOR_STATE', C => 'DOOR_COMMAND', V => 'open:1,stop:2,close:3,ventilate:4'
},
'ENERGIE_METER_TRANSMITTER' => {
F => 3, S => 'CURRENT', C => '', V => '', P => 1
},
'HB_GENERIC_DIST' => {
F => 3, S => 'DISTANCE', C => '', V => '', P => 1
},
'HEATING_CLIMATECONTROL_TRANSCEIVER' => {
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'SET_POINT_TEMPERATURE', V => 'on:30.5,off:4.5', P => 2
},
@ -258,6 +264,8 @@ $HMCCU_CONFIG_VERSION = '5.0';
'^(C#\.)?LEVEL$:+pct,+level;(C#\.)?COLOR$:+color',
'DIMMER_WEEK_PROFILE' =>
'^(C#\.)?WEEK_PROGRAM_CHANNEL_LOCKS$:+progMode',
'HB_GENERIC_DIST' =>
'^(C#\.)?BATTERY_VOLTAGE$:voltage',
'HEATING_CLIMATECONTROL_TRANSCEIVER' =>
'^(C#\.)?ACTUAL_TEMPERATURE$:+measured-temp;'.
'^(C#\.)?HUMIDITY$:+humidity;'.
@ -417,6 +425,12 @@ $HMCCU_CONFIG_VERSION = '5.0';
'unlock' => 'V:LOCK_TARGET_LEVEL:1',
'lock' => 'V:LOCK_TARGET_LEVEL:0'
},
'DOOR_RECEIVER' => {
'open' => 'V:DOOR_COMMAND:1',
'stop' => 'V:DOOR_COMMAND:2',
'close' => 'V:DOOR_COMMAND:3',
'ventilate' => 'V:DOOR_COMMAND:4'
},
'HEATING_CLIMATECONTROL_TRANSCEIVER' => {
'desired-temp' => 'V:SET_POINT_TEMPERATURE:?temperature',
'auto' => 'V:CONTROL_MODE:0',
@ -440,7 +454,8 @@ $HMCCU_CONFIG_VERSION = '5.0';
'KEY' => {
'on' => 'V:PRESS_SHORT:1',
'off' => 'V:PRESS_SHORT:1',
'press' => 'V:PRESS_SHORT:1'
'press' => 'V:PRESS_SHORT:1',
'pressLong' => 'V:PRESS_LONG:1'
},
'KEYMATIC' => {
'open' => 'V:OPEN:true',
@ -562,6 +577,10 @@ $HMCCU_CONFIG_VERSION = '5.0';
'cmdIcon' => 'open:fts_door_open unlock:secur_open lock:secur_locked',
'webCmd' => 'lock:unlock:open'
},
'DOOR_RECEIVER' => {
'cmdIcon' => 'open:fts_garage_door_up stop:fts_garage_door_manual close:fts_garage_door_down ventilate:fts_garage_door_80',
'webCmd' => 'open:close:stop:ventilate'
},
'JALOUSIE' => {
'substexcl' => 'pct',
'cmdIcon' => 'open:fts_shutter_up stop:fts_shutter_manual close:fts_shutter_down',