mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 18:56:03 +00:00
adding support for repeater-networks to detect device which are connected via a repeater
git-svn-id: https://svn.fhem.de/fhem/trunk@2839 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
348a178926
commit
bf4052c125
@ -51,7 +51,7 @@ PRESENCE_Initialize($)
|
|||||||
$hash->{DefFn} = "PRESENCE_Define";
|
$hash->{DefFn} = "PRESENCE_Define";
|
||||||
$hash->{UndefFn} = "PRESENCE_Undef";
|
$hash->{UndefFn} = "PRESENCE_Undef";
|
||||||
$hash->{AttrFn} = "PRESENCE_Attr";
|
$hash->{AttrFn} = "PRESENCE_Attr";
|
||||||
$hash->{AttrList}= "do_not_notify:0,1 disable:0,1 loglevel:1,2,3,4,5 ".$readingFnAttributes;
|
$hash->{AttrList}= "do_not_notify:0,1 disable:0,1 fritzbox_repeater:0,1 loglevel:1,2,3,4,5 ".$readingFnAttributes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,7 +398,7 @@ sub PRESENCE_StartLocalScan($;$)
|
|||||||
}
|
}
|
||||||
elsif($hash->{MODE} eq "fritzbox")
|
elsif($hash->{MODE} eq "fritzbox")
|
||||||
{
|
{
|
||||||
BlockingCall("PRESENCE_DoLocalFritzBoxScan", $hash->{NAME}."|".$hash->{ADDRESS}."|".$local, "PRESENCE_ProcessLocalScan", 20);
|
BlockingCall("PRESENCE_DoLocalFritzBoxScan", $hash->{NAME}."|".$hash->{ADDRESS}."|".$local."|".AttrVal($hash->{NAME}, "fritzbox_repeater", "0"), "PRESENCE_ProcessLocalScan", 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -410,6 +410,8 @@ PRESENCE_DoLocalPingScan($)
|
|||||||
my ($string) = @_;
|
my ($string) = @_;
|
||||||
my ($name, $device, $local) = split("\\|", $string);
|
my ($name, $device, $local) = split("\\|", $string);
|
||||||
|
|
||||||
|
Log GetLogLevel($defs{$name}{NAME}, 5), "PRESENCE_DoLocalPingScan: $string";
|
||||||
|
|
||||||
my $retcode;
|
my $retcode;
|
||||||
my $return;
|
my $return;
|
||||||
my $temp;
|
my $temp;
|
||||||
@ -448,10 +450,13 @@ sub
|
|||||||
PRESENCE_DoLocalFritzBoxScan($)
|
PRESENCE_DoLocalFritzBoxScan($)
|
||||||
{
|
{
|
||||||
my ($string) = @_;
|
my ($string) = @_;
|
||||||
my ($name, $device, $local) = split("\\|", $string);
|
my ($name, $device, $local, $repeater) = split("\\|", $string);
|
||||||
|
|
||||||
|
Log GetLogLevel($defs{$name}{NAME}, 5), "PRESENCE_DoLocalFritzBoxScan: $string";
|
||||||
my $number=0;
|
my $number=0;
|
||||||
|
|
||||||
|
my $check_command = ($repeater ? "active" : "speed");
|
||||||
|
|
||||||
|
|
||||||
my $status=0;
|
my $status=0;
|
||||||
|
|
||||||
@ -467,8 +472,8 @@ PRESENCE_DoLocalFritzBoxScan($)
|
|||||||
# only use the cached $number if it has still the correct device name
|
# only use the cached $number if it has still the correct device name
|
||||||
if($cached_name eq $device)
|
if($cached_name eq $device)
|
||||||
{
|
{
|
||||||
Log GetLogLevel($name, 5), "PRESENCE ($name) - checking with cached number ($number)";
|
Log GetLogLevel($name, 5), "PRESENCE ($name) - checking with cached number the $check_command state ($number)";
|
||||||
$status = qx(/usr/bin/ctlmgr_ctl r landevice settings/landevice$number/speed);
|
$status = qx(/usr/bin/ctlmgr_ctl r landevice settings/landevice$number/$check_command);
|
||||||
if(not $status =~ /^\s*\d+\s*$/)
|
if(not $status =~ /^\s*\d+\s*$/)
|
||||||
{
|
{
|
||||||
return "$name|$local|error|could not execute ctlmgr_ctl (cached)";
|
return "$name|$local|error|could not execute ctlmgr_ctl (cached)";
|
||||||
@ -502,12 +507,12 @@ PRESENCE_DoLocalFritzBoxScan($)
|
|||||||
|
|
||||||
chomp $net_device;
|
chomp $net_device;
|
||||||
|
|
||||||
Log GetLogLevel($name, 5), "PRESENCE ($name) - checking device number $number ($net_device)";
|
Log GetLogLevel($name, 5), "PRESENCE ($name) - checking with device number $number the $check_command state ($net_device)";
|
||||||
if($net_device eq $device)
|
if($net_device eq $device)
|
||||||
{
|
{
|
||||||
$status=qx(/usr/bin/ctlmgr_ctl r landevice settings/landevice$number/speed);
|
$status=qx(/usr/bin/ctlmgr_ctl r landevice settings/landevice$number/$check_command);
|
||||||
|
|
||||||
Log GetLogLevel($name, 5), "PRESENCE ($name) - speed for device number $net_device is $status";
|
Log GetLogLevel($name, 5), "PRESENCE ($name) - $check_command for device number $net_device is $status";
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -786,6 +791,16 @@ Options:
|
|||||||
If this attribute is activated, an active check will be disabled.<br><br>
|
If this attribute is activated, an active check will be disabled.<br><br>
|
||||||
Possible values: 0 => not disabled , 1 => disabled<br>
|
Possible values: 0 => not disabled , 1 => disabled<br>
|
||||||
Default Value is 0 (not disabled)<br><br>
|
Default Value is 0 (not disabled)<br><br>
|
||||||
|
<li><a>fritzbox_repeater</a></li> (Only in Mode "fritzbox" applicable)
|
||||||
|
If your FritzBox is part of a network using repeaters, than this attribute needs to be enabled to ensure a correct recognition for devices, which are connected via repeater.
|
||||||
|
<br><br>
|
||||||
|
This attribute is also needed, if your network device has no speed information on the FritzBox website (Home Network).<br><br>
|
||||||
|
<b>BE AWARE: The recognition of device going absent in a repeated network can take about 15 - 20 minutes!!</b>
|
||||||
|
<br><br>
|
||||||
|
Possible values: 0 => Use default recognition, 1 => Use repeater-supported recognition<br>
|
||||||
|
Default Value is 0 (Use default recognition)
|
||||||
|
|
||||||
|
<br><br>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -973,6 +988,17 @@ Options:
|
|||||||
Wenn dieses Attribut aktiviert ist, wird die Anwesenheitserkennung nicht mehr durchgeführt.<br><br>
|
Wenn dieses Attribut aktiviert ist, wird die Anwesenheitserkennung nicht mehr durchgeführt.<br><br>
|
||||||
Mögliche Werte: 0 => Erkennung durchführen , 1 => Keine Erkennungen durchführen<br>
|
Mögliche Werte: 0 => Erkennung durchführen , 1 => Keine Erkennungen durchführen<br>
|
||||||
Standardwert ist 0 (Erkennung durchführen)<br><br>
|
Standardwert ist 0 (Erkennung durchführen)<br><br>
|
||||||
|
<li><a>fritzbox_repeater</a></li> (Nur im Modus "fritzbox" anwendbar)
|
||||||
|
Wenn die FritzBox Teil eines Netzwerkes ist, welches mit Repeatern arbeitet, dann muss dieses Attribut gesetzt sein um die Erkennung von Geräten zu gewährleisten,
|
||||||
|
welche über einen Repeater erreichbar sind.
|
||||||
|
<br><br>
|
||||||
|
Dies gilt ebenso für Devices, welche keine Geschwindigkeitsangaben auf der FritzBox Seite (Heimnetz) anzeigen können.<br><br>
|
||||||
|
<b>ACHTUNG: Die Erkennung der Abwesenheit eines Gerätes in einem Repeater-Netzwerk kann ca. 15 - 20 Minuten dauern!!</b>
|
||||||
|
<br><br>
|
||||||
|
Mögliche Werte: 0 => Standarderkennung verwenden, 1 => Erkennung für Repeatergeräte verwenden<br>
|
||||||
|
Standardwert ist 0 (Standarderkennung verwenden)
|
||||||
|
|
||||||
|
<br><br>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user