From eda26879c9ddbb15098a87456bcd5ea98f89b8a2 Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Sun, 6 Oct 2013 11:53:26 +0000 Subject: [PATCH] introduce temlist-packed transmit git-svn-id: https://svn.fhem.de/fhem/trunk@4013 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 53 +++++++++++++++++++++++++++++++----------- fhem/FHEM/HMConfig.pm | 20 ++++++++-------- 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index 0436cfc70..734fbeaf4 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -2775,6 +2775,11 @@ sub CUL_HM_Set($@) { $addr = hex($addr); } + my $prep = ""; + if ($a[2] =~ m/^(prep|exec)$/ && $md eq "HM-CC-RT-DN"){ + $prep = $a[2]; + splice @a,2,1;#remove prep + } return "To few arguments" if(@a < 4); return "To many arguments, max 24 pairs" if(@a > (($md eq "HM-CC-RT-DN")?28:50)); return "Bad format, use HH:MM TEMP ..." if(@a % 2); @@ -2806,7 +2811,7 @@ sub CUL_HM_Set($@) { $hash->{TEMPLIST}{$wd}{($idx-2)/2}{TEMP} = $a[$idx+1]; $msg .= sprintf(" %02d:%02d %.1f", $h, $m, $a[$idx+1]); } - CUL_HM_pushConfig($hash, $id, $dst, $prgChn,0,0,$list, $data); + CUL_HM_pushConfig($hash, $id, $dst, $prgChn,0,0,$list, $data,$prep); } elsif($cmd eq "sysTime") { ################################################## $state = ""; @@ -3262,10 +3267,10 @@ sub CUL_HM_pushConfig($$$$$$$$@) {#generate messages to config data to register #--- copy data from readings to shadow my $chnhash = $modules{CUL_HM}{defptr}{$dst.$chn}; $chnhash = $hash if (!$chnhash); + my $rRd = ReadingsVal($chnhash->{NAME},$regLN,"");#General if (!$chnhash->{helper}{shadowReg} || !$chnhash->{helper}{shadowReg}{$regLN}){ - $chnhash->{helper}{shadowReg}{$regLN} = - ReadingsVal($chnhash->{NAME},$regLN,""); + $chnhash->{helper}{shadowReg}{$regLN} = $rRd; } #--- update with ne value my $regs = $chnhash->{helper}{shadowReg}{$regLN}; @@ -3276,8 +3281,18 @@ sub CUL_HM_pushConfig($$$$$$$$@) {#generate messages to config data to register $regs .= " ".$addr.":".$data; } } - $chnhash->{helper}{shadowReg}{$regLN} = $regs; - return if ($prep);#prepare shadowReg only. More data to come. + $chnhash->{helper}{shadowReg}{$regLN} = $regs; # update shadow + my $change; + if ($prep eq "exec"){#update complete registerset + foreach (sort split " ",$chnhash->{helper}{shadowReg}{$regLN}){ + $change .= $_." " if ($rRd !~ m /$_/); + } + $change =~ s/(\ |:)//g; + } + else{ + $change = $content;# just change actual date + } + return if ($prep eq "prep");#prepare shadowReg only. More data to come. #Application takes care about execution CUL_HM_updtRegDisp($hash,$list,$peerAddr.$peerChn); CUL_HM_PushCmdStack($hash, "++".$flag.'01'.$src.$dst.$chn.'05'. @@ -3285,7 +3300,7 @@ sub CUL_HM_pushConfig($$$$$$$$@) {#generate messages to config data to register for(my $l = 0; $l < $tl; $l+=28) { my $ml = $tl-$l < 28 ? $tl-$l : 28; CUL_HM_PushCmdStack($hash, "++A001".$src.$dst.$chn."08". - substr($content,$l,$ml)); + substr($change,$l,$ml)); } CUL_HM_PushCmdStack($hash,"++A001".$src.$dst.$chn."06"); CUL_HM_queueAutoRead($hash->{NAME}) @@ -5235,19 +5250,29 @@ sub CUL_HM_putHash($) {# provide data for HMinfo
  • desired-temp <temp>
    Set different temperatures. <temp> must be between 6 and 30 Celsius, and precision is half a degree.
  • -
  • tempListSat HH:MM temp ... 24:00 temp
  • -
  • tempListSun HH:MM temp ... 24:00 temp
  • -
  • tempListMon HH:MM temp ... 24:00 temp
  • -
  • tempListTue HH:MM temp ... 24:00 temp
  • -
  • tempListThu HH:MM temp ... 24:00 temp
  • -
  • tempListWed HH:MM temp ... 24:00 temp
  • -
  • tempListFri HH:MM temp ... 24:00 temp
    +
  • tempListSat [prep|exec] HH:MM temp ... 24:00 temp
  • +
  • tempListSun [prep|exec] HH:MM temp ... 24:00 temp
  • +
  • tempListMon [prep|exec] HH:MM temp ... 24:00 temp
  • +
  • tempListTue [prep|exec] HH:MM temp ... 24:00 temp
  • +
  • tempListThu [prep|exec] HH:MM temp ... 24:00 temp
  • +
  • tempListWed [prep|exec] HH:MM temp ... 24:00 temp
  • +
  • tempListFri [prep|exec] HH:MM temp ... 24:00 temp
    Specify a list of temperature intervals. Up to 24 intervals can be specified for each week day, the resolution is 10 Minutes. The last time spec must always be 24:00.
    + The optional parameter [prep|exec] allowes to pack the messages and therefore greatly + improve data transmission. This is especially helpful if device is operated in wakeup mode. + Usage is to send the commands with paramenter "prep". The data will be accumulated for send. + The last command must have the parameter "exec" in order to transmitt the information.
    Example: until 6:00 temperature shall be 19, from then until 23:00 temperature shall be 22.5, thereafter until midnight, 19 degrees celsius is desired.
    - set th tempListSat 06:00 19 23:00 22.5 24:00 19
  • + set th tempListSat 06:00 19 23:00 22.5 24:00 19
    +
    + set th tempListSat prep 06:00 19 23:00 22.5 24:00 19
    + set th tempListSun prep 06:00 19 23:00 22.5 24:00 19
    + set th tempListMon prep 06:00 19 23:00 22.5 24:00 19
    + set th tempListTue exec 06:00 19 23:00 22.5 24:00 19
    +
  • OutputUnit (HM-OU-LED16) diff --git a/fhem/FHEM/HMConfig.pm b/fhem/FHEM/HMConfig.pm index d57ba677a..b4a1f28f1 100644 --- a/fhem/FHEM/HMConfig.pm +++ b/fhem/FHEM/HMConfig.pm @@ -1061,16 +1061,16 @@ my %culHmChanSets = ( ,toggle =>""}, "HM-CC-RT-DN00" =>{ sysTime =>""}, "HM-CC-RT-DN02" =>{ sysTime =>""}, - "HM-CC-RT-DN04" =>{ controlMode => "[auto|boost|day|night]" - ,controlManu => "[on|off|5.0..30.0]" - ,controlParty => " " - ,tempListSat =>"HH:MM temp ..." - ,tempListSun =>"HH:MM temp ..." - ,tempListMon =>"HH:MM temp ..." - ,tempListTue =>"HH:MM temp ..." - ,tempListThu =>"HH:MM temp ..." - ,tempListWed =>"HH:MM temp ..." - ,tempListFri =>"HH:MM temp ..." + "HM-CC-RT-DN04" =>{ controlMode =>"[auto|boost|day|night]" + ,controlManu =>"[on|off|5.0..30.0]" + ,controlParty =>" " + ,tempListSat =>"[prep|exec] HH:MM temp ..." + ,tempListSun =>"[prep|exec] HH:MM temp ..." + ,tempListMon =>"[prep|exec] HH:MM temp ..." + ,tempListTue =>"[prep|exec] HH:MM temp ..." + ,tempListThu =>"[prep|exec] HH:MM temp ..." + ,tempListWed =>"[prep|exec] HH:MM temp ..." + ,tempListFri =>"[prep|exec] HH:MM temp ..." ,"desired-temp" =>"[on|off|5.0..30.0]" ,sysTime =>"" },