diff --git a/fhem/FHEM/98_PID.pm b/fhem/FHEM/98_PID.pm index 2fcefed35..8bdc884f4 100644 --- a/fhem/FHEM/98_PID.pm +++ b/fhem/FHEM/98_PID.pm @@ -17,7 +17,7 @@ PID_Initialize($) $hash->{DefFn} = "PID_Define"; $hash->{SetFn} = "PID_Set"; $hash->{NotifyFn} = "PID_Notify"; - $hash->{AttrList} = "disable:0,1 loglevel:0,1,2,3,4,5,6"; + $hash->{AttrList} = "disable:0,1 loglevel:0,1,2,3,4,5,6 roundValveValue:0,1"; } @@ -223,7 +223,8 @@ PID_setValue($) Log GetLogLevel($pn,4), sprintf("PID $pn: p:%.2f i:%.2f d:%.2f", $p, $i, $d); # Hack to round. - $a = int($a) if(($pid->{satMax} - $pid->{satMin}) >= 100); + my ($satMin, $satMax) = ($pid->{satMin}, $pid->{satMax}); + $a = int($a) if(AttrVal($pn, "roundValveValue", ($satMax-$satMin >= 100))); my $ret = fhem sprintf("set %s %s %g", $pid->{actor}, $pid->{command}, $a); Log GetLogLevel($pn,1), "output of $pn command: $ret" if($ret); @@ -304,6 +305,12 @@ PID_setValue($)