From 9eb10bd8e0ea0161c4fe25b9287d34a0079289fc Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 6 Jul 2009 12:43:34 +0000 Subject: [PATCH] Correction & change by Klaus Bueker. git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@410 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/12_HMS.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/FHEM/12_HMS.pm b/FHEM/12_HMS.pm index a3c405b96..f6eb9e7c9 100755 --- a/FHEM/12_HMS.pm +++ b/FHEM/12_HMS.pm @@ -144,27 +144,24 @@ HMS_Parse($$) @txt = ( "water_detect", "battery"); @sfx = ( "", ""); - - # Battery-low condition detect is not yet properly - # implemented. As soon as my WD's batteries get low - # I am willing to supply a patch ;-) SEP7-RIPE, 2006/05/13 - my $status = hex(substr($msg, 10, 1)); #Battery low condition - $v[1] = (($status & 4) ? "empty" : "ok"); # bit is set if Voltage < 2.5 V. + my $status = hex(substr($val, 1, 1)); $v[0] = "off"; if ( $status & 1 ) { $v[0] = "on"; } $val = "Water Detect: $v[0]"; + $status = hex(substr($msg, 10, 1)); #Battery low condition + $v[1] = (($status & 4) ? "empty" : "ok"); # bit is set if Voltage < 2.5 V. } elsif ($type eq "HMS100TFK") { # By Peter P. @txt = ( "switch_detect", "battery"); @sfx = ( "", ""); - # Battery-low condition detect is not yet properly implemented. my $status = hex(substr($val, 1, 1)); $v[0] = ($status ? "on" : "off"); - $v[1] = "off"; $val = "Switch Detect: $v[0]"; + $status = hex(substr($msg, 10, 1)); #Battery low condition + $v[1] = (($status & 4) ? "empty" : "ok"); # bit is set if Voltage < 2.5 V. - } elsif($type eq "RM100-2") { + } elsif($type eq "RM100-2") { @txt = ( "smoke_detect", "battery"); @sfx = ( "", "");