From b993e8e9e7bdf051d8ff603617abca8aef3fd6cd Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Sat, 5 Apr 2014 10:06:47 +0000 Subject: [PATCH] introduce templ for heating devices git-svn-id: https://svn.fhem.de/fhem/trunk@5445 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 420 +++++++++++++++++++++++++++++----------- fhem/FHEM/98_HMinfo.pm | 360 ++++++++++++++-------------------- fhem/FHEM/98_apptime.pm | 2 +- fhem/FHEM/HMConfig.pm | 2 + 4 files changed, 458 insertions(+), 326 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index ef2b96c1e..a7186be0b 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -142,6 +142,7 @@ sub CUL_HM_Initialize($) { ."expert:0_off,1_on,2_full " ."burstAccess:0_off,1_auto " ."param msgRepeat " + ."tempListTmpl " ."levelRange " ."aesCommReq:1,0 " # IO will request AES if ."rssiLog:1,0 " # enable writing RSSI to Readings (device only) @@ -3481,7 +3482,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++ if($mode =~ m/central/); } } - elsif($cmd =~ m/^tempList(...)/) { ###################################### reg + elsif($cmd =~ m/^tempList(...)$/) { ##################################### reg my $wd = $1; $state= ""; my ($list,$addr,$prgChn); @@ -3542,6 +3543,22 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++ } CUL_HM_pushConfig($hash, $id, $dst, $prgChn,0,0,$list, $data,$prep); } + elsif($cmd eq "tempListTmpl") { ############################################# + $state= ""; + my $action = "verify";#defaults + my $template = AttrVal($name,"tempListTmpl","tempList.cfg:$name"); + for my $ax ($a[2],$a[3]){ + if ($ax =~ m/^(verify|restore)$/){ + $action = $ax; + } + else{ + $template = $ax if ($ax); + } + } + my $ret = CUL_HM_tempListTmpl($name,$action,$template); + $ret = "verifed with no faults" if (!$ret && $action eq "verify"); + return $ret; + } elsif($cmd eq "sysTime") { ################################################## $state = ""; my $s2000 = sprintf("%02X", CUL_HM_secSince2000()); @@ -3750,7 +3767,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++ return "no filename given" if (!$a[2]); return "only thru CUL " if (!$hash->{IODev}->{TYPE} ||($hash->{IODev}->{TYPE} ne "CUL")); - # todo General add version checsk of CUL + # todo add version checks of CUL my $fName = $a[2]; my $pos = 0; my @imA; # image array: image[block][msg] @@ -4851,7 +4868,6 @@ sub CUL_HM_FWupdateSim($){#end FW Simulation } } - sub CUL_HM_eventP($$) {#handle protocol events # Current Events are Rcv,NACK,IOerr,Resend,ResendFail,Snd # additional variables are protCmdDel,protCmdPend,protState,protLastRcv @@ -6383,6 +6399,77 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data CUL_HM_noDup(@{$modules{CUL_HM}{helper}{confUpdt}},$name); } +#+++++++++++++++++ templates ++++++++++++++++++++++++++++++++++++++++++++++++++ +sub CUL_HM_tempListTmpl(@) { ################################################## + # $name is comma separated list of names + # $template is formated :template - file is optional + my ($name,$action,$template)=@_; + my %dl =("Sat"=>0,"Sun"=>1,"Mon"=>2,"Tue"=>3,"Wed"=>4,"Thu"=>5,"Fri"=>6); + my $ret; + my @el = split",",$name; + my ($fName,$tmpl) = split":",$template; + if (!$tmpl){ + $tmpl = $fName; + $fName = "tempList.cfg"; + } + open(aSave, "$fName") || return("Can't open $fName: $!"); + my $found = 0; + my @entryFail = (); + my @exec = (); + + while(){ + chomp; + my $line = $_; + if($line =~ m/^entities:/){ + last if ($found != 0); + $line =~s/.*://; + foreach my $eN (split(",",$line)){ + $eN =~ s/ //g; + $found = 1 if ($eN eq $tmpl); + } + } + + elsif($found == 1 && $_ =~ m/(R_)?(P[123])?(_?._)?tempList[SMFWT].*\>/){ + my $rn = $line; + $rn =~ s/(.*tempList...).*/$1/; + my ($tln,$val) = ($1,$2)if($_ =~ m/(.*)>(.*)/); + $tln =~ s/ //g; + $tln = "R_".$tln if($tln !~ m/^R_/); + my $day = $dl{$1} if ($tln =~ m/tempList(...)/); + $tln =~s /tempList/${day}_tempList/ if ($tln !~ m/[0-6]_/); + + $val =~ tr/ +/ /; + $val =~ s/^ //; + $val =~ s/ $//; + @exec = (); + foreach my $eN(@el){ + if ($action eq "verify"){ + $val = join(" ",split(" ",$val)); + my $nv = ReadingsVal($eN,$tln,"empty"); + $nv = join(" ",split(" ",$nv)); + push @entryFail,$eN." :".$tln." mismatch" if ($val ne $nv); + } + elsif($action eq "restore"){ + $val = lc($1)." ".$val if ($tln =~ m/(P.)_._tempList/); + $tln =~ s/R_(P._)?._//; + my $x = CUL_HM_Set($defs{$eN},$eN,$tln,"prep",split(" ",$val)); + push @entryFail,$eN." :".$tln." respose:$x" if ($x ne "1"); + push @exec,$eN." ".$tln." exec ".$val; + } + } + } + $ret = "failed Entries:\n " .join("\n ",@entryFail) if (scalar@entryFail); + } + $ret .= "$tmpl not found in file $fName" if (!$found); + + foreach (@exec){ + my @param = split(" ",$_); + CUL_HM_Set($defs{$param[0]},@param); + } + close(aSave); + return $ret; +} + 1; =pod @@ -6418,9 +6505,9 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data below:
livingRoomSwitch is the device managing communication. This device is @@ -6486,20 +6573,20 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data correct answer to a request generated by the actor is received. This means: @@ -6532,8 +6619,7 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data configuration for additional peers.
The command is a shortcut for a selection of other commands. -
  • getRegRaw [List0|List1|List2|List3|List4|List5|List6] - <peerChannel>
    +
  • getRegRaw [List0|List1|List2|List3|List4|List5|List6]<peerChannel>
    Read registerset in raw format. Description of the registers is beyond the scope of this documentation.
    @@ -6633,13 +6719,12 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data regBulk subsequent.
    Example:
      - set myChannel peerBulk 12345601,
      - set myChannel peerBulk self01,self02,FB_Btn_04,FB_Btn_03,
      - set myChannel peerBulk 12345601 unset # remove peer 123456 channel 01
      + set myChannel peerBulk 12345601,
      + set myChannel peerBulk self01,self02,FB_Btn_04,FB_Btn_03,
      + set myChannel peerBulk 12345601 unset # remove peer 123456 channel 01
  • -
  • regBulk <reg List>:<peer> <addr1:data1> <addr2:data2>... -
    +
  • regBulk <reg List>:<peer> <addr1:data1> <addr2:data2>...
    This command will replace the former regRaw. It allows to set register in raw format. Its main purpose is to restore a complete register list to values secured before.
    @@ -6652,7 +6737,7 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data channel ID.
    <addr1:data1> is the list of register to be written in hex format.
    - Example:
    + Example:
      set myChannel regBulk RegL_00: 02:01 0A:17 0B:43 0C:BF 15:FF 00:00
      RegL_03:FB_Btn_07 @@ -6811,10 +6896,10 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data will be peered/unpeerd to the actor. press can be used to stimulate the related actions as defined in the actor register.
        -
      • peerChan <btn_no> <actChan> [single|dual] - [set|unset] [both|actor|remote]
        +
      • peerChan <btn_no> <actChan> [single|dual][set|unset] [both|actor|remote] +
        - peerChan will establish a connection between a sender-channel and + peerChan will establish a connection between a sender- channel and an actuator-channel called link in HM nomenclatur. Peering must not be confused with pairing.
        Pairing refers to assign a device to the central.
        @@ -6964,6 +7049,34 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data 22.5, thereafter until midnight, 19 degrees celsius is desired.
        set th tempListSat 06:00 19 23:00 22.5 24:00 19
      • +
        +
      • tempListTmpl =>"[verify|restore] [[ <file> :]templateName] ...
        + The tempList for one or more devices can be stored in a file. User can compare the + tempList in the file with the data read from the device.
        + Restore will write the tempList to the device.
        + Default opeartion is verify.
        + Default file is tempList.cfg.
        + Default templateName is the name of the actor
        + Default for file and templateName can be set with attribut tempListTmpl
        + Example for templist file. room1 and room2 are the names of the template:
        + entities:room1 + tempListSat>08:00 16.0 15:00 18.0 21:30 19.0 24:00 14.0 + tempListSun>08:00 16.0 15:00 18.0 21:30 19.0 24:00 14.0 + tempListMon>07:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0 + tempListTue>07:00 16.0 13:00 16.0 16:00 18.0 21:00 19.0 24:00 15.0 + tempListWed>07:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0 + tempListThu>07:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0 + tempListFri>07:00 16.0 13:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0 + entities:room2 + tempListSat>08:00 14.0 15:00 18.0 21:30 19.0 24:00 14.0 + tempListSun>08:00 14.0 15:00 18.0 21:30 19.0 24:00 14.0 + tempListMon>07:00 14.0 16:00 18.0 21:00 19.0 24:00 14.0 + tempListTue>07:00 14.0 13:00 16.0 16:00 18.0 21:00 19.0 24:00 15.0 + tempListWed>07:00 14.0 16:00 18.0 21:00 19.0 24:00 14.0 + tempListThu>07:00 14.0 16:00 18.0 21:00 19.0 24:00 14.0 + tempListFri>07:00 14.0 13:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0 + +
      • partyMode <HH:MM><durationDays>
        set control mode to party and device ending time. Add the time it ends and the number of days it shall last. If it shall end next day '1' @@ -7169,8 +7282,8 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data
    -
    +
    Get
    • configSave <filename>
      @@ -7259,7 +7372,7 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data if set HMLAN/USB is forced to request AES signature before sending ACK to the device.
      This funktion strictly works with HMLAN/USB - it doesn't work for CUL type IOs.
    • -
    • actCycle +
    • actCycle actCycle <[hhh:mm]|off>
      Supports 'alive' or better 'not alive' detection for devices. [hhh:mm] is the maximum silent time for the device. Upon no message received in this period an event will be raised "<device> is dead". @@ -7275,8 +7388,8 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data
    The overall function can be viewed checking out the "ActionDetector" entity. The status of all entities is present in the READING section.
    Note: This function can be enabled for devices with non-cyclic messages as well. It is up to the user to enter a reasonable cycletime. -
  • -
  • autoReadReg
    +
  • +
  • autoReadReg
    '0' autoReadReg will be ignored.
    '1' will execute a getConfig for the device automatically after each reboot of FHEM.
    '2' like '1' plus execute after power_on.
    @@ -7296,7 +7409,7 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data usage on devices which support wakeup-mode is usefull. But consider that execution is delayed until the device "wakes up".
    -
  • +
  • burstAccess
    can be set for the device entity if the model allowes conditionalBurst. The attribut will switch off burst operations (0_off) which causes less message load @@ -7339,6 +7452,10 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data attr myChannel levelRange 10,80
  • +
  • tempListTmpl
    + Sets the default template for a heating controller.
    + Format is <file>:<templatename>. lt +
  • model, subType
    These attributes are set automatically after a successful pairing. @@ -7394,7 +7511,7 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data NOTE: This will apply to readings and set commands. It does not apply to any register.

  • - Generated events: + Generated events:
    + subType abhängige Befehle:
  • OutputUnit (HM-OU-LED16) -
      -
    • led [off|red|green|yellow]
      - schaltet die LED des Kanals auf die gewünschte Farbe. Wird der Befehl auf ein Gerät angewandt so - werden alle LEDs auf diese Farbe gesetzt.
      - Experten können die LEDs separat durch eine 8-stellige Hex-Zahl ansteuern.
    • -
    • ilum <Helligkeit><Dauer>
      - <Helligkeit> [0-15] der Beleuchtung.
      - <Dauer> [0-127] in Sekunden, 0 bedeutet dauernd an.
    • -

  • +
      +
    • led [off|red|green|yellow]
      + schaltet die LED des Kanals auf die gewünschte Farbe. Wird der Befehl auf ein Gerät angewandt so + werden alle LEDs auf diese Farbe gesetzt.
      + Experten können die LEDs separat durch eine 8-stellige Hex-Zahl ansteuern.
    • +
    • ilum <Helligkeit><Dauer>
      + <Helligkeit> [0-15] der Beleuchtung.
      + <Dauer> [0-127] in Sekunden, 0 bedeutet dauernd an.
    • +

    +
  • OutputUnit (HM-OU-CFM-PL) -
      -
    • led <color>[,<color>..] [<repeat>..]
      - Mögliche Farben sind [redL|greenL|yellowL|redS|greenS|yellowS|pause]. Eine Folge von Farben - kann durch trennen der Farbeinträge mit ',' eingestellt werden. - Leerzeichen dürfen in der Liste nicht benutzt werden. 'S' bezeichnet kurze und - 'L' lange Beleuchtungsdauer.
      - repeat definiert wie oft die Sequenz ausgeführt werden soll. Standard ist 1.
      -
    • -
    • playTone <MP3No>[,<MP3No>..] [<repeat>..]
      - Spielt eine Reihe von Tönen. Die Liste muss mit ',' getrennt werden. Leerzeichen - dürfen in der Liste nicht benutzt werden.
      - replay kann verwendet werden um den zuletzt gespielten Klang zu wiederholen.
      - repeat definiert wie oft die Sequenz ausgeführt werden soll. Standard ist 1.
      - Beispiel: -
        - set cfm_Mp3 playTone 3 # MP3 Titel 3 einmal
        - set cfm_Mp3 playTone 3 3 # MP3 Titel 3 dreimal
        - set cfm_Mp3 playTone 3,6,8,3,4 # MP3 Titelfolge 3,6,8,3,4 einmal
        - set cfm_Mp3 playTone 3,6,8,3,4 255# MP3 Titelfolge 3,6,8,3,4 255 mal
        - set cfm_Mp3 playTone replay # Wiederhole letzte Sequenz
        -
        - set cfm_Led led redL 4 # rote LED dreimal lang blinken
        - set cfm_Led led redS,redS,redS,redL,redL,redL,redS,redS,redS 255 # SOS 255 mal
        -
      - -
    • -

  • +
      +
    • led <color>[,<color>..] [<repeat>..]
      + Mögliche Farben sind [redL|greenL|yellowL|redS|greenS|yellowS|pause]. Eine Folge von Farben + kann durch trennen der Farbeinträge mit ',' eingestellt werden. + Leerzeichen dürfen in der Liste nicht benutzt werden. 'S' bezeichnet kurze und + 'L' lange Beleuchtungsdauer.
      + repeat definiert wie oft die Sequenz ausgeführt werden soll. Standard ist 1.
      +
    • +
    • playTone <MP3No>[,<MP3No>..] [<repeat>..]
      + Spielt eine Reihe von Tönen. Die Liste muss mit ',' getrennt werden. Leerzeichen + dürfen in der Liste nicht benutzt werden.
      + replay kann verwendet werden um den zuletzt gespielten Klang zu wiederholen.
      + repeat definiert wie oft die Sequenz ausgeführt werden soll. Standard ist 1.
      + Beispiel: +
        + set cfm_Mp3 playTone 3 # MP3 Titel 3 einmal
        + set cfm_Mp3 playTone 3 3 # MP3 Titel 3 dreimal
        + set cfm_Mp3 playTone 3,6,8,3,4 # MP3 Titelfolge 3,6,8,3,4 einmal
        + set cfm_Mp3 playTone 3,6,8,3,4 255# MP3 Titelfolge 3,6,8,3,4 255 mal
        + set cfm_Mp3 playTone replay # Wiederhole letzte Sequenz
        +
        + set cfm_Led led redL 4 # rote LED dreimal lang blinken
        + set cfm_Led led redS,redS,redS,redL,redL,redL,redS,redS,redS 255 # SOS 255 mal
        +
      + +
    • +

    +
  • HM-RC-19xxx
    • alarm <count>
      @@ -8266,30 +8410,32 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data Ein CUL kann aber Statusnachrichten von Keymatic mitlesen und darauf reagieren.

      -
    • lock
      - Schließbolzen fährt in Zu-Position
    • -
    • unlock [sec]
      - Schließbolzen fährt in Auf-Position.
      - [sec]: Stellt die Verzögerung ein nach der sich das Schloss automatisch wieder verschließt.
      - 0 - 65535 Sekunden
    • -
    • open [sec]
      - Entriegelt die Tür sodass diese geöffnet werden kann.
      - [sec]: Stellt die Verzögerung ein nach der sich das Schloss automatisch wieder - verschließt.
      0 - 65535 Sekunden
    • -
  • +
  • lock
    + Schließbolzen fährt in Zu-Position
  • +
  • unlock [sec]
    + Schließbolzen fährt in Auf-Position.
    + [sec]: Stellt die Verzögerung ein nach der sich das Schloss automatisch wieder verschließt.
    + 0 - 65535 Sekunden
  • +
  • open [sec]
    + Entriegelt die Tür sodass diese geöffnet werden kann.
    + [sec]: Stellt die Verzögerung ein nach der sich das Schloss automatisch wieder + verschließt.
    0 - 65535 Sekunden
  • + +
  • winMatic

      winMatic arbeitet mit 2 Kanälen, einem für die Fenstersteuerung und einem für den Akku.

      -
    • level <level> <relockDelay> <speed>
      - stellt den Wert ein.
      - <level>: Bereich ist 0% bis 100%
      - <relockDelay>: Spanne reicht von 0 bis 65535 Sekunden. 'ignore' kann verwendet werden um den Wert zu ignorieren.
      - <speed>: Bereich ist 0% bis 100%
      -
    • -
    • stop
      - stopt die Bewegung
      -
    • -
  • +
  • level <level> <relockDelay> <speed>
    + stellt den Wert ein.
    + <level>: Bereich ist 0% bis 100%
    + <relockDelay>: Spanne reicht von 0 bis 65535 Sekunden. 'ignore' kann verwendet werden um den Wert zu ignorieren.
    + <speed>: Bereich ist 0% bis 100%
    +
  • +
  • stop
    + stopt die Bewegung
    +
  • + +
  • HM-Sys-sRP-Pl

    legt Einträge für den Repeater an. Bis zu 36 Einträge können angelegt werden.
      @@ -8335,9 +8481,8 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data
    - +
    - Get
    • configSave <filename>
      @@ -8402,7 +8547,7 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data vor dem zurückschreiben der Daten eines Eintrags muss das Gerät mit FHEM verbunden werden.
      "restore" löscht keine verknüpften Kanäle, es fügt nur neue Peers hinzu.
    • -
    +
    Attribute
    • eventMap
    • @@ -8426,7 +8571,31 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data Die gesamte Funktion kann über den "ActionDetector"-Eintrag überprüft werden. Der Status aller Instanzen liegt im READING-Bereich.
      Hinweis: Diese Funktion kann ebenfalls für Geräte ohne zyklische Übertragung aktiviert werden. Es obliegt dem Nutzer eine vernünftige Zeitspanne festzulegen. -
    • expert
      + +
    • autoReadReg
      + '0' autoReadReg wird ignorert.
      + '1' wird automatisch in getConfig ausgeführt für das Device nach jedem reboot von FHEM.
      + '2' wie '1' plus nach Power on.
      + '3' wie '2' plus update wenn auf das Device geschreiben wird.
      + '4' wie '3' plus fordert Status an, wenn es nicht korrekt erscheint
      + '5' prüft Registerlisten und peerlisten. Wenn diese nicht komplett sind wird ein update angefordert
      + '8_stateOnly' es wird nur der Status geprüft, updates für Register werden nicht gemacht.
      + Ausführung wird verzögert ausgeführt. Wenn das IO eine gewisse Last erreicht hat wird + das Kommando weiter verzögert um eine Überlast zu vermeiden.
      + Empfohlene Zusammenhänge bei Nutzung:
      +
        + Benutze das Attribut für das Device, nicht für jeden einzelnen Kanal
        + Das Setzen auf Level 5 wird für alle Devices und Typen empfohlen, auch wakeup Devices.
        +
      +
    • +
    • burstAccess
      + kann für eine Geräteinstanz gesetzt werden falls das Model bedingte Bursts erlaubt. + Das Attribut deaktiviert den Burstbetrieb (0_off) was die Nachrichtenmenge des HMLAN reduziert + und damit die Wahrscheinlichkeit einer Überlast von HMLAN verringert.
      + Einschalten (1_auto) erlaubt kürzere Reaktionszeiten eines Geräts. Der Nutzer muss nicht warten + bis das Gerät wach ist.
      + Zu beacht ist dass das Register "burstRx" im Gerät ebenfalls gesetzt werden muss.
    • +
    • expert
      Dieses Attribut steuert die Sichtbarkeit der Werte. Damit wird die Darstellung der Geräteparameter kontrolliert.
      3 Level können gewählt werden:
        @@ -8440,26 +8609,41 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data "expert" macht sich diese Implementierung zu Nutze. Gleichwohl setzt "showInternalValues" - bei Definition - 'expert' außer Kraft . -
      • model, +
      • levelRange
        + nur für Dimmer! Der Dimmbereich wird eingeschränkt. + Es ist gedacht um z.B. LED Lichter unterstützen welche mit 10% beginnen und bei 40% bereits das Maximum haben. + levelrange normalisiert den Bereich entsprechend. D.h. set 100 wird physikalisch den Dimmer auf 40%, + 1% auf 10% setzen. 0% schaltet physikalisch aus.
        + Beeinflusst werdne Kommndos on, up, down, toggle und pct. Nicht beeinflusst werden Kommandos + die den Wert physikalisch setzen.
        + Zu beachten:
        + dimmer level von Peers gesetzt wird nicht beeinflusst. Dies wird durch Register konfiguriert.
        + Readings level könnte negative werden oder über 100%. Das kommt daher, dass physikalisch der Bereich 0-100% + ist aber auf den logischen bereicht normiert wird.
        + Sind virtuelle Dimmer Kanäle verfügbar muss das Attribut für jeden Kanal gesetzt werden
        + Beispiel:
        +
          + attr myChannel levelRange 0,40
          + attr myChannel levelRange 10,80
          +
        +
      • +
      • tempListTmpl
        + Setzt das Default für Heizungskontroller.
        + Format ist <file>:<templatename>. +
      • +
      • model, subType
        Diese Attribute werden bei erfolgreichem Pairing automatisch gesetzt. Sie sollten nicht per Hand gesetzt werden und sind notwendig um Gerätenachrichten korrekt interpretieren oder senden zu können.
      • param
        'param' definiert modelspezifische Verhalten oder Funktionen. Siehe "models" für Details.
      • -
      • msgRepeat
        +
      • msgRepeat
        Definiert die Nummer an Wiederholungen falls ein Gerät nicht rechtzeitig antwortet.
        Für Geräte die nur den "Config"-Modus unterstützen sind Wiederholungen nicht erlaubt.
        Bei Geräte mit wakeup-Modus wartet das Gerät bis zum nächsten Aufwachen. Eine längere Verzögerung sollte in diesem Fall angedacht werden.
        Wiederholen von Bursts hat Auswirkungen auf die HMLAN Übertragungskapazität.
      • -
      • burstAccess
        - kann für eine Geräteinstanz gesetzt werden falls das Model bedingte Bursts erlaubt. - Das Attribut deaktiviert den Burstbetrieb (0_off) was die Nachrichtenmenge des HMLAN reduziert - und damit die Wahrscheinlichkeit einer Überlast von HMLAN verringert.
        - Einschalten (1_auto) erlaubt kürzere Reaktionszeiten eines Geräts. Der Nutzer muss nicht warten - bis das Gerät wach ist.
        - Zu beacht ist dass das Register "burstRx" im Gerät ebenfalls gesetzt werden muss.
      • rawToReadable
        Wird verwendet um Rohdaten von KFM100 in ein lesbares Fomrat zu bringen, basierend auf den gemessenen Werten. Z.B. langsames Füllen eines Tanks, während die Werte mit inform @@ -8511,6 +8695,12 @@ sub CUL_HM_configUpdate($) {# mark entities with changed data msgReduce: falls gesetzt und der Kanal wird für genutzt wird jede Nachricht außer die der Ventilstellung verworfen um die Nachrichtenmenge zu reduzieren
      • +
      • blind
        + levelInverse während HM 100% als offen und 0% als geschlossen behandelt ist dies evtl. nicht + intuitiv für den Nutzer. Defaut für 100% ist offen und wird als 'on'angezeigt. + Das Setzen des Parameters invertiert die Anzeige - 0% wird also offen und 100% ist geschlossen.
        + ACHTUNG: Die Anpassung betrifft nur Readings und Kommandos. Register sind nicht betroffen.
        +

      Erzeugte Events: diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index a0df147a8..be45726b0 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -628,63 +628,7 @@ sub HMinfo_tempListTmpl(@) { ################################################## push @el,$chN; } return "no entities selected" if (!scalar @el); - - open(aSave, "$fName") || return("Can't open $fName: $!"); - my $found = 0; - my @entryFail = (); - my @exec = (); - - while(){ - chomp; - my $line = $_; - if($line =~ m/^entities:/){ - last if ($found != 0); - $line =~s/.*://; - foreach my $eN (split(",",$line)){ - $eN =~ s/ //g; - $found = 1 if ($eN eq $tmpl); - } - } - - elsif($found == 1 && $_ =~ m/(R_)?(P[123])?(_?._)?tempList[SMFWT].*\>/){ - my $rn = $line; - $rn =~ s/(.*tempList...).*/$1/; - my ($tln,$val) = ($1,$2)if($_ =~ m/(.*)>(.*)/); - $tln =~ s/ //g; - $tln = "R_".$tln if($tln !~ m/^R_/); - my $day = $dl{$1} if ($tln =~ m/tempList(...)/); - $tln =~s /tempList/${day}_tempList/ if ($tln !~ m/[0-6]_/); - - $val =~ tr/ +/ /; - $val =~ s/^ //; - $val =~ s/ $//; - @exec = (); - foreach my $eN(@el){ - if ($action eq "verify"){ - $val = join(" ",split(" ",$val)); - my $nv = ReadingsVal($eN,$tln,"empty"); - $nv = join(" ",split(" ",$nv)); - push @entryFail,$eN." :".$tln." mismatch" if ($val ne $nv); - } - elsif($action eq "restore"){ - $val = lc($1)." ".$val if ($tln =~ m/(P.)_._tempList/); - $tln =~ s/R_(P._)?._//; - my $x = CUL_HM_Set($defs{$eN},$eN,$tln,"prep",split(" ",$val)); - push @entryFail,$eN." :".$tln." respose:$x" if ($x ne "1"); - push @exec,$eN." ".$tln." exec ".$val; - } - } - } - $ret = "failed Entries:\n " .join("\n ",@entryFail) if (scalar@entryFail); - } - $ret .= "$tmpl not found in file $fName" if (!$found); - - foreach (@exec){ - my @param = split(" ",$_); - CUL_HM_Set($defs{$param[0]},@param); - } - close(aSave); - return $ret; + return CUL_HM_tempListTmpl(join(",",@el),$action,$fName.":".$tmpl); } sub HMinfo_getEntities(@) { ################################################### @@ -1746,7 +1690,6 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################

      HMinfo

      Set
        - even though the commands are more a get funktion they are implemented - as set to allow simple web interface usage
        + even though the commands are more a get funktion they are implemented + as set to allow simple web interface usage
        • update
          updates HM status counter.
        • -
        • autoReadReg [filter]
          schedules a read of the configuration for the CUL_HM devices with attribut autoReadReg set to 1 or higher.
        • @@ -1914,7 +1856,7 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
          -
        • tempList [filter][save|restore|verify] [<file>]
          +
        • tempList [filter] [save|restore|verify] [<file>]
          this function supports handling of tempList for thermstates. It allows templists to be saved in a separate file, verify settings against the file and write the templist of the file to the devices.
          @@ -1949,14 +1891,14 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
        File keywords
      • entities comma separated list of entities which refers to the temp lists following. - The actual entity holding the templist must be given - which is channel 04 for RTs or channel 02 for TCs
      • + The actual entity holding the templist must be given - which is channel 04 for RTs or channel 02 for TCs
      • tempList... time and temp couples as used in the set tempList commands

      • -
      • tempListTmpl [filter][templateName][verify|restore] [<file>]
        +
      • tempListTmpl [filter] [templateName][verify|restore] [<file>]
        program one or more thermostat lists. The list of thermostats is selected by filter.
          -
        • templateName is the name of the template as being named in the file. The file format ist +
        • templateName is the name of the template as being named in the file. The file format ist identical to tempList. If the entity in the file matches templateName the subsequent temp-settings from the file are bing programmed to all Thermostats that match the filter
        • file name of the file to be used. Default: tempList.cfg
        • @@ -1979,178 +1921,176 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
          Restrictions:
            - cpRegs will not add any peers or read from the devices. It is up to the user to read register in advance
            - cpRegs is only allowed between identical models
            - cpRegs expets that all readings are up-to-date. It is up to the user to ensure data consistency.
            + cpRegs will not add any peers or read from the devices. It is up to the user to read register in advance
            + cpRegs is only allowed between identical models
            + cpRegs expets that all readings are up-to-date. It is up to the user to ensure data consistency.
        • templateDef <name> <param> <desc> <reg1:val1> [<reg2:val2>] ...
          - define a template.
          - param gives the names of parameter necesary to execute the template. It is template dependant - and may be onTime or brightnesslevel. A list of parameter needs to be separated with colon
          - param1:param2:param3
          - if del is given as parameter the template is removed
          - desc shall give a description of the template
          - reg:val is the registername to be written and the value it needs to be set to.
          - In case the register is from link set and can destinguist between long and short it is necessary to leave the - leading sh or lg off.
          - if parameter are used it is necessary to enter p. as value with p0 first, p1 second parameter + define a template.
          + param gives the names of parameter necesary to execute the template. It is template dependant + and may be onTime or brightnesslevel. A list of parameter needs to be separated with colon
          + param1:param2:param3
          + if del is given as parameter the template is removed
          + desc shall give a description of the template
          + reg:val is the registername to be written and the value it needs to be set to.
          + In case the register is from link set and can destinguist between long and short it is necessary to leave the + leading sh or lg off.
          + if parameter are used it is necessary to enter p. as value with p0 first, p1 second parameter
          Example
            - set hm templateDef SwOnCond level:cond "my description" CtValLo:p0 CtDlyOn:p1 CtOn:geLo
            + set hm templateDef SwOnCond level:cond "my description" CtValLo:p0 CtDlyOn:p1 CtOn:geLo
        • templateSet <entity> <template> <peer:[long|short]> [<param1> ...]
          - sets a bunch of register accroding to a given template. Parameter may be added depending on - the template setup.
          - templateSet will collect and accumulate all changes. Finally the results are written streamlined.
          - entity: peer is the source entity. Peer needs to be given if a peer behabior beeds to be copied
          - template: one of the programmed template
          - peer: [long|short]:if necessary a peer needs to be given. If no peer is used enter '0'. - with a peer it should be given whether it is for long or short keypress
          - param: number and meaning of parameter depends on the given template
          + sets a bunch of register accroding to a given template. Parameter may be added depending on + the template setup.
          + templateSet will collect and accumulate all changes. Finally the results are written streamlined.
          + entity: peer is the source entity. Peer needs to be given if a peer behabior beeds to be copied
          + template: one of the programmed template
          + peer: [long|short]:if necessary a peer needs to be given. If no peer is used enter '0'. + with a peer it should be given whether it is for long or short keypress
          + param: number and meaning of parameter depends on the given template
          Example could be (templates not provided, just theoretical)
            - set hm templateSet Licht1 staircase FB1:short 20
            - set hm templateSet Licht1 staircase FB1:long 100
            + set hm templateSet Licht1 staircase FB1:short 20
            + set hm templateSet Licht1 staircase FB1:long 100
          Restrictions:
            - User must ensure to read configuration prior to execution.
            - templateSet may not setup a complete register block but only a part if it. This is up to template design.
            -
            + User must ensure to read configuration prior to execution.
            + templateSet may not setup a complete register block but only a part if it. This is up to template design.
            +
        +

      - - Get + Get
        N/A


      - Attributes
        -
      • sumStatus
        - Warnings: list of readings that shall be screend and counted based on current presence. - I.e. counter is the number of entities with this reading and the same value. - Readings to be searched are separated by comma.
        - Example:
        -
          - attr hm sumStatus battery,sabotageError
          -
        - will cause a reading like
        - W_sum_batterie ok:5 low:3
        - W_sum_sabotageError on:1
        -
        - Note: counter with '0' value will not be reported. HMinfo will find all present values autonomously
        - Setting is meant to give user a fast overview of parameter that are expected to be system critical
        -
      • -
      • sumERROR - Similar to sumStatus but with a focus on error conditions in the system. - Here user can add readingvalues that are not displayed. I.e. the value is the - good-condition that will not be counted.
        - This way user must not know all error values but it is sufficient to supress known non-ciritical ones. -
        - Example:
        -
          - attr hm sumERROR battery:ok,sabotageError:off,overheat:off,Activity:alive:unknown
          -
        - will cause a reading like
        -
          - ERR_batterie low:3
          - ERR_sabotageError on:1
          - ERR_overheat on:3
          - ERR_Activity dead:5
          -
        -
      • -
      • autoUpdate - retriggers the command update periodically.
        - Example:
        -
          - attr hm autoUpdate 00:10
          -
        - will trigger the update every 10 min
        -
      • -
      • autoArchive - if set fhem will update the configFile each time the new data is available. - The update will happen with autoUpdate. It will not - work it autoUpdate is not used.
        - see also archConfig -
        -
      • -
      • hmAutoReadScan - defines the time in seconds CUL_HM tries to schedule the next autoRead - from the queue. Despite this timer FHEM will take care that only one device from the queue will be - handled at one point in time. With this timer user can stretch timing even further - to up to 300sec - min delay between execution.
        - Setting to 1 still obeys the "only one at a time" prinzip.
        - Note that compressing will increase message load while stretch will extent waiting time.
        -
      • -
      • hmIoMaxDly - max time in seconds CUL_HM stacks messages if the IO device is not ready to send. - If the IO device will not reappear in time all command will be deleted and IOErr will be reported.
        - Note: commands will be executed after the IO device reappears - which could lead to unexpected - activity long after command issue.
        - default is 60sec. max value is 3600sec
        -
      • -
      • configDir - default directory where to store and load configuration files from. - This path is used as long as the path is not given in a filename of - a given command.
        - It is used by commands like tempList or saveConfig
        -
      • -
      • configFilename - default filename used by - saveConfig, - purgeConfig, - loadConfig
        -
      • -
      • hmManualOper - set to 1 will prevent any automatic operation, update or default settings - in CUL_HM.
        -
      • - +
      • sumStatus
        + Warnings: list of readings that shall be screend and counted based on current presence. + I.e. counter is the number of entities with this reading and the same value. + Readings to be searched are separated by comma.
        + Example:
        +
          + attr hm sumStatus battery,sabotageError
          +
        + will cause a reading like
        + W_sum_batterie ok:5 low:3
        + W_sum_sabotageError on:1
        +
        + Note: counter with '0' value will not be reported. HMinfo will find all present values autonomously
        + Setting is meant to give user a fast overview of parameter that are expected to be system critical
        +
      • +
      • sumERROR + Similar to sumStatus but with a focus on error conditions in the system. + Here user can add readingvalues that are not displayed. I.e. the value is the + good-condition that will not be counted.
        + This way user must not know all error values but it is sufficient to supress known non-ciritical ones. +
        + Example:
        +
          + attr hm sumERROR battery:ok,sabotageError:off,overheat:off,Activity:alive:unknown
          +
        + will cause a reading like
        +
          + ERR_batterie low:3
          + ERR_sabotageError on:1
          + ERR_overheat on:3
          + ERR_Activity dead:5
          +
        +
      • +
      • autoUpdate + retriggers the command update periodically.
        + Example:
        +
          + attr hm autoUpdate 00:10
          +
        + will trigger the update every 10 min
        +
      • +
      • autoArchive + if set fhem will update the configFile each time the new data is available. + The update will happen with autoUpdate. It will not + work it autoUpdate is not used.
        + see also archConfig +
        +
      • +
      • hmAutoReadScan + defines the time in seconds CUL_HM tries to schedule the next autoRead + from the queue. Despite this timer FHEM will take care that only one device from the queue will be + handled at one point in time. With this timer user can stretch timing even further - to up to 300sec + min delay between execution.
        + Setting to 1 still obeys the "only one at a time" prinzip.
        + Note that compressing will increase message load while stretch will extent waiting time.
        +
      • +
      • hmIoMaxDly + max time in seconds CUL_HM stacks messages if the IO device is not ready to send. + If the IO device will not reappear in time all command will be deleted and IOErr will be reported.
        + Note: commands will be executed after the IO device reappears - which could lead to unexpected + activity long after command issue.
        + default is 60sec. max value is 3600sec
        +
      • +
      • configDir + default directory where to store and load configuration files from. + This path is used as long as the path is not given in a filename of + a given command.
        + It is used by commands like tempList or saveConfig
        +
      • +
      • configFilename + default filename used by + saveConfig, + purgeConfig, + loadConfig
        +
      • +
      • hmManualOper + set to 1 will prevent any automatic operation, update or default settings + in CUL_HM.
        +

      Variables
        -
      • I_autoReadPend: Info:list of entities which are queued to retrieve config and status. - This is typically scheduled thru autoReadReg
      • -
      • ERR___rssiCrit: Error:list of devices with RSSI reading n min level
      • -
      • W_unConfRegs: Warning:list of entities with unconfirmed register changes. Execute getConfig to clear this.
      • -
      • I_rssiMinLevel: Info:counts of rssi min readings per device, clustered in blocks
      • - -
      • ERR__protocol: Error:count of non-recoverable protocol events per device. - Those events are NACK, IOerr, ResendFail, CmdDel, CmdPend.
        - Counted are the number of device with those events, not the number of events!
      • -
      • ERR__protoNames: Error:name-list of devices with non-recoverable protocol events
      • -
      • I_HM_IOdevices: Info:list of IO devices used by CUL_HM entities
      • -
      • I_actTotal: Info:action detector state, count of devices with ceratin states
      • -
      • ERRactNames: Error:names of devices that are not alive according to ActionDetector
      • -
      • C_sumDefined: Count:defined entities in CUL_HM. Entites might be count as - device AND channel if channel funtion is covered by the device itself. Similar to virtual
      • -
      • ERR_<reading>: Error:count of readings as defined in attribut - sumERROR - that do not match the good-content.
      • -
      • ERR_names: Error:name-list of entities that are counted in any ERR_<reading> - W_sum_<reading>: count of readings as defined in attribut - sumStatus.
      • - Example:
        -
          - ERR___rssiCrit LightKittchen,WindowDoor,Remote12
          - ERR__protocol NACK:2 ResendFail:5 CmdDel:2 CmdPend:1
          - ERR__protoNames LightKittchen,WindowDoor,Remote12,Ligth1,Light5
          - ERR_battery: low:2;
          - ERR_names: remote1,buttonClara,
          - I_rssiMinLevel 99>:3 80<:0 60<:7 59<:4
          - W_sum_battery: ok:5;low:2;
          - W_sum_overheat: off:7;
          - C_sumDefined: entities:23 device:11 channel:16 virtual:5;
          -
        +
      • I_autoReadPend: Info:list of entities which are queued to retrieve config and status. + This is typically scheduled thru autoReadReg
      • +
      • ERR___rssiCrit: Error:list of devices with RSSI reading n min level
      • +
      • W_unConfRegs: Warning:list of entities with unconfirmed register changes. Execute getConfig to clear this.
      • +
      • I_rssiMinLevel: Info:counts of rssi min readings per device, clustered in blocks
      • + +
      • ERR__protocol: Error:count of non-recoverable protocol events per device. + Those events are NACK, IOerr, ResendFail, CmdDel, CmdPend.
        + Counted are the number of device with those events, not the number of events!
      • +
      • ERR__protoNames: Error:name-list of devices with non-recoverable protocol events
      • +
      • I_HM_IOdevices: Info:list of IO devices used by CUL_HM entities
      • +
      • I_actTotal: Info:action detector state, count of devices with ceratin states
      • +
      • ERRactNames: Error:names of devices that are not alive according to ActionDetector
      • +
      • C_sumDefined: Count:defined entities in CUL_HM. Entites might be count as + device AND channel if channel funtion is covered by the device itself. Similar to virtual
      • +
      • ERR_<reading>: Error:count of readings as defined in attribut + sumERROR + that do not match the good-content.
      • +
      • ERR_names: Error:name-list of entities that are counted in any ERR_<reading> + W_sum_<reading>: count of readings as defined in attribut + sumStatus.
      • + Example:
        +
          + ERR___rssiCrit LightKittchen,WindowDoor,Remote12
          + ERR__protocol NACK:2 ResendFail:5 CmdDel:2 CmdPend:1
          + ERR__protoNames LightKittchen,WindowDoor,Remote12,Ligth1,Light5
          + ERR_battery: low:2;
          + ERR_names: remote1,buttonClara,
          + I_rssiMinLevel 99>:3 80<:0 60<:7 59<:4
          + W_sum_battery: ok:5;low:2;
          + W_sum_overheat: off:7;
          + C_sumDefined: entities:23 device:11 channel:16 virtual:5;
          +
    =end html -=cut +=cut \ No newline at end of file diff --git a/fhem/FHEM/98_apptime.pm b/fhem/FHEM/98_apptime.pm index 8dcfdab22..f5a8261f1 100644 --- a/fhem/FHEM/98_apptime.pm +++ b/fhem/FHEM/98_apptime.pm @@ -1,6 +1,6 @@ ################################################################ # 98_apptime:application timing -# $Id: $ +# $Id$ ################################################################ ##################################################### diff --git a/fhem/FHEM/HMConfig.pm b/fhem/FHEM/HMConfig.pm index c5b7d221b..4f7a820e9 100644 --- a/fhem/FHEM/HMConfig.pm +++ b/fhem/FHEM/HMConfig.pm @@ -1435,6 +1435,7 @@ $culHmModelSets{"HM-Sen-Wa-Od"} = $culHmModelSets{"HM-SEC-SD"}; ,tempListThu =>"[prep|exec] HH:MM temp ..." ,tempListWed =>"[prep|exec] HH:MM temp ..." ,tempListFri =>"[prep|exec] HH:MM temp ..." + ,tempListTmpl =>"[verify|restore] [[:]templateName] ..." ,"desired-temp" =>"[on|off|5.0..30.0]" ,sysTime =>"" }, @@ -1449,6 +1450,7 @@ $culHmModelSets{"HM-Sen-Wa-Od"} = $culHmModelSets{"HM-SEC-SD"}; ,tempListWed =>"[prep|exec] [p1|p2|p3] HH:MM temp ..." ,tempListFri =>"[prep|exec] [p1|p2|p3] HH:MM temp ..." ,"desired-temp" =>"[on|off|5.0..30.0]" + ,tempListTmpl =>"[verify|restore] [[:]templateName] ..." ,peerChan =>" ... single [set|unset] [actor|remote|both]" }, "HM-TC-IT-WM-W-EU01"=>{ peerChan =>" ... single [set|unset] [actor|remote|both]"},