2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 05:16:45 +00:00

CUL_HM:improve motion, correct push button

git-svn-id: https://svn.fhem.de/fhem/trunk@11297 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2016-04-23 04:53:41 +00:00
parent a0371c06f4
commit 4fbe82f0d6
2 changed files with 15 additions and 5 deletions

View File

@ -2398,8 +2398,9 @@ sub CUL_HM_Parse($$) {#########################################################
my($chn,$cnt,$bright,$nextTr) = map{hex($_)} (@mI,0); my($chn,$cnt,$bright,$nextTr) = map{hex($_)} (@mI,0);
if ($nextTr){ if ($nextTr){
$nextTr = (15 << ($nextTr >> 4) - 4); # strange mapping of literals $nextTr = (15 << ($nextTr >> 4) - 4); # strange mapping of literals
RemoveInternalTimer($mh{devN}.":motionCheck"); RemoveInternalTimer($mh{cName}.":motionCheck");
InternalTimer(gettimeofday()+$nextTr,"CUL_HM_motionCheck", $mh{devN}.":motionCheck", 0); InternalTimer(gettimeofday()+$nextTr+2,"CUL_HM_motionCheck", $mh{cName}.":motionCheck", 0);
$mh{cHash}->{helper}{moStart} = gettimeofday() if (!defined $mh{cHash}->{helper}{moStart});
} }
else{ else{
$nextTr = "none "; $nextTr = "none ";
@ -8299,8 +8300,17 @@ sub CUL_HM_readValIfTO($){#
} }
sub CUL_HM_motionCheck($){# sub CUL_HM_motionCheck($){#
my ($name) = split(":",shift);# uncertain:$name:$reading:$value 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 sub CUL_HM_getAttr($$$){#return attrValue - consider device if empty

View File

@ -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 ,"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 ,"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"} ,"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 ,"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 ,"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 ,"0082" => {name=>"Roto_ZEL-STG-RM-FFK" ,st=>'threeStateSensor' ,cyc=>'28:00' ,rxt=>'c:w' ,lst=>'1,4' ,chn=>"",} # HM Shutter Contact