2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

FHEM/14_CUL_WS.pm: Some more safety checks for the S300TH

git-svn-id: https://svn.fhem.de/fhem/trunk@10794 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-02-11 06:26:06 +00:00
parent c497ff4f0c
commit 3ac7063ea0

View File

@ -269,15 +269,17 @@ CUL_WS_Parse($$)
$NotifyIsRaining=$ir;
} elsif(int(@a) > 8) { # WS7000 Temp/Hum sensors
$sgn = ($firstbyte&8) ? -1 : 1;
$tmp = $sgn * ($a[6].$a[3].".".$a[4]) + $hash->{corr1};
$hum = ($a[7].$a[8].".".$a[5]) + $hash->{corr2};
$val = "T: $tmp H: $hum";
$devtype = "TH".$sfirstbyte;
$family = "WS7000";
$NotifyType="T H";
$NotifyTemperature=$tmp;
$NotifyHumidity=$hum;
if(join("", @a[3..8]) =~ m/^\d*$/) { # Forum 49125
$sgn = ($firstbyte&8) ? -1 : 1;
$tmp = $sgn * ($a[6].$a[3].".".$a[4]) + $hash->{corr1};
$hum = ($a[7].$a[8].".".$a[5]) + $hash->{corr2};
$val = "T: $tmp H: $hum";
$devtype = "TH".$sfirstbyte;
$family = "WS7000";
$NotifyType="T H";
$NotifyTemperature=$tmp;
$NotifyHumidity=$hum;
}
}
}