diff --git a/fhem/FHEM/23_LUXTRONIK2.pm b/fhem/FHEM/23_LUXTRONIK2.pm index 218e3b7bd..5878c9c9b 100644 --- a/fhem/FHEM/23_LUXTRONIK2.pm +++ b/fhem/FHEM/23_LUXTRONIK2.pm @@ -1,4 +1,4 @@ -############################################################### +############################################################### # $Id$Date: $ # # 23_LUXTRONIK2.pm @@ -8,7 +8,7 @@ # # Copyright notice # -# The modul reads and writes parameters of the heat pump controller +# The module reads and writes parameters of the heat pump controller # Luxtronik 2.0 used in Alpha Innotec and Siemens Novelan (WPR NET) heat pumps. # # This script is free software; you can redistribute it and/or modify @@ -85,7 +85,7 @@ LUXTRONIK2_Initialize($) "autoSynchClock:slider,10,5,300 ". "boilerVolumn ". "compressor2ElectricalPowerWatt ". - "doStatistics:0,1 ". + "doStatistics:0,1,2 ". "heatPumpElectricalPowerFactor ". "heatPumpElectricalPowerWatt ". "heatRodElectricalPowerWatt ". @@ -289,7 +289,7 @@ LUXTRONIK2_Set($$@) $hash->{LOCAL} = 0; return $resultStr; } - elsif( int(@_)==4 && $cmd eq 'hotWaterCircPumpDeaerate' ) { # Einstellung->Entlüftung + elsif( int(@_)==4 && $cmd eq 'hotWaterCircPumpDeaerate' ) { # Einstellung->Entlüftung Log3 $name, 3, "set $name $cmd $val"; return "$name Error: Wrong parameter given for opModeHotWater, use Automatik,Party,Off" if $val !~ /on|off/; @@ -598,9 +598,9 @@ sub LUXTRONIK2_DoUpdate($) $rName = "userValue$rIndex" if $rName eq ""; $return_str .= $rName." ".$heatpump_values[$rIndex]; } - # 77 - VentSupplyAirTemp + # 77 - VentSupplyAirTemperature $return_str .= "|".($heatpump_visibility[264]==1 ? $heatpump_values[159] : "no");; - # 78 - VentExhaustAirTemp + # 78 - VentExhaustAirTemperature $return_str .= "|".($heatpump_visibility[265]==1 ? $heatpump_values[160] : "no");; # 79 - opModeVentilation $return_str .= "|".($heatpump_visibility[4]==1 ? $heatpump_parameters[894] : "no");; @@ -696,7 +696,7 @@ LUXTRONIK2_UpdateDone($) my %ventMode = ( 0 => "Automatik", 1 => "Party", - 2 => "Feuchte", + 2 => "Feuchteschutz", 3 => "Aus"); my $counterRetry = $hash->{fhem}{counterRetry}; @@ -782,8 +782,13 @@ LUXTRONIK2_UpdateDone($) } - # if selected, do all the statistic calculations + # if attribute doStatistic = 1 do all the statistic calculations + # if attribute doStatistic = 2 do only those statistic calculations not included in FHEM Module statistics if ( $doStatistic == 1) { + # LUXTRONIK2_doStatisticMinMax $hash, $readingName, $value + LUXTRONIK2_doStatisticMinMax ( $hash, "statAmbientTemp", $ambientTemperature); + } + if ( $doStatistic >= 1) { #LUXTRONIK2_doStatisticBoilerHeatUp $hash, $currOpHours, $currHQ, $currTemp, $opState, $target $value = LUXTRONIK2_doStatisticBoilerHeatUp ($hash, $a[35], $a[37]/10, $hotWaterTemperature, $opStateHeatPump3,$hotWaterTemperatureTarget); if ($value ne "") { @@ -814,12 +819,7 @@ LUXTRONIK2_UpdateDone($) if ($value ne "") { readingsBulkUpdate($hash,"statThermalPowerBoiler",$value); } $value = LUXTRONIK2_doStatisticThermalPower ($hash, 0, $opStateHeatPump3, $a[36]/10, $a[34], $ambientTemperature, $heatSourceIN, $returnTemperatureTarget, $heatPumpPower); if ($value ne "") { readingsBulkUpdate($hash,"statThermalPowerHeating",$value); } - - # LUXTRONIK2_doStatisticMinMax $hash, $readingName, $value - LUXTRONIK2_doStatisticMinMax ( $hash, "statAmbientTemp", $ambientTemperature); - } - #Operating status of heat pump my $opStateHeatPump1 = $wpOpStat1{$a[2]}; ############## $opStateHeatPump1 = "unbekannt (".$a[2].")" unless $opStateHeatPump1; @@ -893,7 +893,7 @@ LUXTRONIK2_UpdateDone($) readingsBulkUpdate($hash,"opStateHeating",$value); # Ventilation operating mode - if ( $a[79] ne "no" ) { + if ( $a[79] !~ /no/ ) { $value = $ventMode{$a[79]}; $value = "unbekannt (".$a[79].")" unless $value; readingsBulkUpdate($hash,"opModeVentilation",$value); @@ -913,6 +913,7 @@ LUXTRONIK2_UpdateDone($) $hash->{fhem}{defrost}{hsIn} = $heatSourceIN; $hash->{fhem}{defrost}{hsOut} = $heatSourceOUT; } + # Defrost-Readings erstellen elsif ( $hash->{fhem}{defrost}{mode} ne "none" ) { my $value = "Mode: " . $hash->{fhem}{defrost}{mode} . " Time: "; $value .= strftime ( "%M:%S", localtime( time() - $hash->{fhem}{defrost}{startTime} ) ); @@ -920,7 +921,16 @@ LUXTRONIK2_UpdateDone($) $value .= " hsIN: ".$hash->{fhem}{defrost}{hsInStart} . " - ". $hash->{fhem}{defrost}{hsIn}; #$value .= " hsOUT: ".$hash->{fhem}{defrost}{hsOutStart} . " - ". $heatSourceOUT; readingsBulkUpdate( $hash, "heatSourceDefrostLast", $value); + + my $rName = "heatSourceDefrostCounter"; + $rName .= "Air" if $hash->{fhem}{defrost}{mode} eq "air"; + $rName .= "Reverse" if $hash->{fhem}{defrost}{mode} eq "reverse"; + my $rValue = ReadingsVal ( $name, $rName, 0 ) + 1; + readingsBulkUpdate ( $hash, $rName, 0 ) if $rValue == 1; #for statistics module + readingsBulkUpdate ( $hash, $rName, $rValue ); + $hash->{fhem}{defrost}{mode} = "none"; + # 16 => "Durchflussueberwachung" if ($opStateHeatPump3 == 16) { readingsBulkUpdate( $hash, "heatSourceDefrostLastTimeout", "Amb: ".$hash->{fhem}{defrost}{amb}." hsIN: ".$hash->{fhem}{defrost}{hsIn}." hsOUT: ".$hash->{fhem}{defrost}{hsOut}); @@ -986,8 +996,8 @@ LUXTRONIK2_UpdateDone($) if ($a[58] !~ /no/) {readingsBulkUpdate( $hash, "mixer2TargetTemperature",LUXTRONIK2_CalcTemp($a[58]));} if ($a[59] !~ /no/) {readingsBulkUpdate( $hash, "mixer3FlowTemperature",LUXTRONIK2_CalcTemp($a[59]));} if ($a[60] !~ /no/) {readingsBulkUpdate( $hash, "mixer3TargetTemperature",LUXTRONIK2_CalcTemp($a[60]));} - if ($a[77] !~ /no/) {readingsBulkUpdate( $hash, "VentSupplyAirTemperature",LUXTRONIK2_CalcTemp($a[77]));} - if ($a[78] !~ /no/) {readingsBulkUpdate( $hash, "VentExhaustAirTemperature",LUXTRONIK2_CalcTemp($a[78]));} + if ($a[77] !~ /no/) {readingsBulkUpdate( $hash, "ventSupplyAirTemperature",LUXTRONIK2_CalcTemp($a[77]));} + if ($a[78] !~ /no/) {readingsBulkUpdate( $hash, "ventExhaustAirTemperature",LUXTRONIK2_CalcTemp($a[78]));} # Operating hours (seconds->hours) and heat quantities # LUXTRONIK2_storeReadings: $hash, $readingName, $value, $factor, $doStatistic, $electricalPower @@ -1071,7 +1081,7 @@ LUXTRONIK2_UpdateDone($) # $defrostValve = $a[67]; #AVout # $hotWaterBoilerValve = $a[9]; #BUP # $heatingSystemCircPump = $a[27]; #HUP - # 0=Heizen, 1=keine Anforderung, 3=Schaltspielzeit, 5=Brauchwasser, 7=Abtauen, 16=Durchflussüberwachung + # 0=Heizen, 1=keine Anforderung, 3=Schaltspielzeit, 5=Brauchwasser, 7=Abtauen, 16=Durchflussüberwachung my $lastHeatingCycle = ReadingsVal($name, "heatingCycle", ""); if ( $opStateHeatPump3 == 0 ) { readingsBulkUpdate($hash, "heatingCycle", "running"); @@ -1827,7 +1837,7 @@ LUXTRONIK2_doStatisticBoilerHeatUp ($$$$$$) #real (mixed) Temperature-Difference my $boilerVolumn = AttrVal($name, "boilerVolumn", 0); if ($boilerVolumn >0 ) { - # (delta T) [K] = Wärmemenge [kWh] / #Volumen [l] * ( 3.600 [kJ/kWh] / ( 4,179 [kJ/(kg*K)] (H2O Wärmekapazität bei 40°C) * 0,992 [kg/l] (H2O Dichte bei 40°C) ) [K/(kWh*l)] ) + # (delta T) [K] = Wärmemenge [kWh] / #Volumen [l] * ( 3.600 [kJ/kWh] / ( 4,179 [kJ/(kg*K)] (H2O Wärmekapazität bei 40°C) * 0,992 [kg/l] (H2O Dichte bei 40°C) ) [K/(kWh*l)] ) $value2 = 868.4 * $value3 / $boilerVolumn ; $returnStr .= sprintf " realDT: %.0f", $value2; } @@ -1907,8 +1917,8 @@ LUXTRONIK2_doStatisticBoilerCoolDown ($$$$$$) } # Calculates single MaxMin Values and informs about end of day and month -sub ######################################## -LUXTRONIK2_doStatisticMinMax ($$$) +######################################## +sub LUXTRONIK2_doStatisticMinMax ($$$) { my ($hash, $readingName, $value) = @_; my $dummy; @@ -2007,10 +2017,10 @@ LUXTRONIK2_doStatisticMinMaxSingle ($$$$) return; } -sub ######################################## -LUXTRONIK2_storeReadings($$$$$$) +######################################## +sub LUXTRONIK2_storeReadings($$$$$$) { - my ($hash, $readingName, $value, $factor, $doStatistics, $electricalPower) = @_; + my ($hash, $readingName, $value, $factor, $doStatistic, $electricalPower) = @_; if ($value eq "no" || $value == 0 ) { return; } @@ -2019,12 +2029,12 @@ LUXTRONIK2_storeReadings($$$$$$) $readingName =~ s/counter//; # LUXTRONIK2_doStatisticDelta: $hash, $readingName, $value, $factor, $electricalPower - if ( $doStatistics == 1) { LUXTRONIK2_doStatisticDelta $hash, "stat".$readingName, $value, $factor, $electricalPower; } + if ( $doStatistic == 1) { LUXTRONIK2_doStatisticDelta $hash, "stat".$readingName, $value, $factor, $electricalPower; } } # Calculates deltas for day, month and year -sub ######################################## -LUXTRONIK2_doStatisticDelta ($$$$$) +######################################## +sub LUXTRONIK2_doStatisticDelta ($$$$$) { my ($hash, $readingName, $value, $factor, $electricalPower) = @_; my $name = $hash->{NAME}; @@ -2182,8 +2192,8 @@ LUXTRONIK2_doStatisticDeltaSingle ($$$$$$$) =pod =item device -=item summary Connects with a Luxtronik 2.0 controller for heat pumps -=item summary_DE Verbindet mit einer Luxtronik 2.0 Heizungssteuerung für Wärmepumpen. +=item summary Connects with a Luxtronik 2.0 controller for heat pumps. +=item summary_DE Verbindet mit einer Luxtronik 2.0 Heizungssteuerung für Wärmepumpen. =begin html @@ -2194,7 +2204,7 @@ LUXTRONIK2_doStatisticDeltaSingle ($$$$$$$) Luxtronik 2.0 and 2.1 is a heating controller from Alpha InnoTec (AIT) used in heat pumps of Alpha InnoTec, Buderus (Logamatic HMC20, HMC20 Z), CTA All-In-One (Aeroplus), Elco, Nibe (AP-AW10), Roth (ThermoAura®, ThermoTerra), Novelan (WPR NET) and Wolf Heiztechnik (BWL/BWS).
It has a built-in ethernet (RJ45) port, so it can be directly integrated into a local area network (LAN).
- The modul is reported to work with firmware: V1.51, V1.54C, V1.60, V1.64, V1.69, V1.70, V1.73, V1.77, V1.80, V1.81. + The module is reported to work with firmware: V1.51, V1.54C, V1.60, V1.64, V1.69, V1.70, V1.73, V1.77, V1.80, V1.81.
More Info on the particular page of FHEM-Wiki (in German).
@@ -2218,7 +2228,7 @@ LUXTRONIK2_doStatisticDeltaSingle ($$$$$$$)