diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index 4ec34db42..fa44652cb 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -2398,8 +2398,9 @@ sub CUL_HM_Parse($$) {######################################################### my($chn,$cnt,$bright,$nextTr) = map{hex($_)} (@mI,0); if ($nextTr){ $nextTr = (15 << ($nextTr >> 4) - 4); # strange mapping of literals - RemoveInternalTimer($mh{devN}.":motionCheck"); - InternalTimer(gettimeofday()+$nextTr,"CUL_HM_motionCheck", $mh{devN}.":motionCheck", 0); + RemoveInternalTimer($mh{cName}.":motionCheck"); + InternalTimer(gettimeofday()+$nextTr+2,"CUL_HM_motionCheck", $mh{cName}.":motionCheck", 0); + $mh{cHash}->{helper}{moStart} = gettimeofday() if (!defined $mh{cHash}->{helper}{moStart}); } else{ $nextTr = "none "; @@ -8299,8 +8300,17 @@ sub CUL_HM_readValIfTO($){# } sub CUL_HM_motionCheck($){# my ($name) = split(":",shift);# uncertain:$name:$reading:$value - CUL_HM_UpdtReadBulk($defs{$name},1,"state:noMotion" - ,"motion:no"); + + if (defined $defs{$name}{helper}{moStart}){ + CUL_HM_UpdtReadBulk($defs{$name},1,"state:noMotion" + ,"motion:no" + ,"motionDuration:".(int(gettimeofday())-int($defs{$name}{helper}{moStart}))); + delete $defs{$name}{helper}{moStart}; + } + else{ + CUL_HM_UpdtReadBulk($defs{$name},1,"state:noMotion" + ,"motion:no"); + } } sub CUL_HM_getAttr($$$){#return attrValue - consider device if empty diff --git a/fhem/FHEM/HMConfig.pm b/fhem/FHEM/HMConfig.pm index ef494b2c4..b4b68e1bb 100644 --- a/fhem/FHEM/HMConfig.pm +++ b/fhem/FHEM/HMConfig.pm @@ -196,7 +196,7 @@ my $K_actDetID = '000000'; # id of actionDetector ,"007C" => {name=>"ROTO_ZEL-STG-RM-FZS" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'1,3' ,chn=>"",} # radio-controlled socket adapter switch actuator 1-channel ,"007D" => {name=>"ROTO_ZEL-STG-RM-WT-2" ,st=>'pushButton' ,cyc=>'' ,rxt=>'c:w:l' ,lst=>'1,4' ,chn=>"",} # HM Push Button 2 ,"007E" => {name=>"ROTO_ZEL-STG-RM-DWT-10" ,alias=>"HM-PB-4DIS-WM-2"} - ,"007F" => {name=>"ROTO_ZEL-STG-RM-FST-UP4" ,st=>'pushButton' ,cyc=>'' ,rxt=>'c' ,lst=>'1,4' ,chn=>"",} # HM Push Button Interface + ,"007F" => {name=>"ROTO_ZEL-STG-RM-FST-UP4" ,alias=>"HM-PBI-4-FM"} # HM Push Button Interface ,"0080" => {name=>"ROTO_ZEL-STG-RM-HS-4" ,st=>'remote' ,cyc=>'' ,rxt=>'c' ,lst=>'1,4' ,chn=>"",} # HM Remote 4 buttons ,"0081" => {name=>"ROTO_ZEL-STG-RM-FDK" ,st=>'threeStateSensor' ,cyc=>'28:00' ,rxt=>'c:w' ,lst=>'1,4' ,chn=>"",} # HM Rotary Handle Sensor ,"0082" => {name=>"Roto_ZEL-STG-RM-FFK" ,st=>'threeStateSensor' ,cyc=>'28:00' ,rxt=>'c:w' ,lst=>'1,4' ,chn=>"",} # HM Shutter Contact