From fdfc19b420e16af8d1ce9b1e39ee788d9a1db6be Mon Sep 17 00:00:00 2001 From: jamesgo Date: Thu, 31 Dec 2020 10:22:26 +0000 Subject: [PATCH] =?UTF-8?q?94=5FPWM.pm=20:=20maxOffTime=20fix=20f=C3=BCr?= =?UTF-8?q?=20P-Regler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.fhem.de/fhem/trunk@23441 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/94_PWM.pm | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/fhem/FHEM/94_PWM.pm b/fhem/FHEM/94_PWM.pm index 23bef1fba..459abf901 100644 --- a/fhem/FHEM/94_PWM.pm +++ b/fhem/FHEM/94_PWM.pm @@ -37,6 +37,7 @@ # 30.12.19 GA fix access to ReadingsVal via $name (reported by stromer-12) # 26.05.20 GA fix division by zero if minRoomsOn is >0 and roomsCounted is zero # 22.12.20 GA fix maxOffTime for P calculation never activated +# 28.12.20 GA fix maxOffTime; maxOffTimeApply is now only set if no heating is required ############################################## # $Id$ @@ -902,28 +903,28 @@ PWM_CalcRoom(@) return ("on", $newpulse, $cycletime, $actorV); } - if ($newpulse == 0 or ($maxOffTimeApply > 0 and $room->{c_PID_useit} eq 0)) { + # ---------------- + # check if maxOffTime protection is activated (attribute maxOffTimeIdlePeriod is set) + # $maxOffTImeApply will only be set if no heating is required - # ---------------- - # check if maxOffTime protection is activated (attribute maxOffTimeIdlePeriod is set) + if ($maxOffTimeApply > 0 and ReadingsVal($name, "maxOffTimeCalculation", "off") eq "on") { - if ($maxOffTimeApply > 0 and ReadingsVal($name, "maxOffTimeCalculation", "off") eq "on") { + ## wz > 2:00 + if ($maxOffTimeAct >= $maxOffTime) { - ## wz > 2:00 - if ($maxOffTimeAct >= $maxOffTime) { - - Log3 ($hash, 3, "PWM_CalcRoom $room->{NAME}: F17 maxOffTime protection"); - return ("on_mop", $newpulse, $cycletime, $actorV); - } - - ## wz > 2:00 / 2 - if ($maxOffTimeAct >= $maxOffTime / 2) { - - Log3 ($hash, 3, "PWM_CalcRoom $room->{NAME}: F18 maxOffTime protection (possible)"); - return ("on_mop_maybe", $newpulse, $cycletime, $actorV); - } + Log3 ($hash, 3, "PWM_CalcRoom $room->{NAME}: F17 maxOffTime protection"); + return ("on_mop", $newpulse, $cycletime, $actorV); } + ## wz > 2:00 / 2 + if ($maxOffTimeAct >= $maxOffTime / 2) { + + Log3 ($hash, 3, "PWM_CalcRoom $room->{NAME}: F18 maxOffTime protection (possible)"); + return ("on_mop_maybe", $newpulse, $cycletime, $actorV); + } + } + + if ($newpulse == 0) { Log3 ($hash, 3, "PWM_CalcRoom $room->{NAME}: F11 stay off (0)"); return ("", $newpulse, $cycletime, $actorV); }