From bb02a5e95179bcd2048a1bfaf6c870ea5e4938b1 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Mon, 3 Nov 2014 22:25:33 +0000 Subject: [PATCH] fhem.pl: event-on-change-reading patch by justme1968 (Forum #24378) git-svn-id: https://svn.fhem.de/fhem/trunk@6880 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 2e33a8cce..295623569 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -3653,12 +3653,13 @@ readingsBulkUpdate($$$@) my $threshold_reached = 1; if( $eocr && $eocrv[0] =~ m/.*:(.*)/ ) { + my $threshold = $1; $value =~ s/[^\d\.\-]//g; # We expect only numbers here. my $last_value = $hash->{".attreocr-threshold$reading"}; if( !defined($last_value) ) { $hash->{".attreocr-threshold$reading"} = $value; - } elsif( abs($value-$last_value) < $1 ) { + } elsif( abs($value-$last_value) < $threshold ) { $threshold_reached = 0; } else { $hash->{".attreocr-threshold$reading"} = $value;