diff --git a/fhem/FHEM/73_PRESENCE.pm b/fhem/FHEM/73_PRESENCE.pm
index 356435fdf..9f486b973 100755
--- a/fhem/FHEM/73_PRESENCE.pm
+++ b/fhem/FHEM/73_PRESENCE.pm
@@ -51,7 +51,7 @@ PRESENCE_Initialize($)
$hash->{DefFn} = "PRESENCE_Define";
$hash->{UndefFn} = "PRESENCE_Undef";
$hash->{AttrFn} = "PRESENCE_Attr";
- $hash->{AttrList}= "do_not_notify:0,1 disable:0,1 fritzbox_repeater: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 ping_count:1,2,3,4,5,6,7,8,9,10 ".$readingFnAttributes;
}
@@ -480,7 +480,7 @@ sub PRESENCE_StartLocalScan($;$)
}
elsif($hash->{MODE} eq "lan-ping")
{
- $hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalPingScan", $hash->{NAME}."|".$hash->{ADDRESS}."|".$local, "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash) unless(exists($hash->{helper}{RUNNING_PID}));
+ $hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalPingScan", $hash->{NAME}."|".$hash->{ADDRESS}."|".$local."|".AttrVal($hash->{NAME}, "ping_count", "4"), "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash) unless(exists($hash->{helper}{RUNNING_PID}));
}
elsif($hash->{MODE} eq "fritzbox")
{
@@ -501,13 +501,14 @@ PRESENCE_DoLocalPingScan($)
{
my ($string) = @_;
- my ($name, $device, $local) = split("\\|", $string);
+ my ($name, $device, $local, $count) = split("\\|", $string);
Log GetLogLevel($defs{$name}{NAME}, 5), "PRESENCE_DoLocalPingScan: $string";
my $retcode;
my $return;
my $temp;
+
if($^O =~ m/(Win|cygwin)/)
{
eval "require Net::Ping;";
@@ -529,7 +530,7 @@ PRESENCE_DoLocalPingScan($)
}
else
{
- $temp = qx(ping -c 4 $device);
+ $temp = qx(ping -c $count $device);
Log GetLogLevel($name, 5), "PRESENCE ($name) - ping command returned with output:\n$temp";
$return = "$name|$local|".($temp =~ /\d+ [Bb]ytes (from|von)/ ? "present" : "absent");
@@ -1033,7 +1034,10 @@ Options:
If this attribute is activated, an active check will be disabled.
Possible values: 0 => not disabled , 1 => disabled
Default Value is 0 (not disabled)
-