mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
HMCCU: bugs fixed 4.4 beta
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@23144 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c8f5641b2c
commit
1c9e60c34d
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# $Id: 88_HMCCU.pm 18745 2019-02-26 17:33:23Z zap $
|
# $Id: 88_HMCCU.pm 18745 2019-02-26 17:33:23Z zap $
|
||||||
#
|
#
|
||||||
# Version 4.4.051
|
# Version 4.4.052
|
||||||
#
|
#
|
||||||
# Module for communication between FHEM and Homematic CCU2/3.
|
# Module for communication between FHEM and Homematic CCU2/3.
|
||||||
#
|
#
|
||||||
@ -41,22 +41,23 @@ use SetExtensions;
|
|||||||
use HMCCUConf;
|
use HMCCUConf;
|
||||||
|
|
||||||
# Import configuration data
|
# Import configuration data
|
||||||
my $HMCCU_STATECONTROL = \%HMCCUConf::HMCCU_STATECONTROL;
|
my $HMCCU_CONFIG_VERSION = $HMCCUConf::HMCCU_CONFIG_VERSION;
|
||||||
my $HMCCU_READINGS = \%HMCCUConf::HMCCU_READINGS;
|
my $HMCCU_STATECONTROL = \%HMCCUConf::HMCCU_STATECONTROL;
|
||||||
my $HMCCU_ROLECMDS = \%HMCCUConf::HMCCU_ROLECMDS;
|
my $HMCCU_READINGS = \%HMCCUConf::HMCCU_READINGS;
|
||||||
my $HMCCU_GETROLECMDS = \%HMCCUConf::HMCCU_GETROLECMDS;
|
my $HMCCU_ROLECMDS = \%HMCCUConf::HMCCU_ROLECMDS;
|
||||||
my $HMCCU_ATTR = \%HMCCUConf::HMCCU_ATTR;
|
my $HMCCU_GETROLECMDS = \%HMCCUConf::HMCCU_GETROLECMDS;
|
||||||
my $HMCCU_CONVERSIONS = \%HMCCUConf::HMCCU_CONVERSIONS;
|
my $HMCCU_ATTR = \%HMCCUConf::HMCCU_ATTR;
|
||||||
my $HMCCU_CHN_DEFAULTS = \%HMCCUConf::HMCCU_CHN_DEFAULTS;
|
my $HMCCU_CONVERSIONS = \%HMCCUConf::HMCCU_CONVERSIONS;
|
||||||
my $HMCCU_DEV_DEFAULTS = \%HMCCUConf::HMCCU_DEV_DEFAULTS;
|
my $HMCCU_CHN_DEFAULTS = \%HMCCUConf::HMCCU_CHN_DEFAULTS;
|
||||||
my $HMCCU_SCRIPTS = \%HMCCUConf::HMCCU_SCRIPTS;
|
my $HMCCU_DEV_DEFAULTS = \%HMCCUConf::HMCCU_DEV_DEFAULTS;
|
||||||
|
my $HMCCU_SCRIPTS = \%HMCCUConf::HMCCU_SCRIPTS;
|
||||||
|
|
||||||
# Custom configuration data
|
# Custom configuration data
|
||||||
my %HMCCU_CUST_CHN_DEFAULTS;
|
my %HMCCU_CUST_CHN_DEFAULTS;
|
||||||
my %HMCCU_CUST_DEV_DEFAULTS;
|
my %HMCCU_CUST_DEV_DEFAULTS;
|
||||||
|
|
||||||
# HMCCU version
|
# HMCCU version
|
||||||
my $HMCCU_VERSION = '4.4.051';
|
my $HMCCU_VERSION = '4.4.052';
|
||||||
|
|
||||||
# Timeout for CCU requests (seconds)
|
# Timeout for CCU requests (seconds)
|
||||||
my $HMCCU_TIMEOUT_REQUEST = 4;
|
my $HMCCU_TIMEOUT_REQUEST = 4;
|
||||||
@ -460,6 +461,7 @@ sub HMCCU_Define ($$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$hash->{version} = $HMCCU_VERSION;
|
$hash->{version} = $HMCCU_VERSION;
|
||||||
|
$hash->{config} = $HMCCU_CONFIG_VERSION;
|
||||||
$hash->{ccutype} = 'CCU2/3';
|
$hash->{ccutype} = 'CCU2/3';
|
||||||
$hash->{RPCState} = 'inactive';
|
$hash->{RPCState} = 'inactive';
|
||||||
$hash->{NOTIFYDEV} = 'global,TYPE=(HMCCU|HMCCUDEV|HMCCUCHN)';
|
$hash->{NOTIFYDEV} = 'global,TYPE=(HMCCU|HMCCUDEV|HMCCUCHN)';
|
||||||
@ -3354,7 +3356,7 @@ sub HMCCU_GetChannelRole ($;$)
|
|||||||
else {
|
else {
|
||||||
my ($sc, $sd, $cc, $cd) = HMCCU_GetSpecialDatapoints ($clHash);
|
my ($sc, $sd, $cc, $cd) = HMCCU_GetSpecialDatapoints ($clHash);
|
||||||
$chnNo = $cc;
|
$chnNo = $cc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (defined($chnNo) && $chnNo ne '') {
|
if (defined($chnNo) && $chnNo ne '') {
|
||||||
foreach my $role (split(',', $clHash->{hmccu}{role})) {
|
foreach my $role (split(',', $clHash->{hmccu}{role})) {
|
||||||
@ -3587,8 +3589,10 @@ sub HMCCU_DeviceDescToStr ($$)
|
|||||||
$devDesc = HMCCU_GetDeviceDesc ($ioHash, $a, $iface);
|
$devDesc = HMCCU_GetDeviceDesc ($ioHash, $a, $iface);
|
||||||
return undef if (!defined($devDesc));
|
return undef if (!defined($devDesc));
|
||||||
|
|
||||||
|
my $channelType = $devDesc->{TYPE};
|
||||||
|
my $status = exists($HMCCU_STATECONTROL->{$channelType}) ? ' known' : '';
|
||||||
$result .= $a eq $devAddr ? "Device $a" : "Channel $a";
|
$result .= $a eq $devAddr ? "Device $a" : "Channel $a";
|
||||||
$result .= " $devDesc->{_name} [$devDesc->{TYPE}]\n";
|
$result .= " $devDesc->{_name} [$channelType]$status\n";
|
||||||
foreach my $n (sort keys %{$devDesc}) {
|
foreach my $n (sort keys %{$devDesc}) {
|
||||||
next if ($n =~ /^_/ || $n =~ /^(ADDRESS|TYPE|INDEX|VERSION)$/ ||
|
next if ($n =~ /^_/ || $n =~ /^(ADDRESS|TYPE|INDEX|VERSION)$/ ||
|
||||||
!defined($devDesc->{$n}) || $devDesc->{$n} eq '');
|
!defined($devDesc->{$n}) || $devDesc->{$n} eq '');
|
||||||
@ -6123,6 +6127,7 @@ sub HMCCU_GetAttribute ($$$$)
|
|||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Set default attributes for client device.
|
# Set default attributes for client device.
|
||||||
|
# Optionally delete obsolete attributes.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
sub HMCCU_SetDefaultAttributes ($;$)
|
sub HMCCU_SetDefaultAttributes ($;$)
|
||||||
@ -6133,9 +6138,10 @@ sub HMCCU_SetDefaultAttributes ($;$)
|
|||||||
$parRef //= { mode => 'update', role => undef, ctrlChn => undef };
|
$parRef //= { mode => 'update', role => undef, ctrlChn => undef };
|
||||||
my $role = $parRef->{role} // HMCCU_GetChannelRole ($clHash, $parRef->{ctrlChn});
|
my $role = $parRef->{role} // HMCCU_GetChannelRole ($clHash, $parRef->{ctrlChn});
|
||||||
|
|
||||||
if ($role ne '' && exists($HMCCU_ATTR->{$role})) {
|
if ($role ne '') {
|
||||||
HMCCU_Log ($clHash, 2, "Default attributes found for role $role");
|
|
||||||
$clHash->{hmccu}{semDefaults} = 1;
|
$clHash->{hmccu}{semDefaults} = 1;
|
||||||
|
|
||||||
|
# Delete obsolete attributes
|
||||||
if ($parRef->{mode} eq 'reset') {
|
if ($parRef->{mode} eq 'reset') {
|
||||||
my @removeAttr = ('ccureadingname', 'ccuscaleval', 'eventMap',
|
my @removeAttr = ('ccureadingname', 'ccuscaleval', 'eventMap',
|
||||||
'substitute', 'webCmd', 'widgetOverride'
|
'substitute', 'webCmd', 'widgetOverride'
|
||||||
@ -6144,9 +6150,14 @@ sub HMCCU_SetDefaultAttributes ($;$)
|
|||||||
CommandDeleteAttr (undef, "$clName $a") if (exists($attr{$clName}{$a}));
|
CommandDeleteAttr (undef, "$clName $a") if (exists($attr{$clName}{$a}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach my $a (keys %{$HMCCU_ATTR->{$role}}) {
|
|
||||||
CommandAttr (undef, "$clName $a ".$HMCCU_ATTR->{$role}{$a});
|
# Set additional attributes
|
||||||
|
if (exists($HMCCU_ATTR->{$role})) {
|
||||||
|
foreach my $a (keys %{$HMCCU_ATTR->{$role}}) {
|
||||||
|
CommandAttr (undef, "$clName $a ".$HMCCU_ATTR->{$role}{$a});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$clHash->{hmccu}{semDefaults} = 0;
|
$clHash->{hmccu}{semDefaults} = 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -8922,10 +8933,11 @@ sub HMCCU_MaxHashEntries ($$)
|
|||||||
format identifiers which are substituted by corresponding values of the CCU device or
|
format identifiers which are substituted by corresponding values of the CCU device or
|
||||||
channel:<br/>
|
channel:<br/>
|
||||||
%n = CCU object name (channel or device)<br/>
|
%n = CCU object name (channel or device)<br/>
|
||||||
%d = CCU device name, %a = CCU address<br/>
|
%d = CCU device name<br/>
|
||||||
|
%a = CCU address<br/>
|
||||||
In addition a list of default attributes for the created client devices can be specified.
|
In addition a list of default attributes for the created client devices can be specified.
|
||||||
If option 'defattr' is specified HMCCU tries to set default attributes for device.
|
If option 'defattr' is specified HMCCU tries to set default attributes for device.
|
||||||
This is not necessary of HMCCU is able to detect the role of a device or channel.
|
This is not necessary because HMCCU is able to detect the role of a device or channel.
|
||||||
With option 'duplicates' HMCCU will overwrite existing devices and/or create devices
|
With option 'duplicates' HMCCU will overwrite existing devices and/or create devices
|
||||||
for existing device addresses. Option 'save' will save FHEM config after device definition.
|
for existing device addresses. Option 'save' will save FHEM config after device definition.
|
||||||
</li><br/>
|
</li><br/>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# $Id: HMCCUConf.pm 18552 2019-02-10 11:52:28Z zap $
|
# $Id: HMCCUConf.pm 18552 2019-02-10 11:52:28Z zap $
|
||||||
#
|
#
|
||||||
# Version 4.8.007
|
# Version 4.8.010
|
||||||
#
|
#
|
||||||
# Configuration parameters for HomeMatic devices.
|
# Configuration parameters for HomeMatic devices.
|
||||||
#
|
#
|
||||||
@ -17,6 +17,7 @@ package HMCCUConf;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
use vars qw($HMCCU_CONFIG_VERSION);
|
||||||
use vars qw(%HMCCU_STATECONTROL);
|
use vars qw(%HMCCU_STATECONTROL);
|
||||||
use vars qw(%HMCCU_READINGS);
|
use vars qw(%HMCCU_READINGS);
|
||||||
use vars qw(%HMCCU_ROLECMDS);
|
use vars qw(%HMCCU_ROLECMDS);
|
||||||
@ -26,6 +27,8 @@ use vars qw(%HMCCU_CHN_DEFAULTS);
|
|||||||
use vars qw(%HMCCU_DEV_DEFAULTS);
|
use vars qw(%HMCCU_DEV_DEFAULTS);
|
||||||
use vars qw(%HMCCU_SCRIPTS);
|
use vars qw(%HMCCU_SCRIPTS);
|
||||||
|
|
||||||
|
$HMCCU_CONFIG_VERSION = '4.8.010';
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Channel roles with state and control datapoints
|
# Channel roles with state and control datapoints
|
||||||
# F: 1=Channel/HMCCUCHN, 2=Device/HMCCUDEV, 3=Both
|
# F: 1=Channel/HMCCUCHN, 2=Device/HMCCUDEV, 3=Both
|
||||||
@ -84,8 +87,14 @@ use vars qw(%HMCCU_SCRIPTS);
|
|||||||
'DIMMER_VIRTUAL_RECEIVER' => {
|
'DIMMER_VIRTUAL_RECEIVER' => {
|
||||||
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'on:100,off:0'
|
F => 3, S => 'LEVEL', C => 'LEVEL', V => 'on:100,off:0'
|
||||||
},
|
},
|
||||||
|
'WEATHER' => {
|
||||||
|
F => 3, S => 'TEMPERATURE', C => 'TEMPERATURE', V => ''
|
||||||
|
},
|
||||||
'WEATHER_TRANSMIT' => {
|
'WEATHER_TRANSMIT' => {
|
||||||
F => 1, S => 'TEMPERATURE', C => 'TEMPERATURE', V => ''
|
F => 3, S => 'TEMPERATURE', C => 'TEMPERATURE', V => ''
|
||||||
|
},
|
||||||
|
'CLIMATE_TRANSCEIVER' => {
|
||||||
|
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'ACTUAL_TEMPERATURE', V => ''
|
||||||
},
|
},
|
||||||
'THERMALCONTROL_TRANSMIT' => {
|
'THERMALCONTROL_TRANSMIT' => {
|
||||||
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'SET_TEMPERATURE', V => 'on:30.5,off:4.5'
|
F => 3, S => 'ACTUAL_TEMPERATURE', C => 'SET_TEMPERATURE', V => 'on:30.5,off:4.5'
|
||||||
@ -115,8 +124,15 @@ use vars qw(%HMCCU_SCRIPTS);
|
|||||||
'(CC#\.)?LEVEL$:+pct;(CC#\.)?LEVEL$:+pct',
|
'(CC#\.)?LEVEL$:+pct;(CC#\.)?LEVEL$:+pct',
|
||||||
'DIMMER_VIRTUAL_RECEIVER' =>
|
'DIMMER_VIRTUAL_RECEIVER' =>
|
||||||
'(CC#\.)?LEVEL$:+pct;(CC#\.)?LEVEL$:+pct',
|
'(CC#\.)?LEVEL$:+pct;(CC#\.)?LEVEL$:+pct',
|
||||||
|
'WEATHER' =>
|
||||||
|
'(SC#\.)?TEMPERATURE$:+measured-temp;'.
|
||||||
|
'(SC#\.)?HUMIDITY$:+humidity',
|
||||||
'WEATHER_TRANSMIT' =>
|
'WEATHER_TRANSMIT' =>
|
||||||
'(SC#\.)?TEMPERATURE$:+measured-temp',
|
'(SC#\.)?TEMPERATURE$:+measured-temp;'.
|
||||||
|
'(SC#\.)?HUMIDITY$:+humidity',
|
||||||
|
'CLIMATE_TRANSCEIVER' =>
|
||||||
|
'(SC#\.)?ACTUAL_TEMPERATURE$:+measured-temp;'.
|
||||||
|
'(SC#\.)?ACTUAL_HUMIDITY$:+humidity',
|
||||||
'THERMALCONTROL_TRANSMIT' =>
|
'THERMALCONTROL_TRANSMIT' =>
|
||||||
'(SC#\.)?ACTUAL_TEMPERATURE$:+measured-temp;'.
|
'(SC#\.)?ACTUAL_TEMPERATURE$:+measured-temp;'.
|
||||||
'(SC#\.)?ACTUAL_HUMIDITY$:+humidity;'.
|
'(SC#\.)?ACTUAL_HUMIDITY$:+humidity;'.
|
||||||
@ -268,16 +284,19 @@ use vars qw(%HMCCU_SCRIPTS);
|
|||||||
%HMCCU_ATTR = (
|
%HMCCU_ATTR = (
|
||||||
'BLIND' => {
|
'BLIND' => {
|
||||||
'substexcl' => 'pct',
|
'substexcl' => 'pct',
|
||||||
|
'cmdIcon' => 'open:fts_shutter_up stop:fts_shutter_manual close:fts_shutter_down',
|
||||||
'webCmd' => 'open:close:stop:pct',
|
'webCmd' => 'open:close:stop:pct',
|
||||||
'widgetOverride' => 'pct:slider,0,10,100'
|
'widgetOverride' => 'pct:slider,0,10,100'
|
||||||
},
|
},
|
||||||
'BLIND_VIRTUAL_RECEIVER' => {
|
'BLIND_VIRTUAL_RECEIVER' => {
|
||||||
'substexcl' => 'pct',
|
'substexcl' => 'pct',
|
||||||
|
'cmdIcon' => 'open:fts_shutter_up stop:fts_shutter_manual close:fts_shutter_down',
|
||||||
'webCmd' => 'open:close:stop:pct',
|
'webCmd' => 'open:close:stop:pct',
|
||||||
'widgetOverride' => 'pct:slider,0,10,100'
|
'widgetOverride' => 'pct:slider,0,10,100'
|
||||||
},
|
},
|
||||||
'SHUTTER_VIRTUAL_RECEIVER' => {
|
'SHUTTER_VIRTUAL_RECEIVER' => {
|
||||||
'substexcl' => 'pct',
|
'substexcl' => 'pct',
|
||||||
|
'cmdIcon' => 'open:fts_shutter_up stop:fts_shutter_manual close:fts_shutter_down',
|
||||||
'webCmd' => 'open:close:stop:pct',
|
'webCmd' => 'open:close:stop:pct',
|
||||||
'widgetOverride' => 'pct:slider,0,10,100'
|
'widgetOverride' => 'pct:slider,0,10,100'
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
UPD 2020-11-08_17:25:29 102657 FHEM/88_HMCCURPCPROC.pm
|
UPD 2020-11-12_19:39:34 102657 FHEM/88_HMCCURPCPROC.pm
|
||||||
UPD 2020-11-08_17:25:44 75793 FHEM/HMCCUConf.pm
|
UPD 2020-11-12_19:40:01 76540 FHEM/HMCCUConf.pm
|
||||||
UPD 2020-11-08_17:23:47 39378 FHEM/88_HMCCUCHN.pm
|
UPD 2020-11-12_19:39:14 39378 FHEM/88_HMCCUCHN.pm
|
||||||
UPD 2020-11-08_17:23:36 302150 FHEM/88_HMCCU.pm
|
UPD 2020-11-12_19:39:06 302472 FHEM/88_HMCCU.pm
|
||||||
UPD 2020-11-08_17:23:59 30769 FHEM/88_HMCCUDEV.pm
|
UPD 2020-11-12_19:39:22 30769 FHEM/88_HMCCUDEV.pm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user