From 5a6b15ea829e606583ac17666f4b5b30d711c72a Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 10 Sep 2018 13:07:04 +0000 Subject: [PATCH] fhem.pl: fix oldreadings issue with 0 value (Forum #91003) git-svn-id: https://svn.fhem.de/fhem/trunk@17316 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 63e0a1ea8..7a9ad2159 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -4376,9 +4376,9 @@ setReadingsVal($$$$) { my ($hash,$rname,$val,$ts) = @_; - if( $hash->{".or"} && grep($rname =~ m/^$_$/, @{$hash->{".or"}}) ) { - if( $hash->{READINGS}{$rname} && - $hash->{READINGS}{$rname}{VAL} && + if($hash->{".or"} && grep($rname =~ m/^$_$/, @{$hash->{".or"}}) ) { + if(defined($hash->{READINGS}{$rname}) && + defined($hash->{READINGS}{$rname}{VAL}) && $hash->{READINGS}{$rname}{VAL} ne $val ) { $hash->{OLDREADINGS}{$rname}{VAL} = $hash->{READINGS}{$rname}{VAL}; $hash->{OLDREADINGS}{$rname}{TIME} = $hash->{READINGS}{$rname}{TIME};