From d17f030cd041d33ac33e2144b5da9e697befe84a Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Fri, 4 Sep 2020 14:38:17 +0000 Subject: [PATCH] 93_DbRep: contrib 8.40.7 git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@22732 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- contrib/DS_Starter/93_DbRep.pm | 194 ++++++++++++++++++--------------- 1 file changed, 106 insertions(+), 88 deletions(-) diff --git a/contrib/DS_Starter/93_DbRep.pm b/contrib/DS_Starter/93_DbRep.pm index 80058c58c..47ed01166 100644 --- a/contrib/DS_Starter/93_DbRep.pm +++ b/contrib/DS_Starter/93_DbRep.pm @@ -1107,8 +1107,7 @@ sub DbRep_Get { $ret .= ""; } - # Notes - if(!$prop || $prop =~ /rel/) { + if(!$prop || $prop =~ /rel/) { # Notes $ret .= sprintf("
$header
"); $ret .= ""; $ret .= ""; @@ -1119,8 +1118,7 @@ sub DbRep_Get { $ret .= sprintf("" ); $ret .= ""; $i++; - if ($i & 1) { - # $i ist ungerade + if ($i & 1) { # $i ist ungerade $ret .= ""; } else { $ret .= ""; @@ -13436,7 +13434,7 @@ return;

-
  • dbstatus - lists global informations about MySQL server status (e.g. informations related to cache, threads, bufferpools, etc. ). +
  • dbstatus - lists global information about MySQL server status (e.g. informations related to cache, threads, bufferpools, etc. ). Initially all available informations are reported. Using the attribute "showStatus" the quantity of results can be limited to show only the desired values. Further detailed informations of items meaning are explained there.

    @@ -13452,8 +13450,20 @@ return;
  • sqlCmdBlocking <SQL-statement> - - Executes the specified SQL-statement in blocking manner. Because of its mode of operation - this function is particular convenient for user own perl scripts.
    + Executes the specified SQL-statement in blocking manner. + +

    + +
      + Examples:
      + { fhem("get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") }
      + { CommandGet(undef,"Rep.LogDB1 sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") }
      + get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device
      +
    +
  • +
    + + Because of its mode of operation this function is particular convenient for user own perl scripts.
    The input accepts multi line commands and delivers multi line results as well. This command also accept the setting of SQL session variables like "SET @open:=NULL, @closed:=NULL;".
    @@ -13461,15 +13471,6 @@ return; by attribute "sqlResultFieldSep" (default "|"). Several result lines are separated by newline ("\n").
    This function only set/update status readings, the userExitFn function isn't called. -

    - - -

    If you create a little routine in 99_myUtils, for example: @@ -13568,23 +13569,28 @@ sub dbval {
  • versionNotes [hints | rel | <key>] - - Shows realease informations and/or hints about the module. It contains only main release - informations for module users.
    - If no options are specified, both release informations and hints will be shown. "rel" shows - only release informations and "hints" shows only hints. By the <key>-specification only - the hint with the specified number is shown. + Shows realease informations and/or hints about the module. +

      -
  • $key $val0 $val1
    - - - - -
    rel : zeigt nur Release Informationen
    hints : zeigt nur Hinweise an
    <key> : es wird der Hinweis mit der angegebenen Nummer angezeigt
    + + + + + +
    rel : shows only release information
    hints : shows only hints
    <key> : the note with the specified number is displayed
    - + + +
    + + It contains only main release informations for module users.
    + If no options are specified, both release informations and hints will be shown. "rel" shows + only release informations and "hints" shows only hints. By the <key>-specification only + the hint with the specified number is shown. +
    @@ -14634,23 +14640,24 @@ sub bdump {
    -
    - +
    + +
  • delDoublets [adviceDelete | delete] - zeigt bzw. löscht doppelte / mehrfach vorkommende Datensätze. Dazu wird Timestamp, Device,Reading und Value ausgewertet.
    Die Attribute zur Aggregation,Zeit-,Device- und Reading-Abgrenzung werden dabei berücksichtigt. Ist das Attribut "aggregation" nicht oder auf "no" gesetzt, wird im Standard die Aggregation "day" verwendet.

    +

  • -
    - - +
  • delEntries [<no>[:<nn>]] - löscht alle oder die durch die Attribute device und/oder reading definierten Datenbankeinträge. Die Eingrenzung über Timestamps erfolgt @@ -16067,8 +16081,8 @@ sub bdump {
      Beispiel
      - get <name> dbstatus
      - attr <name> showStatus %uptime%,%qcache%
      + attr <name> showStatus %uptime%,%qcache%
      + get <name> dbstatus
      # Es werden nur Readings erzeugt die im Namen "uptime" und "qcache" enthaltenen
  • @@ -16077,19 +16091,6 @@ sub bdump {
  • sqlCmdBlocking <SQL-Statement> - Führt das angegebene SQL-Statement blockierend mit einem Standardtimeout von 10 Sekunden aus. - Der Timeout kann mit dem Attribut timeout verändert werden. -
    - - Diese Funktion ist durch ihre Arbeitsweise - speziell für den Einsatz in benutzerspezifischen Scripten geeignet.
    - Die Eingabe akzeptiert Mehrzeiler und gibt ebenso mehrzeilige Ergebisse zurück. - Dieses Kommando akzeptiert ebenfalls das Setzen von SQL Session Variablen wie z.B. - "SET @open:=NULL, @closed:=NULL;".
    - Werden mehrere Felder selektiert und zurückgegeben, erfolgt die Feldtrennung mit dem Trenner - des Attributes "sqlResultFieldSep" (default "|"). Mehrere Ergebniszeilen - werden mit Newline ("\n") separiert.
    - Diese Funktion setzt/aktualisiert nur Statusreadings, die Funktion im Attribut "userExitFn" - wird nicht aufgerufen.

      @@ -16099,6 +16100,20 @@ sub bdump { get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device
  • +
    + + Der Timeout kann mit dem Attribut timeout verändert werden. +
    + + Diese Funktion ist durch ihre Arbeitsweise speziell für den Einsatz in benutzerspezifischen Scripten geeignet.
    + Die Eingabe akzeptiert Mehrzeiler und gibt ebenso mehrzeilige Ergebisse zurück. + Dieses Kommando akzeptiert ebenfalls das Setzen von SQL Session Variablen wie z.B. + "SET @open:=NULL, @closed:=NULL;".
    + Werden mehrere Felder selektiert und zurückgegeben, erfolgt die Feldtrennung mit dem Trenner + des Attributes "sqlResultFieldSep" (default "|"). Mehrere Ergebniszeilen + werden mit Newline ("\n") separiert.
    + Diese Funktion setzt/aktualisiert nur Statusreadings, die Funktion im Attribut "userExitFn" + wird nicht aufgerufen.

    Erstellt man eine kleine Routine in 99_myUtils, wie z.B.: @@ -16132,8 +16147,8 @@ sub dbval { @@ -16173,8 +16188,8 @@ sub dbval { @@ -16188,8 +16203,8 @@ sub dbval { @@ -16197,9 +16212,7 @@ sub dbval {
  • versionNotes [hints | rel | <key>] - - Zeigt Release Informationen und/oder Hinweise zum Modul an. Es sind nur Release Informationen mit - Bedeutung für den Modulnutzer enthalten.
    - Sind keine Optionen angegben, werden sowohl Release Informationen als auch Hinweise angezeigt. + Zeigt Release Informationen und/oder Hinweise zum Modul an.

      @@ -16211,7 +16224,12 @@ sub dbval {
    -
  • + + +
    + Sind keine Optionen angegeben, werden sowohl Release Informationen als auch Hinweise angezeigt. + Es sind nur Release Informationen mit Bedeutung für den Modulnutzer enthalten.
    +