mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
CUL_HM: ActionDetector new attribut
git-svn-id: https://svn.fhem.de/fhem/trunk@8053 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9fc4863537
commit
d19c8bc67f
@ -140,6 +140,7 @@ sub CUL_HM_Initialize($) {
|
||||
."actCycle " # also for action detector
|
||||
."hmProtocolEvents:0_off,1_dump,2_dumpFull,3_dumpTrigger "
|
||||
."rssiLog:1,0 " # enable writing RSSI to Readings (device only)
|
||||
."actAutoTry:0_off,1_on "
|
||||
;
|
||||
$hash->{Attr}{devPhy} = # -- physical device only attributes
|
||||
"serialNr firmware .stc .devInfo "
|
||||
@ -800,6 +801,11 @@ sub CUL_HM_Attr(@) {#################################
|
||||
delete $hash->{helper}{lm};
|
||||
}
|
||||
}
|
||||
elsif($attrName eq "actAutoTry" ){
|
||||
if ($cmd eq "set"){
|
||||
return "$attrName only usable for ActionDetector" if(CUL_HM_hash2Id($hash) ne "000000");#only for device
|
||||
}
|
||||
}
|
||||
|
||||
CUL_HM_queueUpdtCfg($name) if ($updtReq);
|
||||
return;
|
||||
@ -6908,6 +6914,7 @@ sub CUL_HM_ActCheck($) {# perform supervision
|
||||
my $peerIDs = $actHash->{helper}{peers}?$actHash->{helper}{peers}:"";
|
||||
my @event;
|
||||
my ($cntUnkn,$cntAliv,$cntDead,$cnt_Off) =(0,0,0,0);
|
||||
my $autoTry = CUL_HM_getAttrInt($actName,"actAutoTry",0);
|
||||
|
||||
foreach my $devId (split(",",$peerIDs)){
|
||||
next if (!$devId);
|
||||
@ -6934,24 +6941,39 @@ sub CUL_HM_ActCheck($) {# perform supervision
|
||||
my $tSince = sprintf("%04d-%02d-%02d %02d:%02d:%02d",
|
||||
$t[5]+1900, $t[4]+1, $t[3], $t[2], $t[1], $t[0]);
|
||||
|
||||
if (!$tLast){ #cannot determine time
|
||||
if (!$tLast #cannot determine time
|
||||
|| $tSince gt $tLast){ #no message received in window
|
||||
if ($actHash->{helper}{$devId}{start} lt $tSince){
|
||||
$cntDead++; $state = "dead";
|
||||
}
|
||||
else{
|
||||
if($autoTry) { #try to send a statusRequest?
|
||||
if (!$actHash->{helper}{$devId}{try} || $actHash->{helper}{$devId}{try}<2){
|
||||
$actHash->{helper}{$devId}{try} = $actHash->{helper}{$devId}{try}
|
||||
? ($actHash->{helper}{$devId}{try} +1)
|
||||
: 1;
|
||||
if (CUL_HM_Set($defs{$devName},$devName,"help") =~ m/statusRequest/){
|
||||
# send statusrequest if possible
|
||||
CUL_HM_Set($defs{$devName},$devName,"statusRequest");
|
||||
$cntUnkn++; $state = "unknown";
|
||||
}
|
||||
}
|
||||
elsif ($tSince gt $tLast){ #no message received in window
|
||||
if ($actHash->{helper}{$devId}{start} lt $tSince){
|
||||
else{
|
||||
$actHash->{helper}{$devId}{try} = 99;
|
||||
$cntDead++; $state = "dead";
|
||||
}
|
||||
}
|
||||
else{
|
||||
$cntDead++; $state = "dead";
|
||||
}
|
||||
}
|
||||
else{
|
||||
$cntDead++; $state = "dead";
|
||||
}
|
||||
}
|
||||
else{
|
||||
$cntUnkn++; $state = "unknown";
|
||||
}
|
||||
}
|
||||
else{ #message in time
|
||||
$cntAliv++; $state = "alive";
|
||||
delete $actHash->{helper}{$devId}{try};
|
||||
}
|
||||
}
|
||||
if ($oldState ne $state){
|
||||
@ -8619,6 +8641,11 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
|
||||
if set HMLAN/USB is forced to request AES signature before sending ACK to the device.<br>
|
||||
This funktion strictly works with HMLAN/USB - it doesn't work for CUL type IOs.<br>
|
||||
</li>
|
||||
<li><a name="#CUL_HMactAutoTry">actAutoTry</a>
|
||||
actAutoTry 0_off,1_on<br>
|
||||
setting this option enables Action Detector to send a statusrequest in case of a device is going to be marked dead.
|
||||
The attribut may be useful in case a device is being checked that does not send messages regularely - e.g. an ordinary switch.
|
||||
</li>
|
||||
<li><a name="#CUL_HMactCycle">actCycle</a>
|
||||
actCycle <[hhh:mm]|off><br>
|
||||
Supports 'alive' or better 'not alive' detection for devices. [hhh:mm] is the maximum silent time for the device.
|
||||
@ -9884,6 +9911,11 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
|
||||
<li><a href="#dummy">dummy</a></li>
|
||||
<li><a href="#showtime">showtime</a></li>
|
||||
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
|
||||
<li><a name="#CUL_HMactAutoTry">actAutoTry</a>
|
||||
actAutoTry 0_off,1_on<br>
|
||||
setzen der Option erlaubt dem ActionDetector ein statusrequest zu senden falls das Device dead markiert werden soll.
|
||||
Das Attribut kann fuer Devices nützlich sein, welche sich nicht von selbst zyklisch melden.
|
||||
</li>
|
||||
<li><a href="#actCycle">actCycle</a>
|
||||
actCycle <[hhh:mm]|off><br>
|
||||
Bietet eine 'alive' oder besser 'not alive' Erkennung für Geräte. [hhh:mm] ist die maximale Zeit ohne Nachricht eines Geräts. Wenn innerhalb dieser Zeit keine Nachricht empfangen wird so wird das Event"<device> is dead" generiert.
|
||||
|
@ -804,6 +804,7 @@ my $K_actDetID = '000000'; # id of actionDetector
|
||||
,sensRain =>{ transmDevTryMax =>1,localResDis =>1}
|
||||
,tipTronic =>{ cyclicInfoMsg =>1,cyclicInfoMsgDis=>1,localResDis =>1,RS485IdleTime =>1}
|
||||
,powerMeter =>{ intKeyVisib =>1,localResDis =>1}
|
||||
,outputUnit =>{ intKeyVisib =>1}
|
||||
,powerSensor =>{ transmitTryMax =>1,transmDevTryMax =>1
|
||||
,mtrType =>1,mtrConstIr =>1,mtrConstGas =>1,mtrConstLed =>1
|
||||
,mtrSensIr =>1
|
||||
|
Loading…
x
Reference in New Issue
Block a user