79_BDKM.pm: added attr InterPollDelay, ignore type eMonitoringList
git-svn-id: https://svn.fhem.de/fhem/trunk@12764 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -173,7 +173,7 @@ my @RC35DEFAULTS =
|
||||
qw(/gateway/DateTime:0:0:DateTime
|
||||
);
|
||||
|
||||
# extra valid value not in range which is set by gateway
|
||||
# extra valid value not in range (set by gateway)
|
||||
my %extra_value=
|
||||
qw(/heatingCircuits/hc1/fastHeatupFactor 0
|
||||
/heatingCircuits/hc1/temporaryRoomSetpoint -1
|
||||
@@ -196,6 +196,7 @@ sub BDKM_Initialize($)
|
||||
|
||||
$hash->{AttrList} =
|
||||
"BaseInterval " .
|
||||
"InterPollDelay " .
|
||||
"PollIds:textField-long " .
|
||||
"HttpTimeout " .
|
||||
$readingFnAttributes;
|
||||
@@ -269,7 +270,7 @@ sub BDKM_Define($$)
|
||||
$hash->{IDS} = {}; # Hash containing IDS of first full poll
|
||||
$hash->{VERSION} = '$Id$';
|
||||
# init attrs to defaults:
|
||||
map {BDKM_Attr("del",$name,$_)} qw(BaseInterval ReadBackDelay HttpTimeout);
|
||||
map {BDKM_Attr("del",$name,$_)} qw(BaseInterval InterPollDelay ReadBackDelay HttpTimeout);
|
||||
|
||||
BDKM_reInit($hash);
|
||||
return undef;
|
||||
@@ -293,6 +294,14 @@ sub BDKM_Attr(@)
|
||||
$hash->{BASEINTERVAL} = $val;
|
||||
BDKM_reInit($hash);
|
||||
}
|
||||
} elsif ($attr eq "InterPollDelay") {
|
||||
$del and $val = 0; # default
|
||||
if($val !~ /^\d+$/) {
|
||||
return $error."needs interger value";
|
||||
} else {
|
||||
$hash->{INTERPOLLDELAY} = $val/1000;
|
||||
BDKM_reInit($hash);
|
||||
}
|
||||
} elsif($attr eq "ReadBackDelay") {
|
||||
$del and $val = 500;
|
||||
if($val !~ /^\d+$/ or $val < 100 or $val > 2000) {
|
||||
@@ -394,7 +403,11 @@ sub BDKM_doSequence($)
|
||||
# restart timer for next sequence
|
||||
BDKM_Timer($hash,$hash->{BASEINTERVAL},"BDKM_doSequence");
|
||||
# only start polling if we are not polling (e.g. due to network promlems)
|
||||
$hash->{ISPOLLING} and return;
|
||||
if($hash->{ISPOLLING}) {
|
||||
Log3 $hash, 3, $hash->{NAME}." trying to start new sequence while previous not finished";
|
||||
Log3 $hash, 3, $hash->{NAME}." Gateway not responding? BaseInterval too short? InterPollDelay too high?";
|
||||
return;
|
||||
}
|
||||
$hash->{ISPOLLING}=1;
|
||||
my $seq = $hash->{SEQUENCE};
|
||||
my $h = $hash->{POLLIDS};
|
||||
@@ -486,8 +499,11 @@ sub BDKM_JobQueueNextIdHttpDone($)
|
||||
Log3 $hash, 4, "$name $id - no JSON data available - raw data: $data";
|
||||
}
|
||||
}
|
||||
BDKM_JobQueueNextId($hash); # get next id
|
||||
|
||||
if($hash->{INTERPOLLDELAY}) {
|
||||
BDKM_Timer($hash,$hash->{INTERPOLLDELAY},"BDKM_JobQueueNextId");
|
||||
} else {
|
||||
BDKM_JobQueueNextId($hash);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1074,7 +1090,10 @@ sub BDKM_update_id_from_json
|
||||
} elsif ($type eq "yRecording") {
|
||||
defined $h->{TYPE} or $h->{TYPE}="Recroding";
|
||||
# ignore recordings - fhem records :-)
|
||||
} elsif ($type eq "refEnum") { # ignore directory entry
|
||||
} elsif ($type eq "refEnum") {
|
||||
# ignore directory entry
|
||||
} elsif ($type eq "eMonitoringList") {
|
||||
# ignore eMonitoringList - I don't have infos about that
|
||||
} else {
|
||||
Log3 $hash, 2, "$hash->{NAME}: unknown type $type for $id";
|
||||
}
|
||||
@@ -1238,6 +1257,15 @@ sub BDKM_MapSwitchPrograms
|
||||
It defaults to 120 seconds. Which means that every 120 seconds a
|
||||
new poll collects values of IDs which turn it is.
|
||||
</li><br>
|
||||
<li>InterPollDelay<br>
|
||||
The delay time in milliseconds between reading of two IDs from
|
||||
the gateway. It defaults to 0 (read as fast as possible).
|
||||
Some gateways/heatings seem to stop answering after a while
|
||||
when you are reading a lot of IDs. (verbose 2 "communication ERROR").
|
||||
To avoid gateway hangups always try to read only as many IDs as
|
||||
really required. If it doesn't help try to increase the
|
||||
InterPollDelay value. E.g. start with 100.
|
||||
</li><br>
|
||||
<li>ReadBackDelay<br>
|
||||
Read back delay for the set command in milliseconds. This value
|
||||
defaults to 500 (0.5s). After setting a value, the gateway need
|
||||
|
||||
Reference in New Issue
Block a user