HMS100-FIT added
git-svn-id: https://svn.fhem.de/fhem/trunk@222 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -172,7 +172,7 @@ FHT_Set($@)
|
|||||||
$allcmd .=" " if($allcmd);
|
$allcmd .=" " if($allcmd);
|
||||||
$allcmd .= $cmd;
|
$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}));
|
if(!defined($c2bset{$cmd}));
|
||||||
return "\"set $name\" needs a parameter"
|
return "\"set $name\" needs a parameter"
|
||||||
if(@a < 1);
|
if(@a < 1);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ my %codes = (
|
|||||||
"5" => "HMS100TFK",
|
"5" => "HMS100TFK",
|
||||||
"6" => "HMS100MG",
|
"6" => "HMS100MG",
|
||||||
"8" => "HMS100CO",
|
"8" => "HMS100CO",
|
||||||
|
"e" => "HMS100FIT",
|
||||||
);
|
);
|
||||||
|
|
||||||
my %defptr;
|
my %defptr;
|
||||||
@@ -32,12 +33,13 @@ HMS_Initialize($)
|
|||||||
# 810e048f0295a0010155000001000000 HMS100TFK (jumper)
|
# 810e048f0295a0010155000001000000 HMS100TFK (jumper)
|
||||||
# 810e04330216a001b4c5000001000000 HMS100MG
|
# 810e04330216a001b4c5000001000000 HMS100MG
|
||||||
# 810e04210218a00186e0000000000000 HMS100CO
|
# 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->{DefFn} = "HMS_Define";
|
||||||
$hash->{UndefFn} = "HMS_Undef";
|
$hash->{UndefFn} = "HMS_Undef";
|
||||||
$hash->{ParseFn} = "HMS_Parse";
|
$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"; }
|
if ($status & 1) { $v[0] = "on"; }
|
||||||
$val = "CO Detect: $v[0]";
|
$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 {
|
} else {
|
||||||
|
|
||||||
Log 4, "HMS Device $dev (Unknown type: $type)";
|
Log 4, "HMS Device $dev (Unknown type: $type)";
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ sub
|
|||||||
notify_Define($$)
|
notify_Define($$)
|
||||||
{
|
{
|
||||||
my ($hash, $def) = @_;
|
my ($hash, $def) = @_;
|
||||||
my ($type, $name, $re, $command) = split("[ \t]+", $def, 4);
|
my ($name, $type, $re, $command) = split("[ \t]+", $def, 4);
|
||||||
|
|
||||||
if(!$command) {
|
if(!$command) {
|
||||||
if($hash->{OLDDEF}) { # Called from modify, where command is optional
|
if($hash->{OLDDEF}) { # Called from modify, where command is optional
|
||||||
|
|||||||
Reference in New Issue
Block a user