diff --git a/FHEM/13_KS300.pm b/FHEM/13_KS300.pm index f924ed0d2..dc3176cbf 100644 --- a/FHEM/13_KS300.pm +++ b/FHEM/13_KS300.pm @@ -28,9 +28,18 @@ KS300_Initialize($) $hash->{DefFn} = "KS300_Define"; $hash->{UndefFn} = "KS300_Undef"; $hash->{ParseFn} = "KS300_Parse"; - $hash->{AttrList} = "IODev do_not_notify:0,1 showtime:0,1 model:ks300 ". - "rainadjustment:0,1 ignore:0,1 ". - $readingFnAttributes; + no warnings 'qw'; + my @attrList = qw( + IODev + do_not_notify:0,1 + ignore:0,1 + model:ks300 + rainadjustment:0,1 + strangeTempDiff + showtime:0,1 + ); + use warnings 'qw'; + $hash->{AttrList} = join(" ", @attrList)." ".$readingFnAttributes; $hash->{AutoCreate}= { "KS300.*" => { GPLOT => "temp4rain10:Temp/Rain,hum6wind8:Wind/Hum,", @@ -202,6 +211,12 @@ KS300_Parse($$) $v[8] = $a[17]; $v[9] = KS300_windIndex($v[2]); + my $std = AttrVal($name, "strangeTempDiff", 0); + if($std) { + my $ov = ReadingsVal($name, 'temperature', 0); + return "" if($ov && abs($ov-$v[4]) > $std); + } + # Negative temp $v[4] = -$v[4] if(hex($v[8]) & 8); @@ -375,6 +390,10 @@ KS300_windIndex($)