From 0a9dafbe81f248c770f57793c860b35ce47c18a8 Mon Sep 17 00:00:00 2001 From: mgehre <> Date: Fri, 28 Jun 2013 17:50:38 +0000 Subject: [PATCH] MAX: fix rounding of readings git-svn-id: https://svn.fhem.de/fhem/trunk@3353 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_MAXLAN.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fhem/FHEM/00_MAXLAN.pm b/fhem/FHEM/00_MAXLAN.pm index 7bd0808dd..4e481230a 100755 --- a/fhem/FHEM/00_MAXLAN.pm +++ b/fhem/FHEM/00_MAXLAN.pm @@ -550,17 +550,17 @@ MAXLAN_Parse($$) my $boostValve = ($boost & 0x1F) * 5; my $boostDuration = $boost >> 5; #There is some trailing data missing, which maps to the weekly program - $comforttemp /= 2.0; #convert to degree celcius - $ecotemp /= 2.0; #convert to degree celcius - $tempoffset = $tempoffset/2.0-3.5; #convert to degree + $comforttemp /= 2.0; #convert to degree celcius + $ecotemp /= 2.0; #convert to degree celcius + $tempoffset = $tempoffset/2.0-3.5; #convert to degree $maxsetpointtemp /= 2.0; $minsetpointtemp /= 2.0; $windowopentemp /= 2.0; $windowopendur *= 5; - $maxvalvesetting *= 100/255; - $valveoffset *= 100/255; - my $decalcDay = ($decalcifiction >> 5) & 0x07; - my $decalcTime = $decalcifiction & 0x1F; + $maxvalvesetting = int($maxvalvesetting*100/255); + $valveoffset = int($valveoffset*100/255); + my $decalcDay = ($decalcifiction >> 5) & 0x07; + my $decalcTime = $decalcifiction & 0x1F; Log $ll5, "comfortemp $comforttemp, ecotemp $ecotemp, boostValve $boostValve, boostDuration $boostDuration, tempoffset $tempoffset, minsetpointtemp $minsetpointtemp, maxsetpointtemp $maxsetpointtemp, windowopentemp $windowopentemp, windowopendur $windowopendur"; Dispatch($hash, "MAX,1,HeatingThermostatConfig,$addr,$ecotemp,$comforttemp,$maxsetpointtemp,$minsetpointtemp,$boostValve,$boostDuration,$tempoffset,$windowopentemp,$windowopendur,$maxvalvesetting,$valveoffset,$decalcDay,$decalcTime,$weekprofile", {RAWMSG => $rmsg});