From 2ee5cb032657fdf0f599a827fa7416fd98ba9d37 Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Mon, 8 Sep 2014 18:31:29 +0000 Subject: [PATCH] improve KFM100 calculation git-svn-id: https://svn.fhem.de/fhem/trunk@6522 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index fd9bde7dc..a438d7698 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -1473,9 +1473,7 @@ sub CUL_HM_Parse($$) {######################################################### if($p =~ m/(..)4(.)0200(..)(..)(..)/) { my ($chn,$seq, $k_v1, $k_v2, $k_v3) = (hex($1),hex($2),$3,hex($4),hex($5)); push @evtEt,[$shash,1,"battery:".($chn & 0x80?"low":"ok")]; - - my $v = 128-$k_v2; # FIXME: calibrate - $v += 256 if(!($k_v3 & 1)); + my $v = 1408 - ((($k_v3 & 0x07)<<8) + $k_v2); push @evtEt,[$shash,1,"rawValue:$v"]; my $nextSeq = ReadingsVal($name,"Sequence",""); $nextSeq =~ s/_.*//;