From ac7b72af013015692029a5453bcf2c5d607bdced Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 7 Sep 2013 11:58:33 +0000 Subject: [PATCH] fhem.pl: userReadings patch by justme1968 git-svn-id: https://svn.fhem.de/fhem/trunk@3872 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 6725790d5..1593393c1 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -2713,7 +2713,7 @@ Dispatch($$$) my $iohash = $modules{$hash->{TYPE}}; # The phyiscal device module pointer my $name = $hash->{NAME}; - Log 5, "$name dispatch $dmsg"; + Log3 $hash, 5, "$name dispatch $dmsg"; my ($isdup, $idx) = CheckDuplicate($name, $dmsg, $iohash->{FingerprintFn}); return rejectDuplicate($name,$idx,$addvals) if($isdup); @@ -3336,12 +3336,12 @@ readingsEndUpdate($$) $result= $deltav/$deltat; } } elsif($modifier eq "offset") { - $oldvalue= 0 if( !defined($oldvalue) ); + $oldvalue = $value if( !defined($oldvalue) ); $result = ReadingsVal($name,$userReading,0); $result += $oldvalue if( $value < $oldvalue ); } elsif($modifier eq "monotonic") { - $oldvalue= 0 if( !defined($oldvalue) ); - $result = ReadingsVal($name,$userReading,0); + $oldvalue = $value if( !defined($oldvalue) ); + $result = ReadingsVal($name,$userReading,$value); $result += $value - $oldvalue if( $value > $oldvalue ); } readingsBulkUpdate($hash,$userReading,$result,1) if(defined($result));