2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

98_weekprofile: support HMCCUCHN with CCU, msg1181747, #msg1190661

git-svn-id: https://svn.fhem.de/fhem/trunk@25318 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Risiko 2021-12-07 20:01:44 +00:00
parent 881e76524d
commit af191d3d19
2 changed files with 17 additions and 14 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # Do not insert empty lines here, update check depends on it.
- feature: 98_weekprofile: support HMCCUCHN with CCU
- change: 22_HOMEMODE: adapt new help anchors - change: 22_HOMEMODE: adapt new help anchors
- change: 77_UWZ: support for https connection - change: 77_UWZ: support for https connection
- feature: 73_NUKIBridge 74_NUKIDevice: new modul structure and rewrite code, - feature: 73_NUKIBridge 74_NUKIDevice: new modul structure and rewrite code,

View File

@ -29,7 +29,7 @@ my @shortDays = ("Mon","Tue","Wed","Thu","Fri","Sat","Sun");
my %LAST_SEND; my %LAST_SEND;
my @DEVLIST_SEND = ("MAX","CUL_HM","HMCCUDEV","weekprofile","dummyWT","WeekdayTimer","MQTT2_DEVICE"); my @DEVLIST_SEND = ("MAX","CUL_HM","HMCCUDEV","HMCCUCHN","weekprofile","dummyWT","WeekdayTimer","MQTT2_DEVICE");
my $CONFIG_VERSION = "1.1"; my $CONFIG_VERSION = "1.1";
@ -52,7 +52,8 @@ $DEV_READINGS{"Fri"}{"CUL_HM"} = "6_tempListFri";
$DEV_READINGS{"Sat"}{"CUL_HM"} = "0_tempListSat"; $DEV_READINGS{"Sat"}{"CUL_HM"} = "0_tempListSat";
$DEV_READINGS{"Sun"}{"CUL_HM"} = "1_tempListSun"; $DEV_READINGS{"Sun"}{"CUL_HM"} = "1_tempListSun";
# HMCCUDEV HMIP # TYPE=HMCCUDEV or HMCCUCHN
# ccutype=HmIP.*
$DEV_READINGS{"Mon"}{"HMCCU_IP"} = "MONDAY"; $DEV_READINGS{"Mon"}{"HMCCU_IP"} = "MONDAY";
$DEV_READINGS{"Tue"}{"HMCCU_IP"} = "TUESDAY"; $DEV_READINGS{"Tue"}{"HMCCU_IP"} = "TUESDAY";
$DEV_READINGS{"Wed"}{"HMCCU_IP"} = "WEDNESDAY"; $DEV_READINGS{"Wed"}{"HMCCU_IP"} = "WEDNESDAY";
@ -61,7 +62,8 @@ $DEV_READINGS{"Fri"}{"HMCCU_IP"} = "FRIDAY";
$DEV_READINGS{"Sat"}{"HMCCU_IP"} = "SATURDAY"; $DEV_READINGS{"Sat"}{"HMCCU_IP"} = "SATURDAY";
$DEV_READINGS{"Sun"}{"HMCCU_IP"} = "SUNDAY"; $DEV_READINGS{"Sun"}{"HMCCU_IP"} = "SUNDAY";
# HMCCUDEV HM # TYPE=HMCCUDEV or HMCCUCHN
# ccutype = HM-.*
$DEV_READINGS{"Mon"}{"HMCCU_HM"} = "MONDAY"; $DEV_READINGS{"Mon"}{"HMCCU_HM"} = "MONDAY";
$DEV_READINGS{"Tue"}{"HMCCU_HM"} = "TUESDAY"; $DEV_READINGS{"Tue"}{"HMCCU_HM"} = "TUESDAY";
$DEV_READINGS{"Wed"}{"HMCCU_HM"} = "WEDNESDAY"; $DEV_READINGS{"Wed"}{"HMCCU_HM"} = "WEDNESDAY";
@ -169,7 +171,7 @@ sub weekprofile_getDeviceType($$;$)
elsif ( ($devType =~ /MAX/) && ($devHash->{type} =~ /.*Thermostat.*/) ){ elsif ( ($devType =~ /MAX/) && ($devHash->{type} =~ /.*Thermostat.*/) ){
$type = "MAX"; $type = "MAX";
} }
elsif ( $devType =~ /HMCCUDEV/){ elsif ( $devType =~ /HMCCUDEV/ or $devType =~/HMCCUCHN/){
my $readonly = AttrVal($device,"readOnly",0); my $readonly = AttrVal($device,"readOnly",0);
if ($readonly) { if ($readonly) {
Log3($me, 4, "$me(getDeviceType): $devHash->{NAME} is readonly - ignored"); Log3($me, 4, "$me(getDeviceType): $devHash->{NAME} is readonly - ignored");
@ -182,9 +184,9 @@ sub weekprofile_getDeviceType($$;$)
return undef if (!defined($model)); return undef if (!defined($model));
} }
Log3($me, 5, "$me(getDeviceType): $devHash->{NAME}, $model"); Log3($me, 5, "$me(getDeviceType): $devHash->{NAME}, $model");
$type = "HMCCU_IP" if ( $model =~ m/HmIP.*/ ); $type = "HMCCU_IP" if ( $model =~ m/HmIP.*/ );
$type = "HMCCU_HM" if ( $model =~ m/HM-.*/ ); $type = "HMCCU_HM" if ( $model =~ m/HM-.*/ );
} }
return $type if ($sndrcv eq "RCV"); return $type if ($sndrcv eq "RCV");
@ -457,7 +459,7 @@ sub weekprofile_sendDevProfile(@)
eval { $prfData = $json->decode($json_text) }; eval { $prfData = $json->decode($json_text) };
} }
my $cmd; my $cmd="";
if($type eq "MAX") { if($type eq "MAX") {
$cmd = "set $device weekProfile "; $cmd = "set $device weekProfile ";
foreach my $day (@dayToTransfer){ foreach my $day (@dayToTransfer){
@ -488,13 +490,12 @@ sub weekprofile_sendDevProfile(@)
$k++; $k++;
} }
} elsif ($type =~ /HMCCU.*/){ } elsif ($type =~ /HMCCU.*/){
$cmd .= "set $device config" if ($type eq "HMCCU_HM"); $cmd .= "set $device config device" if ($type eq "HMCCU_HM");
$cmd .= "set $device config 1" if ($type eq "HMCCU_IP"); $cmd .= "set $device config 1" if ($type eq "HMCCU_IP");
my $k=0; my $k=0;
my $dayCnt = scalar(@dayToTransfer); my $dayCnt = scalar(@dayToTransfer);
my $prefix = weekprofile_get_prefix_HM($device,"ENDTIME_SUNDAY_1",$me); my $prefix = weekprofile_get_prefix_HM($device,"ENDTIME_SUNDAY_1",$me);
$prefix = "" if ($type eq "HMCCU_HM"); # no prefix by set see topic,46117.msg1104569.html#msg1104569 $prefix = ""; # always no prefix by set #msg1113658
$prefix = ""; # TEST always no prefix by set #msg1113658
if (!defined($prefix)) { if (!defined($prefix)) {
Log3($me, 3, "$me(sendDevProfile): no prefix found"); Log3($me, 3, "$me(sendDevProfile): no prefix found");
$prefix = ""; $prefix = "";
@ -508,6 +509,7 @@ sub weekprofile_sendDevProfile(@)
for (my $i = 0; $i < $tmpCnt; $i++) { for (my $i = 0; $i < $tmpCnt; $i++) {
$cmd .= " " . $dpTemp . "_" . ($i + 1) . "=" . $prfData->{$day}->{"temp"}[$i]; $cmd .= " " . $dpTemp . "_" . ($i + 1) . "=" . $prfData->{$day}->{"temp"}[$i];
$cmd .= " " . $dpTime . "_" . ($i + 1) . "=" . weekprofile_timeToMinutes($prfData->{$day}->{"time"}[$i]); $cmd .= " " . $dpTime . "_" . ($i + 1) . "=" . weekprofile_timeToMinutes($prfData->{$day}->{"time"}[$i]);
$cmd .= ":" if ($type eq "HMCCU_HM"); # ':' after time see #msg1191311
} }
$k++; $k++;
} }
@ -1778,8 +1780,8 @@ __END__
Currently the following devices will by supported:<br> Currently the following devices will by supported:<br>
<li>MAX</li> <li>MAX</li>
<li>other weekprofile modules</li> <li>other weekprofile modules</li>
<li>Homematic channel _Clima or _Climate</li> <li>Homematic via HM_CUL and channel _Clima or _Climate</li>
<li>Homematic via HMCCU and HM-IP)</li> <li>Homematic via HMCCUDEV, HMCCUCHN)</li>
<br> <br>
Additionally, also the following module types can be used as logical intermediates<br> Additionally, also the following module types can be used as logical intermediates<br>
<li>WeekdayTimer</li> <li>WeekdayTimer</li>
@ -2020,8 +2022,8 @@ __END__
übertragen werden. Aktuell wird folgende Hardware unterstützt: übertragen werden. Aktuell wird folgende Hardware unterstützt:
<li>alle MAX Thermostate</li> <li>alle MAX Thermostate</li>
<li>andere weekprofile Module</li> <li>andere weekprofile Module</li>
<li>Homematic (Kanal _Clima bzw. _Climate)</li> <li>Homematic via CUL_HM (Kanal _Clima bzw. _Climate)</li>
<li>Homematic via HMCCU und HM-IP</li> <li>Homematic via HMCCUDEV und HMCCUCHN</li>
<br> <br>
Weiter können die folgenden Modul-Typen als logische Zwischenschicht eingesetzt werden:<br> Weiter können die folgenden Modul-Typen als logische Zwischenschicht eingesetzt werden:<br>
<li>WeekdayTimer</li> <li>WeekdayTimer</li>