mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-29 05:24:10 +00:00
14_CUL_WS: pressure check by HomeAuto_User (Forum #80216)
git-svn-id: https://svn.fhem.de/fhem/trunk@15513 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d481b28f0d
commit
d86afd5918
@ -291,23 +291,32 @@ CUL_WS_Parse($$)
|
|||||||
Log3 $name, 4, "CUL_WS $devtype $name: $val";
|
Log3 $name, 4, "CUL_WS $devtype $name: $val";
|
||||||
|
|
||||||
# Sanity checks
|
# Sanity checks
|
||||||
if($NotifyTemperature &&
|
if($NotifyTemperature && ReadingsVal($name, "temperature", undef)) {
|
||||||
$hash->{READINGS}{temperature} &&
|
my $tval = ReadingsVal($name, "strangetemp",
|
||||||
$hash->{READINGS}{temperature}{VAL}) {
|
ReadingsVal($name, "temperature", undef));
|
||||||
my $tval = $hash->{READINGS}{strangetemp} ?
|
|
||||||
$hash->{READINGS}{strangetemp}{VAL} :
|
|
||||||
$hash->{READINGS}{temperature}{VAL};
|
|
||||||
my $diff = ($NotifyTemperature - $tval)+0;
|
my $diff = ($NotifyTemperature - $tval)+0;
|
||||||
if($diff < -15.0 || $diff > 15.0) {
|
if($diff < -15.0 || $diff > 15.0) {
|
||||||
Log3 $name, 2,
|
Log3 $name, 2,
|
||||||
"$name: Temp difference ($diff) too large: $val, skipping it";
|
"$name: Temp difference ($diff) too large: $val, skipping it";
|
||||||
$hash->{READINGS}{strangetemp}{VAL} = $NotifyTemperature;
|
readingsSingleUpdate($name, "strangetemp", $NotifyTemperature, 0);
|
||||||
$hash->{READINGS}{strangetemp}{TIME} = TimeNow();
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete $hash->{READINGS}{strangetemp} if($hash->{READINGS});
|
delete $hash->{READINGS}{strangetemp} if($hash->{READINGS});
|
||||||
|
|
||||||
|
if($NotifyPressure && ReadingsVal($name, "pressure", undef)) {
|
||||||
|
my $tval = ReadingsVal($name, "strangepress",
|
||||||
|
ReadingsVal($name, "pressure", undef));
|
||||||
|
my $diff = ($NotifyPressure - $tval)+0;
|
||||||
|
if($diff < -10.0 || $diff > 10.0) {
|
||||||
|
Log3 $name, 2,
|
||||||
|
"$name: Pressure difference ($diff) too large: $val, skipping it";
|
||||||
|
readingsSingleUpdate($name, "strangepress", $NotifyPressure, 0);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete $hash->{READINGS}{strangepress} if($hash->{READINGS});
|
||||||
|
|
||||||
if(defined($hum) && ($hum < 0 || $hum > 100)) {
|
if(defined($hum) && ($hum < 0 || $hum > 100)) {
|
||||||
Log3 $name, 1, "BOGUS: $name reading: $val, skipping it";
|
Log3 $name, 1, "BOGUS: $name reading: $val, skipping it";
|
||||||
return "";
|
return "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user