From 51d6e237c0a183ba7ce8e66ee15a3d1edae947af Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 4 Aug 2008 13:50:02 +0000 Subject: [PATCH] HMS100-FIT added git-svn-id: https://svn.fhem.de/fhem/trunk@222 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/11_FHT.pm | 2 +- fhem/FHEM/12_HMS.pm | 21 ++++++++++++++++++--- fhem/FHEM/91_notify.pm | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/11_FHT.pm b/fhem/FHEM/11_FHT.pm index 4916d24e2..752394d34 100755 --- a/fhem/FHEM/11_FHT.pm +++ b/fhem/FHEM/11_FHT.pm @@ -172,7 +172,7 @@ FHT_Set($@) $allcmd .=" " if($allcmd); $allcmd .= $cmd; - return "Unknown argument $cmd, choose one of " . join(" ", sort keys %c2bset) + return "Unknown argument $cmd, choose one of " . join(" ",sort keys %c2bset) if(!defined($c2bset{$cmd})); return "\"set $name\" needs a parameter" if(@a < 1); diff --git a/fhem/FHEM/12_HMS.pm b/fhem/FHEM/12_HMS.pm index 724c9d026..5f8a4fa3a 100755 --- a/fhem/FHEM/12_HMS.pm +++ b/fhem/FHEM/12_HMS.pm @@ -13,6 +13,7 @@ my %codes = ( "5" => "HMS100TFK", "6" => "HMS100MG", "8" => "HMS100CO", + "e" => "HMS100FIT", ); my %defptr; @@ -30,14 +31,15 @@ HMS_Initialize($) # 810e04d70213a001b16d000003000000 RM100-2 # 810e047f0214a001a81f000001000000 HMS100TFK # 810e048f0295a0010155000001000000 HMS100TFK (jumper) -# 810e04330216a001b4c5000001000000 HMS100MG +# 810e04330216a001b4c5000001000000 HMS100MG # 810e04210218a00186e0000000000000 HMS100CO +# 810e0448029ea00132d5000000000000 FI-Trenner - $hash->{Match} = "^810e04....(1|5|9)[0-8]a001"; + $hash->{Match} = "^810e04....(1|5|9).a001"; $hash->{DefFn} = "HMS_Define"; $hash->{UndefFn} = "HMS_Undef"; $hash->{ParseFn} = "HMS_Parse"; - $hash->{AttrList} = "do_not_notify:0,1 showtime:0,1 model;hms100-t,hms100-tf,hms100-wd,hms100-mg,hms100-tfk,rm100-2,hms100-co loglevel:0,1,2,3,4,5,6"; + $hash->{AttrList} = "do_not_notify:0,1 showtime:0,1 model;hms100-t,hms100-tf,hms100-wd,hms100-mg,hms100-tfk,rm100-2,hms100-co,hms100-fit loglevel:0,1,2,3,4,5,6"; } ##################################### @@ -196,6 +198,19 @@ HMS_Parse($$) if ($status & 1) { $v[0] = "on"; } $val = "CO Detect: $v[0]"; + } elsif ($type eq "HMS100FIT") { # By PAN + + @txt = ( "fi_triggered", "battery"); + @sfx = ( "", ""); + + # Battery-low condition detect is not yet properly + # implemented. + my $status = hex(substr($val, 1, 1)); + $v[0] = ($status != "0") ? "on" : "off"; + $v[1] = "off"; + if ($status & 1) { $v[0] = "on"; } + $val = "FI triggered: $v[0]"; + } else { Log 4, "HMS Device $dev (Unknown type: $type)"; diff --git a/fhem/FHEM/91_notify.pm b/fhem/FHEM/91_notify.pm index 982671d15..bd0ec489f 100755 --- a/fhem/FHEM/91_notify.pm +++ b/fhem/FHEM/91_notify.pm @@ -22,7 +22,7 @@ sub notify_Define($$) { my ($hash, $def) = @_; - my ($type, $name, $re, $command) = split("[ \t]+", $def, 4); + my ($name, $type, $re, $command) = split("[ \t]+", $def, 4); if(!$command) { if($hash->{OLDDEF}) { # Called from modify, where command is optional