diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index ccd93b77c..a9644b87e 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -482,6 +482,9 @@ sub CUL_HM_Attr(@) {################################# else {return "param $_ unknown, use offAtPon or onAtRain";} } } + elsif ($md =~ m/^virtual_/ && $attrVal eq "noOnOff"){ + ; + } else{ return "attribut param not defined for this entity"; } @@ -1533,7 +1536,6 @@ sub CUL_HM_Parse($$) {############################## next if (!$modules{CUL_HM}{defptr}{$dChId}); my $dChNo = substr($dChId,6,2); my $dChName = CUL_HM_id2Name($dChId); - if(($attr{$dChName}{peerIDs}?$attr{$dChName}{peerIDs}:"") =~m/$recId/){ my $dChHash = $defs{$dChName}; $dChHash->{helper}{trgLgRpt} = 0 @@ -1541,18 +1543,22 @@ sub CUL_HM_Parse($$) {############################## $dChHash->{helper}{trgLgRpt} +=1; my $trgLgRpt = $dChHash->{helper}{trgLgRpt}; - my $state = ReadingsVal($dChName,"virtActState","OFF"); - my $tNoOld = ReadingsVal($dChName,"virtActTrigNo","0"); - $state = ($state eq "OFF")?"ON":"OFF" if ($trigNo ne $tNoOld); + my ($stT,$stAck) = ("ack","00");#state text and state Ack for Msg + if (AttrVal($dChName,"param","") !~ m/noOnOff/){ + $stT = ReadingsVal($dChName,"virtActState","OFF"); + $stT = ($stT eq "OFF")?"ON":"OFF" + if ($trigNo ne ReadingsVal($dChName,"virtActTrigNo","0")); + $stAck = '01'.$dChNo.(($stT eq "ON")?"C8":"00")."00" + } + if (hex($mFlg)&0x20){ $longPress .= "_Release"; $dChHash->{helper}{trgLgRpt}=0; - push @ack,$dhash,$mNo."8002".$dst.$src.'01'.$dChNo. - (($state eq "ON")?"C8":"00")."00"; + push @ack,$dhash,$mNo."8002".$dst.$src.$stAck; } push @entities, - CUL_HM_UpdtReadBulk($dChHash,1,"state:".$state, - "virtActState:".$state, + CUL_HM_UpdtReadBulk($dChHash,1,"state:".$stT, + "virtActState:".$stT, "virtActTrigger:".CUL_HM_id2Name($recId), "virtActTrigType:".$longPress, "virtActTrigRpt:".$trgLgRpt, @@ -3162,7 +3168,8 @@ sub CUL_HM_Set($@) { $hash->{helper}{vd}{idl} = hex(substr($dst,4,2))*256; $hash->{helper}{vd}{msgCnt} = 1; if (!$hash->{helper}{virtTC}){ - $hash->{helper}{vd}{next} = 0 if (!defined $hash->{helper}{vd}{next}); + $hash->{helper}{vd}{next} = gettimeofday() + if (!defined $hash->{helper}{vd}{next}); $hash->{helper}{virtTC} = "03"; CUL_HM_valvePosUpdt("valvePos:$dst$chn"); }; @@ -3500,24 +3507,28 @@ sub CUL_HM_valvePosUpdt(@) {#update valve position periodically to please valve my $nextTimer = (($lo+$hi)&0xff)/4 + 120;#original - instable my $name = $hash->{NAME}; my $vp = ReadingsVal($name,"valvePosTC","15 %"); + my $ackTime; $vp =~ s/ %//; $vp *=2.56; my $tn = gettimeofday(); my $delta = int(($tn - $hash->{helper}{vd}{next})*1000); -# Log 1,"VD-timing ##### diff:$delta"; - Log 1,"VD-timing Critical ##### diff:$delta" if ($delta >100); + Log3 $name,3,"VD-timing Critical ##### diff:$delta" if ($delta >100); foreach my $peer (sort(split(',',AttrVal($name,"peerIDs","")))) { next if (length($peer) != 8); $peer = substr($peer,0,6); + my $pn = CUL_HM_id2Name($peer); + $ackTime = ReadingsTimestamp($pn, "ValvePosition", "nix"); CUL_HM_PushCmdStack($hash,sprintf("%02XA258%s%s%s%02X",$msgCnt,$vDevId ,$peer,$hash->{helper}{virtTC},$vp)); } -# if ($delta > 250) { + + if ($ackTime && $ackTime ne $hash->{helper}{vd}{ackT} ) { $hash->{helper}{vd}{next} += $nextTimer; -# } -# else { -# $hash->{helper}{vd}{next} = $tn+$nextTimer; -# } + } + else { + $hash->{helper}{vd}{next} = $tn+$nextTimer; + } + $hash->{helper}{vd}{ackT} = $ackTime; $hash->{helper}{vd}{next} = $tn+$nextTimer; $hash->{helper}{vd}{msgCnt} = $msgCnt; $hash->{helper}{virtTC} = "00"; @@ -6487,6 +6498,10 @@ sub CUL_HM_complConfig($) {# read config if enabled and not complete offAtPon: heat channel only: force heating off after powerOn
onAtRain: heat channel only: force heating on while status changes to 'rain' and off when it changes to 'dry'
+
  • virtuals
    + noOnOff: virtual entity will not toggle state when trigger is received. If this parameter is + not given the entity will toggle its state between On and Off with each trigger
    +

  • Generated events: diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index f8f1d7a20..b5e5dc6cc 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -207,9 +207,9 @@ sub HMinfo_peerCheck(@) { ##################################################### } my $ret = ""; $ret .="\n\n peer list not read" ."\n ".(join "\n ",sort @peerIDsEmpty) if(@peerIDsEmpty); - $ret .="\n\n peer list incomplete"."\n ".(join "\n ",sort @peerIDsFail) if(@peerIDsEmpty); + $ret .="\n\n peer list incomplete"."\n ".(join "\n ",sort @peerIDsFail) if(@peerIDsFail); $ret .="\n\n peer not defined" ."\n ".(join "\n ",sort @peerIDnotDef) if(@peerIDnotDef); - $ret .="\n\n peer not verified" ."\n ".(join "\n ",sort @peerIDsNoPeer)if(@peerIDsEmpty); + $ret .="\n\n peer not verified" ."\n ".(join "\n ",sort @peerIDsNoPeer)if(@peerIDsNoPeer); return $ret; } sub HMinfo_burstCheck(@) { #################################################### @@ -884,7 +884,7 @@ sub HMinfo_SetFn($@) {######################################################### ,"configCheck","param","peerCheck","peerXref" ,"protoEvents","msgStat:view,clear","rssi" ,"models" - ,"regCheck","register","saveConfig","update" + ,"regCheck","register","saveConfig","loadConfig","update" ,"cpRegs" ,"tempList" ,"templateChk","templateDef","templateList","templateSet"); diff --git a/fhem/FHEM/HMConfig.pm b/fhem/FHEM/HMConfig.pm index f4e80a3a4..bb1429080 100644 --- a/fhem/FHEM/HMConfig.pm +++ b/fhem/FHEM/HMConfig.pm @@ -1348,18 +1348,15 @@ $culHmChanSets{"ROTO_ZEL-STG-RM-FWT02"} = $culHmChanSets{"HM-CC-TC02"}; LOWBAT => '06,02,$val=(hex($val)&0x80)?1:0', RSSI => '08,02,$val=(-1)*(hex($val))', }}, "02;p01=02" => { txt => "ACK2"}, # smokeDetector pairing only? - "02;p01=04" => { txt => "ACK-proc", params => {# connected to AES?? + "02;p01=04" => { txt => "AES_req", params => {# Para1 => "02,4", Para2 => "06,4", Para3 => "10,4", - Para4 => "14,2",}}, # remote? + keyNo => "14,2",}}, "02;p01=80" => { txt => "NACK"}, "02;p01=84" => { txt => "NACK_TARGET_INVALID"}, "02" => { txt => "ACK/NACK_UNKNOWN "}, - "02" => { txt => "Request AES", params => { #todo check data - DATA => "0," } }, - "03" => { txt => "AES reply", params => { # send 'old' AES key to actor DATA => "0," } },