diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index c771a6601..fdad1f8fc 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -6587,13 +6587,6 @@ sub CUL_HM_SndCmd($$) { ) ){ - # shall we delay commands if IO device is not present? - # it could cause trouble if light switches on after a long period - # repetition will be stopped after 1min forsecurity reason. - my @arr = (); - $hash->{cmdStack} = \@arr if(!$hash->{cmdStack}); - unshift (@{$hash->{cmdStack}}, $cmd);#pushback cmd, wait for opportunity - # push device to list if (!defined $modules{CUL_HM}{$ioName}{tmr}){ # some setup work for this timer @@ -6603,9 +6596,24 @@ sub CUL_HM_SndCmd($$) { $modules{CUL_HM}{$ioName}{pendDev} = \@arr2; } } + + # shall we delay commands if IO device is not present? + # it could cause trouble if light switches on after a long period + # repetition will be stopped after 1min forsecurity reason. + # so do: return cmd to queue and set state to pending again. + # device will be queued @ CUL_HM. Timer will perform cyclic check for IO to return. + # + my @arr = (); + $hash->{cmdStack} = \@arr if(!$hash->{cmdStack}); + $cmd = $hash->{helper}{prt}{rspWait}{cmd} if( $hash->{helper}{prt}{rspWait} + && $hash->{helper}{prt}{rspWait}{cmd}); + unshift (@{$hash->{cmdStack}}, $cmd);#pushback cmd, wait for opportunity + @{$modules{CUL_HM}{$ioName}{pendDev}} = CUL_HM_noDup(@{$modules{CUL_HM}{$ioName}{pendDev}},$hash->{NAME}); CUL_HM_respPendRm($hash);#rm timer - we are out + CUL_HM_protState($hash,"CMDs_pending"); + if ($modules{CUL_HM}{$ioName}{tmr} != 1){# need to start timer my $tn = gettimeofday(); InternalTimer($tn+$IOpoll, "CUL_HM_sndIfOpen", "sndIfOpen:$ioName", 0); @@ -7832,6 +7840,18 @@ sub CUL_HM_CvTflt($) { # config time -> float my ($inValue) = @_; return ($inValue & 0x1f)*((sort {$a <=> $b} keys(%fltCvT))[$inValue >> 5]); } + +sub CUL_HM_flt6CvT($) { # float -> config time + my ($inValue) = @_; + my $exp = ($inValue>127)?1:0; + return ($exp << 7)+int($inValue/($exp?60:1)); +} +sub CUL_HM_CvTflt6($) { # config time -> float + my ($inValue) = @_; + $inValue = 129 if ($inValue == 128); + return ($inValue & 0x7f)*(($inValue >> 7)?60:1); +} + sub CUL_HM_min2time($) { # minutes -> time my $min = shift; $min = $min * 30; diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index 5491b2a4a..d1ae39361 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -1696,7 +1696,7 @@ sub HMInfo_help(){ ############################################################ ."\n remove a template set" ."\n set templateExe -templateName-" ."\n write all assigned templates to the file" - ."\n get templateUsg -templateName-" + ."\n get templateUsg -templateName-[sortPeer|sortTemplate]" ."\n show template usage" ."\n get templateChk [-typeFilter-] -templateName- -peer:[long|short]- [-param1- ...] " ."\n compare whether register match the template values" @@ -2382,7 +2382,7 @@ sub HMinfo_templateUsg(@){##################################################### next if(!defined $defs{$dName}{helper}{tmpl}); foreach my $tid(keys %{$defs{$dName}{helper}{tmpl}}){ my ($p,$t) = split(">",$tid); - if($tFilter){ + if($tFilter && $tFilter =~ m/^sort.*/){ if($tFilter eq "sortTemplate"){ push @ul,sprintf("%-20s|%-15s|%s|%s",$t,$dName,$p,$defs{$dName}{helper}{tmpl}{$tid}); } @@ -2390,8 +2390,9 @@ sub HMinfo_templateUsg(@){##################################################### my ($pn,$ls) = split(":",$p); push @ul,sprintf("%-20s|%-15s|%5s:%-20s|%s",$pn,$t,$ls,$dName,$defs{$dName}{helper}{tmpl}{$tid}); } - elsif($tFilter ne $t){ - next;} +# elsif($tFilter ne $t){ +# next; +# } } else{ my @param; @@ -2404,8 +2405,9 @@ sub HMinfo_templateUsg(@){##################################################### } $para = join(" ",@param); } - - push @ul,sprintf("%-20s|%-15s|%s|%s",$dName,$p,$t,$para);} + push @ul,sprintf("%-20s|%-15s|%s|%s",$dName,$p,$t,$para) if(!$tFilter || $tFilter eq $t); + + } } } return join("\n",sort(@ul)); @@ -2772,7 +2774,7 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
  • templateList [<name>]
    list defined templates. If no name is given all templates will be listed
  • -
  • templateUsg <template>
    +
  • templateUsg <template> [sortPeer|sortTemplate]
    templare usage
    template filters the output
  • @@ -3220,7 +3222,7 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
  • templateList [<name>]
    zeigt eine Liste von Vorlagen. Ist kein Name angegeben, werden alle Vorlagen angezeigt
  • -
  • templateUsg <template>
    +
  • templateUsg <template> [sortPeer|sortTemplate]
    Liste der genutzten templates.
    template filtert die Einträge nach diesem template
  • diff --git a/fhem/FHEM/HMConfig.pm b/fhem/FHEM/HMConfig.pm index 2ec0efd94..da4f91a23 100644 --- a/fhem/FHEM/HMConfig.pm +++ b/fhem/FHEM/HMConfig.pm @@ -516,7 +516,7 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices wakeupDefChan =>{a=> 32.0,s=>1.0,l=>0,min=>0 ,max=>20 ,c=>'' ,f=>'' ,u=>'' ,d=>0,t=>"wakeup default channel"}, wakeupBehavior =>{a=> 33.0,s=>0.1,l=>0,min=>0 ,max=>20 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"wakeup behavior" ,lit=>{off=>0,on=>1}}, wakeupBehavMsg =>{a=> 33.1,s=>0.1,l=>0,min=>0 ,max=>20 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"wakeup behavior status message" ,lit=>{off=>0,on=>1}}, - alarmTimeMax =>{a=> 34.0,s=>1.0,l=>0,min=>1 ,max=>900 ,c=>'' ,f=>1.6 ,u=>'s' ,d=>0,t=>"maximum Alarm time" ,lit=>{unused=>0}}, + alarmTimeMax =>{a=> 34.0,s=>1.0,l=>0,min=>1 ,max=>900 ,c=>'fltCvT60' ,f=>'' ,u=>'s' ,d=>0,t=>"maximum Alarm time" ,lit=>{unused=>0}}, baudrate =>{a=> 35.0,s=>1.0,l=>0,min=>0 ,max=>6 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"baudrate" ,lit=>{Bd300=>0,Bd600=>1,Bd1200=>2,Bd2400=>3,Bd4800=>4,Bd9600=>5,Bd19200=>6}}, serialFormat =>{a=> 36.0,s=>1.0,l=>0,min=>0 ,max=>3 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"serial Format" ,lit=>{s7D1PE1S=>0,s7D1PE2S=>1,s8D0PN1S=>2,s8D1PE1S=>3}},