2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

14_CUL_TCM97001: fix HH humidy for GT_WT_02

git-svn-id: https://svn.fhem.de/fhem/trunk@12956 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
bjoernh 2017-01-04 19:05:55 +00:00
parent 27f389ab44
commit 349559c4bf
2 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- bugfix: 14_CUL_TCM97001: fix HH humidy for GT_WT_02
- feature: 57_Calender: new attribute SSLVerify
- feature: 00_MQTT: Added username password (optional).
- feature: 41_OREGON: support event-min-interval, event-on-change-reading,

View File

@ -235,8 +235,8 @@ sub checkValues {
if (!defined($humidy)) {
$humidy = 50;
}
if ($temp < 60 && $temp > -30
&& $humidy > 0 && $humidy < 100) {
if ($temp <= 60 && $temp >= -30
&& $humidy >= 0 && $humidy <= 100) {
return TRUE;
}
return FALSE;
@ -791,6 +791,14 @@ CUL_TCM97001_Parse($$)
$temp = $temp / 10;
$humidity = (hex($a[6].$a[7]) & 0x0FE) >> 1; # only the first 7 bits are the humidity
if ($humidity > 100) {
# HH - Workaround
$humidity = 100;
} elsif ($humidity < 20) {
# LL - Workaround
$humidity = 20;
}
if (checkValues($temp, $humidity)) {
$channel = ((hex($a[2])) & 0x3) + 1;
$batbit = ((hex($a[2]) & 0x8) != 0x8);
@ -819,9 +827,7 @@ CUL_TCM97001_Parse($$)
Log3 $name, 2, "CUL_TCM97001 Unknown device $deviceCode, please define it";
return "UNDEFINED $model" . substr($deviceCode, rindex($deviceCode,"_")) . " CUL_TCM97001 $deviceCode";
}
if ($humidity >= 20) {
$hashumidity = TRUE;
}
$hashumidity = TRUE;
$hasbatcheck = TRUE;
$haschannel = TRUE;
$hasmode = TRUE;