diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 6d69ce44c..0ad34f4c5 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -4179,26 +4179,18 @@ readingsBulkUpdate($$$@) if( $eocr && $eocrv[0] =~ m/.*:(.*)/ ) { my $threshold = $1; - my $ov = $value; - $value =~ s/[^\d\.\-eE]//g; # We expect only numbers here. - my $isNum = looks_like_number($value); - if(!$isNum) { # Forum #41083 - $value = $ov; - $value =~ s/[^\d\.\-]//g; - $isNum = looks_like_number($value); - } - if($isNum) { + if($value =~ m/([\d\.\-eE]+)/ && looks_like_number($1)) { #41083, #62190 + my $mv = $1; my $last_value = $hash->{".attreocr-threshold$reading"}; if( !defined($last_value) ) { - $hash->{".attreocr-threshold$reading"} = $value; - } elsif( abs($value-$last_value) < $threshold ) { + $hash->{".attreocr-threshold$reading"} = $mv; + } elsif( abs($mv - $last_value) < $threshold ) { $eocr = 0; } else { - $hash->{".attreocr-threshold$reading"} = $value; + $hash->{".attreocr-threshold$reading"} = $mv; } } - $value = $ov; } # determine if an event should be created: