diff --git a/fhem/CHANGED b/fhem/CHANGED index 79e47f129..0376ad7ac 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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, diff --git a/fhem/FHEM/14_CUL_TCM97001.pm b/fhem/FHEM/14_CUL_TCM97001.pm index 4025bdd10..086d8f4ea 100755 --- a/fhem/FHEM/14_CUL_TCM97001.pm +++ b/fhem/FHEM/14_CUL_TCM97001.pm @@ -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;