mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 13:26:02 +00:00
13_KS300.pm: strangeDiffTemp attribute for sanitizing corrupted data
git-svn-id: https://svn.fhem.de/fhem/trunk@19945 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
afbde208cc
commit
b118af93dc
@ -28,9 +28,18 @@ KS300_Initialize($)
|
|||||||
$hash->{DefFn} = "KS300_Define";
|
$hash->{DefFn} = "KS300_Define";
|
||||||
$hash->{UndefFn} = "KS300_Undef";
|
$hash->{UndefFn} = "KS300_Undef";
|
||||||
$hash->{ParseFn} = "KS300_Parse";
|
$hash->{ParseFn} = "KS300_Parse";
|
||||||
$hash->{AttrList} = "IODev do_not_notify:0,1 showtime:0,1 model:ks300 ".
|
no warnings 'qw';
|
||||||
"rainadjustment:0,1 ignore:0,1 ".
|
my @attrList = qw(
|
||||||
$readingFnAttributes;
|
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}=
|
$hash->{AutoCreate}=
|
||||||
{ "KS300.*" => {
|
{ "KS300.*" => {
|
||||||
GPLOT => "temp4rain10:Temp/Rain,hum6wind8:Wind/Hum,",
|
GPLOT => "temp4rain10:Temp/Rain,hum6wind8:Wind/Hum,",
|
||||||
@ -202,6 +211,12 @@ KS300_Parse($$)
|
|||||||
$v[8] = $a[17];
|
$v[8] = $a[17];
|
||||||
$v[9] = KS300_windIndex($v[2]);
|
$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
|
# Negative temp
|
||||||
$v[4] = -$v[4] if(hex($v[8]) & 8);
|
$v[4] = -$v[4] if(hex($v[8]) & 8);
|
||||||
|
|
||||||
@ -375,6 +390,10 @@ KS300_windIndex($)
|
|||||||
<li><a href="#do_not_notify">do_not_notify</a></li>
|
<li><a href="#do_not_notify">do_not_notify</a></li>
|
||||||
<li><a href="#showtime">showtime</a></li>
|
<li><a href="#showtime">showtime</a></li>
|
||||||
<li><a href="#model">model</a> (ks300)</li>
|
<li><a href="#model">model</a> (ks300)</li>
|
||||||
|
<li>strangeTempDiff DIFFVAL<br>
|
||||||
|
If set, the module will only accept data where the difference between
|
||||||
|
the reported temperature and tha last recorded value is less than
|
||||||
|
DIFFVAL.</li>
|
||||||
<li>rainadjustment<br>
|
<li>rainadjustment<br>
|
||||||
If this attribute is set, fhem automatically considers rain counter
|
If this attribute is set, fhem automatically considers rain counter
|
||||||
resets after a battery change and random counter switches as
|
resets after a battery change and random counter switches as
|
||||||
@ -444,6 +463,10 @@ KS300_windIndex($)
|
|||||||
berücksichtigt. Resets treten beim Wechsel der Batterie und nach
|
berücksichtigt. Resets treten beim Wechsel der Batterie und nach
|
||||||
Beobachtung einiger Benutzer auch nach zufälligen Schaltzyklen
|
Beobachtung einiger Benutzer auch nach zufälligen Schaltzyklen
|
||||||
auf. Die Voreinstellung ist 0 (aus).</li>
|
auf. Die Voreinstellung ist 0 (aus).</li>
|
||||||
|
<li>strangeTempDiff DIFFVAL<br>
|
||||||
|
Falls gesetzt, werden nur solche Telegramme akzeptiert, wo der
|
||||||
|
Unterschied bei der gemeldeten Temperatur zum letzten Wert weniger als
|
||||||
|
DIFFVAL ist. </li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user