From 9ba5e95a5d3596f9965f5f21e0dcdf1ff420b479 Mon Sep 17 00:00:00 2001 From: DS_Starter Date: Mon, 29 Jan 2018 16:30:04 +0000 Subject: [PATCH] 93_DbRep: V7.6.1, data with "|" in value are possible to process, attr "sqlCmdHistoryLength" to use sqlCmdHistory list, attr "fetchMarkDuplicates" to highlight multiple data git-svn-id: https://svn.fhem.de/fhem/trunk@16040 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 3 + fhem/FHEM/93_DbRep.pm | 650 ++++++++++++++++++++++++++++++++---------- 2 files changed, 504 insertions(+), 149 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index fea3edfd7..799629ca4 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,8 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 93_DbRep: V7.6.1, data with "|" in value are possible to process, + attr "sqlCmdHistoryLength" to use sqlCmdHistory list, + attr "fetchMarkDuplicates" to highlight multiple data - update: 88_HMCCU: Version 4.2 - new: 88_HMCCURPCPROC: Sub process based RPC server for HMCCU. - feature: 73_PRESENCE: new collectord package (RSSI based room selection diff --git a/fhem/FHEM/93_DbRep.pm b/fhem/FHEM/93_DbRep.pm index e1323f1af..311a840e8 100644 --- a/fhem/FHEM/93_DbRep.pm +++ b/fhem/FHEM/93_DbRep.pm @@ -36,7 +36,12 @@ # ########################################################################################################################### # Versions History: -# +# +# 7.6.1 27.01.2018 new attribute "sqlCmdHistoryLength" and "fetchMarkDuplicates" for highlighting multiple +# datasets by fetchrows +# 7.6.0 26.01.2018 events containing "|" possible in fetchrows & delSeqDoublets, fetchrows displays multiple +# $k entries with timestamp suffix $k (as index), sqlCmdHistory (avaiable if sqlCmd was +# executed) # 7.5.5 25.01.2018 minor change in delSeqDoublets # 7.5.4 24.01.2018 delseqdoubl_DoParse reviewed to optimize memory usage, executeBeforeDump executeAfterDump # now available for "delSeqDoublets" @@ -287,14 +292,16 @@ use Scalar::Util qw(looks_like_number); eval "use DBI;1" or my $DbRepMMDBI = "DBI"; use DBI::Const::GetInfoType; use Blocking; +use Color; # colorpicker Widget use Time::Local; use Encode qw(encode_utf8); -# no if $] >= 5.017011, warnings => 'experimental'; +# no if $] >= 5.018000, warnings => 'experimental'; +no if $] >= 5.017011, warnings => 'experimental::smartmatch'; sub DbRep_Main($$;$); -sub DbLog_cutCol($$$$$$$); # DbLog-Funktion nutzen um Daten auf maximale Länge beschneiden +sub DbLog_cutCol($$$$$$$); # DbLog-Funktion nutzen um Daten auf maximale Länge beschneiden -my $DbRepVersion = "7.5.5"; +my $DbRepVersion = "7.6.1"; my %dbrep_col = ("DEVICE" => 64, "TYPE" => 64, @@ -310,7 +317,8 @@ my %dbrep_col = ("DEVICE" => 64, sub DbRep_Initialize($) { my ($hash) = @_; $hash->{DefFn} = "DbRep_Define"; - $hash->{UndefFn} = "DbRep_Undef"; + $hash->{UndefFn} = "DbRep_Undef"; + $hash->{ShutdownFn} = "DbRep_Shutdown"; $hash->{NotifyFn} = "DbRep_Notify"; $hash->{SetFn} = "DbRep_Set"; $hash->{GetFn} = "DbRep_Get"; @@ -331,6 +339,7 @@ sub DbRep_Initialize($) { "executeAfterProc ". "expimpfile ". "fetchRoute:ascent,descent ". + "fetchMarkDuplicates:red,blue,brown,green,orange ". "ftpDebug:1,0 ". "ftpDir ". "ftpDumpFilesKeep:1,2,3,4,5,6,7,8,9,10 ". @@ -355,6 +364,7 @@ sub DbRep_Initialize($) { "showVariables ". "showStatus ". "showTableInfo ". + "sqlCmdHistoryLength:0,5,10,15,20,25,30,35,40,45,50 ". "sqlResultFormat:separated,mline,sline,table,json ". "sqlResultFieldSep:|,:,\/ ". "timeYearPeriod ". @@ -391,13 +401,17 @@ sub DbRep_Define($@) { $hash->{ROLE} = AttrVal($name, "role", "Client"); $hash->{HELPER}{DBLOGDEVICE} = $a[2]; $hash->{VERSION} = $DbRepVersion; - $hash->{NOTIFYDEV} = "global,".$name; # nur Events dieser Devices an DbRep_Notify weiterleiten - my $dbconn = $defs{$a[2]}{dbconn}; $hash->{DATABASE} = (split(/;|=/, $dbconn))[1]; $hash->{UTF8} = defined($defs{$a[2]}{UTF8})?$defs{$a[2]}{UTF8}:0; + my ($err,$hl) = DbRep_getCmdFile($name."_sqlCmdList"); + if(!$err) { + $hash->{HELPER}{SQLHIST} = $hl; + Log3 ($name, 4, "DbRep $name - history sql commandlist read from file ".$attr{global}{modpath}."/FHEM/FhemUtils/cacheDbRep"); + } + RemoveInternalTimer($hash); InternalTimer(time+5, 'DbRep_firstconnect', $hash, 0); @@ -445,6 +459,9 @@ sub DbRep_Set($@) { closedir(DIR); my $cj = @bkps?join(",",reverse(sort @bkps)):" "; + # Drop-Down Liste bisherige Befehle in "sqlCmd" erstellen + my $hl = $hash->{HELPER}{SQLHIST}.",___purge_historylist___" if($hash->{HELPER}{SQLHIST}); + my $setlist = "Unknown argument $opt, choose one of ". (($hash->{ROLE} ne "Agent")?"sumValue:display,writeToDB ":""). (($hash->{ROLE} ne "Agent")?"averageValue:display,writeToDB ":""). @@ -459,7 +476,8 @@ sub DbRep_Set($@) { (($hash->{ROLE} ne "Agent")?"fetchrows:history,current ":""). (($hash->{ROLE} ne "Agent")?"diffValue:display,writeToDB ":""). (($hash->{ROLE} ne "Agent")?"insert ":""). - (($hash->{ROLE} ne "Agent")?"sqlCmd ":""). + (($hash->{ROLE} ne "Agent")?"sqlCmd ":""). + (($hash->{ROLE} ne "Agent" && $hl)?"sqlCmdHistory:".$hl." ":""). (($hash->{ROLE} ne "Agent")?"tableCurrentFillup:noArg ":""). (($hash->{ROLE} ne "Agent")?"tableCurrentPurge:noArg ":""). (($hash->{ROLE} ne "Agent" && $dbmodel =~ /MYSQL/ )?"dumpMySQL:clientSide,serverSide ":""). @@ -674,14 +692,26 @@ sub DbRep_Set($@) { } DbRep_Main($hash,$opt); - } elsif ($opt eq "sqlCmd") { - $hash->{LASTCMD} = $prop?"$opt $prop":"$opt"; - # Execute a generic sql command + } elsif ($opt =~ /sqlCmd|sqlCmdHistory/) { return "\"set $opt\" needs at least an argument" if ( @a < 3 ); # remove arg 0, 1 to get SQL command - shift @a; - shift @a; - my $sqlcmd = join( " ", @a ); + my $sqlcmd; + if($opt eq "sqlCmd") { + shift @a; + shift @a; + $sqlcmd = join(" ", @a); + } + if($opt eq "sqlCmdHistory") { + $prop =~ tr/ A-Za-z0-9!"#$%&'()*+,-.\/:;<=>?@[\\]^_`{|}~äöüÄÖÜ߀/ /cs; + $prop =~ s//,/g; + $sqlcmd = $prop; + if($sqlcmd eq "___purge_historylist___") { + delete($hash->{HELPER}{SQLHIST}); + DbRep_setCmdFile($name."_sqlCmdList","",$hash); # Löschen der sql History Liste im DbRep-Keyfile + return "SQL command historylist of $name deleted."; + } + } + $hash->{LASTCMD} = $sqlcmd?"$opt $sqlcmd":"$opt"; if ($sqlcmd =~ m/^\s*delete/is && !AttrVal($hash->{NAME}, "allowDeletion", undef)) { return " Attribute 'allowDeletion = 1' is needed for command '$sqlcmd'. Use it with care !"; } @@ -799,6 +829,7 @@ sub DbRep_Attr($$$$) { dumpSpeed optimizeTablesBeforeDump seqDoubletsVariance + sqlCmdHistoryLength timeYearPeriod timestamp_begin timestamp_end @@ -812,10 +843,8 @@ sub DbRep_Attr($$$$) { $do = ($aVal) ? 1 : 0; } $do = 0 if($cmd eq "del"); - my $val = ($do == 1 ? "disabled" : "initialized"); - + my $val = ($do == 1 ? "disabled" : "initialized"); ReadingsSingleUpdateValue ($hash, "state", $val, 1); - if ($do == 0) { RemoveInternalTimer($hash); InternalTimer(time+5, 'DbRep_firstconnect', $hash, 0); @@ -823,7 +852,6 @@ sub DbRep_Attr($$$$) { my $dbh = $hash->{DBH}; $dbh->disconnect() if($dbh); } - } if ($cmd eq "set" && $hash->{ROLE} eq "Agent") { @@ -840,6 +868,17 @@ sub DbRep_Attr($$$$) { delete $hash->{HELPER}{RDPFDEL} if($hash->{HELPER}{RDPFDEL}); } } + + if ($aName eq "sqlCmdHistoryLength") { + if($cmd eq "set") { + $do = ($aVal) ? 1 : 0; + } + $do = 0 if($cmd eq "del"); + if ($do == 0) { + delete($hash->{HELPER}{SQLHIST}); + DbRep_setCmdFile($name."_sqlCmdList","",$hash); # Löschen der sql History Liste im DbRep-Keyfile + } + } if ($aName eq "userExitFn") { if($cmd eq "set") { @@ -1071,10 +1110,25 @@ sub DbRep_Undef($$) { BlockingKill($hash->{HELPER}{RUNNING_BACKUP_CLIENT}) if (exists($hash->{HELPER}{RUNNING_BACKUP_CLIENT})); BlockingKill($hash->{HELPER}{RUNNING_BCKPREST_SERVER}) if (exists($hash->{HELPER}{RUNNING_BCKPREST_SERVER})); BlockingKill($hash->{HELPER}{RUNNING_OPTIMIZE}) if (exists($hash->{HELPER}{RUNNING_OPTIMIZE})); + + DbRep_delread($hash,1); return undef; } +################################################################################### +# DbRep_Shutdown +################################################################################### +sub DbRep_Shutdown($) { + my ($hash) = @_; + + my $dbh = $hash->{DBH}; + $dbh->disconnect() if(defined($dbh)); + DbRep_delread($hash,1); + RemoveInternalTimer($hash); + +return undef; +} ################################################################################### # First Init DB Connect @@ -1282,7 +1336,7 @@ sub DbRep_Main($$;$) { } elsif ($opt =~ /deviceRename|readingRename/) { $hash->{HELPER}{RUNNING_PID} = BlockingCall("devren_Push", "$name", "devren_Done", $to, "ParseAborted", $hash); - } elsif ($opt eq "sqlCmd" ) { + } elsif ($opt =~ /sqlCmd/ ) { # Execute a generic sql command $hash->{HELPER}{RUNNING_PID} = BlockingCall("sqlCmd_DoParse", "$name|$opt|$runtime_string_first|$runtime_string_next|$prop", "sqlCmd_ParseDone", $to, "ParseAborted", $hash); } @@ -4033,6 +4087,7 @@ sub fetchrows_DoParse($) { $nrows = $#row_array+1; # Anzahl der Ergebniselemente pop @row_array if($nrows>$limit); # das zuviel selektierte Element wegpoppen wenn Limit überschritten + s/\|/_E#S#C_/g for @row_array; # escape Pipe "|" if ($utf8) { $rowlist = Encode::encode_utf8(join('|', @row_array)); } else { @@ -4073,6 +4128,9 @@ sub fetchrows_ParseDone($) { my $name = $hash->{NAME}; my $reading = AttrVal($name, "reading", undef); my $limit = AttrVal($name, "limit", 1000); + my $color = ""; # Highlighting doppelter DB-Einträge + $color =~ s/#// if($color =~ /red|blue|brown|green|orange/); + my $ecolor = ""; # Ende Highlighting my @i; my @row; my $reading_runtime_string; @@ -4088,28 +4146,51 @@ sub fetchrows_ParseDone($) { } my @row_array = split("\\|", $rowlist); + s/_E#S#C_/\|/g for @row_array; # escaped Pipe return to "|" Log3 ($name, 5, "DbRep $name - row_array decoded: @row_array"); # Readingaufbereitung readingsBeginUpdate($hash); - + my $orow; + my $dz = 1; # Index des Vorkommens im Selektionsarray foreach my $row (@row_array) { - my @a = split("_ESC_", $row, 6); + if($orow) { + if($orow eq $row) { + $dz++; + + } else { + $dz = 1; + } + } + $orow = $row; + if($dz > 1) { + # Hervorhebung von multiplen Datensätzen + # $dz = "".$dz.""; + } + my @a = split("_ESC_", $row, 6); my $dev = $a[0]; my $rea = $a[1]; $a[3] =~ s/:/-/g; # substituieren unsupported characters ":" -> siehe fhem.pl my $ts = $a[2]."_".$a[3]; my $val = $a[4]; my $unt = $a[5]; - + $val = $unt?$val." ".$unt:$val; + if ($reading && AttrVal($hash->{NAME}, "readingNameMap", "")) { - $reading_runtime_string = $ts."__".AttrVal($hash->{NAME}, "readingNameMap", "") ; + if($dz > 1 && AttrVal($name, "fetchMarkDuplicates", undef)) { + $reading_runtime_string = $ts."__".$color.$dz."__".AttrVal($hash->{NAME}, "readingNameMap", "").$ecolor; + } else { + $reading_runtime_string = $ts."__".$dz."__".AttrVal($hash->{NAME}, "readingNameMap", ""); + } } else { - $reading_runtime_string = $ts."__".$dev."__".$rea; + if($dz > 1 && AttrVal($name, "fetchMarkDuplicates", undef)) { + $reading_runtime_string = $ts."__".$color.$dz."__".$dev."__".$rea.$ecolor; + } else { + $reading_runtime_string = $ts."__".$dz."__".$dev."__".$rea; + } } - - $val = $unt?$val." ".$unt:$val; + ReadingsBulkUpdateValue($hash, $reading_runtime_string, $val); } my $sfx = AttrVal("global", "language", "EN"); @@ -4281,7 +4362,8 @@ sub delseqdoubl_DoParse($) { my $retn = ($opt =~ /adviceRemain/)?$nremain:($opt =~ /adviceDelete/)?$ntodel:$ndel; - my @retarray = ($opt =~ /adviceRemain/)?@remain:($opt =~ /adviceDelete/)?@todel:" "; + my @retarray = ($opt =~ /adviceRemain/)?@remain:($opt =~ /adviceDelete/)?@todel:" "; + s/\|/_E#S#C_/g for @retarray; # escape Pipe "|" if ($utf8 && @retarray) { $rowlist = Encode::encode_utf8(join('|', @retarray)); } elsif(@retarray) { @@ -4348,13 +4430,14 @@ sub delseqdoubl_ParseDone($) { no warnings 'uninitialized'; if ($opt !~ /delete/ && $rowlist) { my @row_array = split("\\|", $rowlist); + s/_E#S#C_/\|/g for @row_array; # escaped Pipe return to "|" Log3 ($name, 5, "DbRep $name - row_array decoded: @row_array"); foreach my $row (@row_array) { last if($l >= $limit); my @a = split("_ESC_", $row, 5); my $dev = $a[0]; my $rea = $a[1]; - $a[3] =~ s/:/-/g; # substituieren unsupported characters ":" -> siehe fhem.pl + $a[3] =~ s/:/-/g; # substituieren unsupported characters ":" -> siehe fhem.pl my $ts = $a[2]."_".$a[3]; my $val = $a[4]; @@ -4898,7 +4981,6 @@ sub sqlCmd_ParseDone($) { Log3 ($name, 5, "DbRep $name - SQL result decoded: $rowstring") if($rowstring); - # only for this block because of warnings if details of readings are not set no warnings 'uninitialized'; # Readingaufbereitung @@ -4907,6 +4989,20 @@ sub sqlCmd_ParseDone($) { ReadingsBulkUpdateValue ($hash, "sqlCmd", $cmd); ReadingsBulkUpdateValue ($hash, "sqlResultNumRows", $nrows); + # Drop-Down Liste bisherige sqlCmd-Befehle füllen und in Key-File sichern + # my $hl = $hash->{HELPER}{SQLHIST}; + my @sqlhist = split(",",$hash->{HELPER}{SQLHIST}); + $cmd =~ s/\s/ /g; + $cmd =~ s/,//g; + my $hlc = AttrVal($name, "sqlCmdHistoryLength", 0); # Anzahl der Einträge in Drop-Down Liste + if(!@sqlhist || (@sqlhist && !($cmd ~~ @sqlhist))) { + unshift @sqlhist,$cmd; + pop @sqlhist if(@sqlhist > $hlc); + my $hl = join(",",@sqlhist); + $hash->{HELPER}{SQLHIST} = $hl; + DbRep_setCmdFile($name."_sqlCmdList",$hl,$hash); + } + if ($srf eq "sline") { $rowstring =~ s/§/]|[/g; $rowstring =~ s/\|°escaped°\|/§/g; @@ -7011,13 +7107,25 @@ return; #################################################################################################### # delete Readings before new operation #################################################################################################### -sub DbRep_delread($) { +sub DbRep_delread($;$$) { # Readings löschen die nicht in der Ausnahmeliste (Attr readingPreventFromDel) stehen - my ($hash) = @_; + my ($hash,$shutdown) = @_; my $name = $hash->{NAME}; - my @allrds = keys%{$defs{$name}{READINGS}}; + my @allrds = keys%{$defs{$name}{READINGS}}; + if($shutdown) { + my $do = 0; + foreach my $key(@allrds) { + # Highlighted Readings löschen und save statefile wegen Inkompatibilitär beim Restart + if($key =~ /{HELPER}{RDPFDEL}) if($hash->{HELPER}{RDPFDEL}); - if (@rdpfdel) { + if(@rdpfdel) { foreach my $key(@allrds) { # Log3 ($name, 1, "DbRep $name - Reading Schlüssel: $key"); my $dodel = 1; @@ -7101,6 +7209,74 @@ sub byte_output ($) { return $ret; } +#################################################################################################### +# Schreibroutine in DbRep Keyvalue-File +#################################################################################################### +sub DbRep_setCmdFile($$$) { + my ($key,$value,$hash) = @_; + my $fName = $attr{global}{modpath}."/FHEM/FhemUtils/cacheDbRep"; + + my $param = { + FileName => $fName, + ForceType => "file", + }; + my ($err, @old) = FileRead($param); + + DbRep_createCmdFile($hash) if($err); + + my @new; + my $fnd; + foreach my $l (@old) { + if($l =~ m/^$key:/) { + $fnd = 1; + push @new, "$key:$value" if(defined($value)); + } else { + push @new, $l; + } + } + push @new, "$key:$value" if(!$fnd && defined($value)); + +return FileWrite($param, @new); +} + +#################################################################################################### +# anlegen Keyvalue-File für DbRep wenn nicht vorhanden +#################################################################################################### +sub DbRep_createCmdFile ($) { + my ($hash) = @_; + my $fName = $attr{global}{modpath}."/FHEM/FhemUtils/cacheDbRep"; + + my $param = { + FileName => $fName, + ForceType => "file", + }; + my @new; + push(@new, "# This file is auto generated from 93_DbRep.", + "# Please do not modify, move or delete it.", + ""); + +return FileWrite($param, @new); +} + +#################################################################################################### +# Leseroutine aus DbRep Keyvalue-File +#################################################################################################### +sub DbRep_getCmdFile($) { + my ($key) = @_; + my $fName = $attr{global}{modpath}."/FHEM/FhemUtils/cacheDbRep"; + my $param = { + FileName => $fName, + ForceType => "file", + }; + my ($err, @l) = FileRead($param); + return ($err, undef) if($err); + for my $l (@l) { + return (undef, $1) if($l =~ m/^$key:(.*)/); + } + +return (undef, undef); +} + #################################################################################################### # Tabellenoptimierung MySQL #################################################################################################### @@ -7720,7 +7896,8 @@ return;
    • Selection of all datasets within adjustable time limits.
    • Exposure of datasets of a Device/Reading-combination within adjustable time limits.
    • -
    • Selecion of datasets by usage of dynamically calclated time limits at execution time.
    • +
    • Selection of datasets by usage of dynamically calclated time limits at execution time.
    • +
    • Highlighting doublets when select and display datasets (fetchrows)
    • Calculation of quantity of datasets of a Device/Reading-combination within adjustable time limits and several aggregations.
    • The calculation of summary-, difference-, maximum-, minimum- and averageValues of numeric readings within adjustable time limits and several aggregations.
    • write back results of summary-, difference-, maximum-, minimum- and average calculation into the database
    • @@ -7737,7 +7914,7 @@ return;
    • report of existing database processes (MySQL)
    • purge content of current-table
    • fill up the current-table with a (tunable) extract of the history-table
    • -
    • delete consecutive datasets (clearing up consecutive doublets)
    • +
    • delete consecutive datasets with different timestamp but same values (clearing up consecutive doublets)

@@ -7768,6 +7945,7 @@ return; Time::Local
Scalar::Util
DBI
+ Color (FHEM-module)
Blocking (FHEM-module)

Due to performance reason the following index should be created in addition:
@@ -8048,9 +8226,9 @@ return;
    Example:
    - attr <DbRep-device> dumpDirRemote /volume1/ApplicationBackup/dumps_FHEM/
    - attr <DbRep-device> dumpDirLocal /sds1/backup/dumps_FHEM/
    - attr <DbRep-device> dumpFilesKeep 2

    + attr <name> dumpDirRemote /volume1/ApplicationBackup/dumps_FHEM/
    + attr <name> dumpDirLocal /sds1/backup/dumps_FHEM/
    + attr <name> dumpFilesKeep 2

    # The dump will be created remote on the MySQL-Server in directory '/volume1/ApplicationBackup/dumps_FHEM/'.
    @@ -8129,12 +8307,12 @@ return; The naming convention of dump files is: <dbname>_<date>_<time>.sqlitebkp

    - The database can be restored by command "set <DbRep-device> restoreSQLite <filename>"
    + The database can be restored by command "set <name> restoreSQLite <filename>"
    The created dump file can be transfered to a FTP-server. Please see explanations about FTP- transfer in topic "dumpMySQL".


    -
  • exportToFile - exports DB-entries to a file in CSV-format between period given by timestamp. +
  • exportToFile - exports DB-entries to a file in CSV-format of time period set by time attributes. Limitations of selections can be set by attributes Device and/or Reading. The filename will be defined by attribute "expimpfile".
    By setting attribute "aggregation" the export of datasets will be splitted into time slices @@ -8144,12 +8322,64 @@ return; is exported and avoid the "died prematurely" error.

  • -
  • fetchrows [history|current] - provides all table-entries (default: history) - between period given by timestamp-attributes. - A possibly aggregation set will not be considered.
    - The direction of data selection can be determined by attribute - "fetchRoute".
    -

  • +
  • fetchrows [history|current] + - provides all table entries (default: history) + of time period set by time attributes respectively selection conditions + by attributes "device" and "reading". + An aggregation set will not be considered.
    + The direction of data selection can be determined by attribute + "fetchRoute".

    + + Every reading of result is composed of the dataset timestring , an index, the device name + and the reading name. + The function has the capability to reconize multiple occuring datasets (doublets). + Such doublets are marked by an index > 1.
    + Doublets can be highlighted in terms of color by setting attribut e"fetchMarkDuplicates".

    + + Note:
    + Highlighted readings are not displayed again after restart or rereadcfg because of they are not + saved in statefile.

    + + This attribute is preallocated with some colors, but can be changed by colorpicker-widget:

    + +
      + + attr <DbRep-Device> widgetOverride fetchMarkDuplicates:colorpicker + +
    +
    + + The readings of result are composed like the following sceme:

    + +
      + Example:
      + 2017-10-22_03-04-43__1__SMA_Energymeter__Bezug_WirkP_Kosten_Diff
      + # <date>_<time>__<index>__<device>__<reading> +
    +
    + + For a better overview the relevant attributes are listed here in a table:

    + +
      + + + + + + + + +
      fetchRoute : direction of selection read in database
      limit : limits the number of datasets to select and display
      fetchMarkDuplicates : Highlighting of found doublets
      device : select only datasets which are contain <device>
      reading : select only datasets which are contain <reading>
      time.* : A number of attributes to limit selection by time
      +
    +
    +
    + + Note:
    + Although the module is designed non-blocking, a huge number of selection result (huge number of rows) + can overwhelm the browser session respectively FHEMWEB. + Due to the sample space can be limited by attribute "limit". + Of course ths attribute can be increased if your system capabilities allow a higher workload.

    +

  • insert - use it to insert data ito table "history" manually. Input values for Date, Time and Value are mandatory. The database fields for Type and Event will be filled in with "manual" automatically and the values of Device, Reading will be get from set attributes.

    @@ -8278,9 +8508,10 @@ return;
  • sqlCmd - executes an arbitrary user specific command.
    If the command contains a operation to delete data, the attribute "allowDeletion" has to be set for security reason.
    - The statement doesn't consider limitations by attributes device and/or reading.
    - If the attributes "timestamp_begin" respectively "timestamp_end" - should assumed in the statement, you can use the placeholder "§timestamp_begin§" respectively + The statement doesn't consider limitations by attributes "device", "reading", "time.*" + respectively "aggregation".
    + If the attribute "timestamp_begin" respectively "timestamp_end" + is assumed in the statement, it is possible to use placeholder "§timestamp_begin§" respectively "§timestamp_end§" on suitable place.

      @@ -8304,16 +8535,39 @@ return; The result of the statement will be shown in Reading "SqlResult". The formatting of result can be choosen by attribute "sqlResultFormat", as well as the used field separator can be determined by attribute "sqlResultFieldSep".

      - + + The module provides a command history once a sqlCmd command was executed successfully. + To use this option, activate the attribute "sqlCmdHistoryLength" with list lenght you want.

      + + For a better overview the relevant attributes for sqlCmd are listed in a table:

      + +
        + + + + + + +
        allowDeletion : activates capabilty to delete datasets
        sqlResultFormat : determines presentation style of command result
        sqlResultFieldSep : choice of a useful field separator for result
        sqlCmdHistoryLength : activates command history and length
        +
      +
      +
      + Note:
      Even though the module works non-blocking regarding to database operations, a huge sample space (number of rows/readings) could block the browser session respectively FHEMWEB. If you are unsure about the result of the statement, you should preventively add a limit to the statement.

      -
      -
    +
+ +
  • sqlCmdHistory - If history is activated by attribute "sqlCmdHistoryLength", an already + successfully executed sqlCmd-command can be repeated from a drop-down list.
    + By execution of the last list entry, "__purge_historylist__", the list itself can be deleted.
    + If the statement contains "," this character is displayed as "<c>" in the history + list due to technical restrictions.
    +

  • sumValue [display | writeToDB] - calculates the summary of database column "VALUE" between period given by @@ -8502,15 +8756,15 @@ return;
      Examples:
      - attr <Name> device TYPE=DbRep
      + attr <name> device TYPE=DbRep
      # select datasets of active present devices with Type "DbRep"
      - attr <Name> device MySTP_5000
      + attr <name> device MySTP_5000
      # select datasets of device "MySTP_5000"
      - attr <Name> device SMA.*
      + attr <name> device SMA.*
      # select datasets of devices starting with "SMA"
      - attr <Name> device SMA_Energymeter,MySTP_5000
      + attr <name> device SMA_Energymeter,MySTP_5000
      # select datasets of devices "SMA_Energymeter" and "MySTP_5000"
      - attr <Name> device %5000
      + attr <name> device %5000
      # select datasets of devices ending with "5000"


    @@ -8569,8 +8823,8 @@ return;
      Example:

      - attr <DbRep-device> executeAfterProc set og_gz_westfenster off;
      - attr <DbRep-device> executeAfterProc {adump ("<DbRep-device>")}

      + attr <name> executeAfterProc set og_gz_westfenster off;
      + attr <name> executeAfterProc {adump ("<name>")}

      # "adump" is a function defined in 99_myUtils.pm e.g.:
      @@ -8592,8 +8846,8 @@ sub adump {
        Example:

        - attr <DbRep-device> executeBeforeProc set og_gz_westfenster on;
        - attr <DbRep-device> executeBeforeProc {bdump ("<DbRep-device>")}

        + attr <name> executeBeforeProc set og_gz_westfenster on;
        + attr <name> executeBeforeProc {bdump ("<name>")}

        # "bdump" is a function defined in 99_myUtils.pm e.g.:
        @@ -8612,6 +8866,9 @@ sub bdump {
      • expimpfile - Path/filename for data export/import

      • +
      • fetchMarkDuplicates + - Highlighting of multiple occuring datasets in result of "fetchrows" command

      • +
      • fetchRoute [descent | ascent] - specify the direction of data selection of the fetchrows-command.

          descent - the data are read descent (default). If @@ -8675,9 +8932,9 @@ sub bdump {
            Examples:
            - attr <Name> reading etotal
            - attr <Name> reading et%
            - attr <Name> reading etotal,etoday
            + attr <name> reading etotal
            + attr <name> reading et%
            + attr <name> reading etotal,etoday


          @@ -8689,15 +8946,15 @@ sub bdump {
        • readingPreventFromDel - comma separated list of readings which are should prevent from deletion when a new operation starts

        • -
        • seqDoubletsVariance - accepted variance (+/-) for the command "set <Name> delSeqDoublets".
          +
        • seqDoubletsVariance - accepted variance (+/-) for the command "set <name> delSeqDoublets".
          The value of this attribute describes the variance up to it consecutive numeric values (VALUE) of datasets are handled as identical and should be deleted. "seqDoubletsVariance" is an absolut numerical value, which is used as a positive as well as a negative variance.

          • Examples:
            - attr <Name> seqDoubletsVariance 0.0014
            - attr <Name> seqDoubletsVariance 1.45
            + attr <name> seqDoubletsVariance 0.0014
            + attr <name> seqDoubletsVariance 1.45


          @@ -8705,38 +8962,47 @@ sub bdump { for the sql-requests. This is not calculated for a single sql-statement, but the summary of all sql-statements necessara for within an executed DbRep-function in background.
          -
        • showStatus - limits the sample space of command "get ... dbstatus". SQL-Wildcard (%) can be used.

        • +
        • showStatus - limits the sample space of command "get <name> dbstatus". SQL-Wildcard (%) can be used.

          • - Example: attr ... showStatus %uptime%,%qcache%
            + Example:
            + attr <name> showStatus %uptime%,%qcache%
            # Only readings with containing "uptime" and "qcache" in name will be shown

          -
        • showVariables - limits the sample space of command "get ... dbvars". SQL-Wildcard (%) can be used.

        • +
        • showVariables - limits the sample space of command "get <name> dbvars". SQL-Wildcard (%) can be used.

          • - Example: attr ... showVariables %version%,%query_cache%
            + Example:
            + attr <name> showVariables %version%,%query_cache%
            # Only readings with containing "version" and "query_cache" in name will be shown

          -
        • showSvrInfo - limits the sample space of command "get ... svrinfo". SQL-Wildcard (%) can be used.

        • +
        • showSvrInfo - limits the sample space of command "get <name> svrinfo". SQL-Wildcard (%) can be used.

          • - Example: attr ... showSvrInfo %SQL_CATALOG_TERM%,%NAME%
            + Example:
            + attr <name> showSvrInfo %SQL_CATALOG_TERM%,%NAME%
            # Only readings with containing "SQL_CATALOG_TERM" and "NAME" in name will be shown

          -
        • showTableInfo - limits the tablename which is selected by command "get ... tableinfo". SQL-Wildcard +
        • showTableInfo - limits the tablename which is selected by command "get <name> tableinfo". SQL-Wildcard (%) can be used.

          • - Example: attr ... showTableInfo current,history
            + Example:
            + attr <name> showTableInfo current,history
            # Only informations about tables "current" and "history" will be shown

          -
        • sqlResultFieldSep - determines the used field separator (default: "|") in the result of command "set ... sqlCmd".

        • +
        • sqlCmdHistoryLength + - activates the command history of "sqlCmd" and determines the length of it

        • -
        • sqlResultFormat - determines the formatting of the "set ... sqlCmd" command result. possible options are:

          + +
        • sqlResultFieldSep - determines the used field separator (default: "|") in the result of command "set <name> sqlCmd".

        • + +
        • sqlResultFormat - determines the formatting of the "set <name> sqlCmd" command result. + Possible options are:

            separated - every line of the result will be generated sequentially in a single reading. (default)

            @@ -8790,7 +9056,7 @@ sub bdump {
              Example:

              - attr <DbRep-device> timeYearPeriod 06-25 06-24

              + attr <name> timeYearPeriod 06-25 06-24

              # evaluates the database within the time limits 25. june AAAA and 24. june BBBB.
              # The year AAAA respectively year BBBB is calculated dynamically depending of the current date.
              @@ -8831,8 +9097,8 @@ sub bdump {
                Example:

                - attr <DbRep-device> timestamp_begin current_year_begin
                - attr <DbRep-device> timestamp_end current_year_end

                + attr <name> timestamp_begin current_year_begin
                + attr <name> timestamp_end current_year_end

                # Analyzes the database between the time limits of the current year.
              @@ -8850,13 +9116,13 @@ sub bdump {
                Examples for input format:
                - attr <Name> timeDiffToNow 86400
                + attr <name> timeDiffToNow 86400
                # the start time is set to "current time - 86400 seconds"
                - attr <Name> timeDiffToNow d:2 h:3 m:2 s:10
                + attr <name> timeDiffToNow d:2 h:3 m:2 s:10
                # the start time is set to "current time - 2 days 3 hours 2 minutes 10 seconds"
                - attr <Name> timeDiffToNow m:600
                + attr <name> timeDiffToNow m:600
                # the start time is set to "current time - 600 minutes" gesetzt
                - attr <Name> timeDiffToNow h:2.5
                + attr <name> timeDiffToNow h:2.5
                # the start time is set to "current time - 2,5 hours"


              @@ -9027,9 +9293,10 @@ sub bdump { Aktuell werden folgende Operationen unterstützt:

                  -
                • Selektion aller Datensätze innerhalb einstellbarer Zeitgrenzen.
                • +
                • Selektion aller Datensätze innerhalb einstellbarer Zeitgrenzen
                • Darstellung der Datensätze einer Device/Reading-Kombination innerhalb einstellbarer Zeitgrenzen.
                • Selektion der Datensätze unter Verwendung von dynamisch berechneter Zeitgrenzen zum Ausführungszeitpunkt.
                • +
                • Dubletten-Hervorhebung bei Datensatzanzeige (fetchrows)
                • Berechnung der Anzahl von Datensätzen einer Device/Reading-Kombination unter Berücksichtigung von Zeitgrenzen und verschiedenen Aggregationen.
                • Die Berechnung von Summen-, Differenz-, Maximum-, Minimum- und Durchschnittswerten numerischer Readings @@ -9050,7 +9317,7 @@ sub bdump {
                • Ausgabe der existierenden Datenbankprozesse (MySQL)
                • leeren der current-Tabelle
                • Auffüllen der current-Tabelle mit einem (einstellbaren) Extrakt der history-Tabelle
                • -
                • Bereinigung sequentiell aufeinander folgender Datensätze (sequentielle Dublettenbereinigung)
                • +
                • Bereinigung sequentiell aufeinander folgender Datensätze mit unterschiedlichen Zeitstempel aber gleichen Werten (sequentielle Dublettenbereinigung)

              @@ -9080,6 +9347,7 @@ sub bdump { Time::Local
              Scalar::Util
              DBI
              + Color (FHEM-Modul)
              Blocking (FHEM-Modul)

              Aus Performancegründen sollten zusätzlich folgender Index erstellt werden:
              @@ -9361,9 +9629,9 @@ sub bdump {
                Beispiel:
                - attr <DbRep-device> dumpDirRemote /volume1/ApplicationBackup/dumps_FHEM/
                - attr <DbRep-device> dumpDirLocal /sds1/backup/dumps_FHEM/
                - attr <DbRep-device> dumpFilesKeep 2

                + attr <name> dumpDirRemote /volume1/ApplicationBackup/dumps_FHEM/
                + attr <name> dumpDirLocal /sds1/backup/dumps_FHEM/
                + attr <name> dumpFilesKeep 2

                # Der Dump wird remote auf dem MySQL-Server im Verzeichnis '/volume1/ApplicationBackup/dumps_FHEM/' erstellt.
                @@ -9441,7 +9709,7 @@ sub bdump { Die Namenskonvention der Dumpfiles ist: <dbname>_<date>_<time>.sqlitebkp

                - Die Datenbank kann mit "set <DbRep-device> restoreSQLite <Filename>" wiederhergestellt + Die Datenbank kann mit "set <name> restoreSQLite <Filename>" wiederhergestellt werden.
                Das erstellte Dumpfile kann auf einen FTP-Server übertragen werden. Siehe dazu die Erläuterungen unter "dumpMySQL".

                @@ -9458,20 +9726,67 @@ sub bdump {
              • fetchrows [history|current] - liefert alle Tabelleneinträge (default: history) - in den gegebenen Zeitgrenzen (siehe Attribute). - Eine evtl. gesetzte Aggregation wird nicht berücksichtigt.
                + in den gegebenen Zeitgrenzen bzw. Selektionsbedingungen durch die Attribute + "device" und "reading". + Eine evtl. gesetzte Aggregation wird dabei nicht berücksichtigt.
                Die Leserichtung in der Datenbank kann durch das Attribut "fetchRoute" bestimmt werden.

                + + Jedes Ergebnisreading setzt sich aus dem Timestring des Datensatzes, einem Index, dem Device + und dem Reading zusammen. + Die Funktion fetchrows ist in der Lage mehrfach vorkommende Datensätze (Dubletten) zu erkennen. + Solche Dubletten sind mit einem Index > 1 gekennzeichnet.
                + Dubletten können mit dem Attribut "fetchMarkDuplicates" farblich hervorgehoben werden.

                + + Hinweis:
                + Hervorgehobene Readings werden nach einem Restart bzw. nach rereadcfg nicht mehr angezeigt da + sie nicht im statefile gesichert werden (Verletzung erlaubter Readingnamen durch Formatierung). +

                + + Dieses Attribut ist mit einigen Farben vorbelegt, kann aber mit dem colorpicker-Widget + überschrieben werden:

                + +
                  + + attr <name> widgetOverride fetchMarkDuplicates:colorpicker + +
                +
                + + Die Ergebnisreadings von fetchrows sind nach folgendem Schema aufgebaut:

                + +
                  + Beispiel:
                  + 2017-10-22_03-04-43__1__SMA_Energymeter__Bezug_WirkP_Kosten_Diff
                  + # <Datum>_<Zeit>__<Index>__<Device>__<Reading> +
                +
                + + Zur besseren Übersicht sind die zur Steuerung von fetchrows relevanten Attribute hier noch einmal + dargestellt:

                + +
                  + + + + + + + + +
                  fetchRoute : Leserichtung des Selekts innerhalb der Datenbank
                  limit : begrenzt die Anzahl zu selektierenden bzw. anzuzeigenden Datensätze
                  fetchMarkDuplicates : Hervorhebung von gefundenen Dubletten
                  device : Selektion nur von Datensätzen die <device> enthalten
                  reading : Selektion nur von Datensätzen die <reading> enthalten
                  time.* : eine Reihe von Attributen zur Zeitabgrenzung
                  +
                +
                +
                Hinweis:
                Auch wenn das Modul bezüglich der Datenbankabfrage nichtblockierend arbeitet, kann eine zu große Ergebnismenge (Anzahl Zeilen bzw. Readings) die Browsersesssion bzw. FHEMWEB blockieren. Aus diesem Grund wird die Ergebnismenge mit dem Attribut "limit" begrenzt. Bei Bedarf kann dieses Attribut - geändert werden falls eine Anpassung der Selektionsbedingungen nicht möglich oder + geändert werden, falls eine Anpassung der Selektionsbedingungen nicht möglich oder gewünscht ist.

                -

              • - +
              • insert - Manuelles Einfügen eines Datensatzes in die Tabelle "history". Obligatorisch sind Eingabewerte für Datum, Zeit und Value. Die Werte für die DB-Felder Type bzw. Event werden mit "manual" gefüllt, sowie die Werte für Device, Reading aus den gesetzten Attributen genommen.

                @@ -9615,7 +9930,7 @@ sub bdump { Enthält dieses Kommando eine Delete-Operation, muss zur Sicherheit das Attribut "allowDeletion" gesetzt sein.
                Bei der Ausführung dieses Kommandos werden keine Einschränkungen durch gesetzte Attribute - device und/oder reading berücksichtigt.
                + "device", "reading", "time.*" bzw. "aggregation" berücksichtigt.
                Sollen die im Modul gesetzten Attribute "timestamp_begin" bzw. "timestamp_end" im Statement berücksichtigt werden, können die Platzhalter "§timestamp_begin§" bzw. "§timestamp_end§" dafür verwendet werden.

                @@ -9641,39 +9956,66 @@ sub bdump { Das Ergebnis des Statements wird im Reading "SqlResult" dargestellt. Die Ergebnis-Formatierung kann durch das Attribut "sqlResultFormat" ausgewählt, sowie der verwendete Feldtrenner durch das Attribut "sqlResultFieldSep" festgelegt werden.

                - + + Das Modul stellt optional eine Kommando-Historie zur Verfügung sobald ein SQL-Kommando erfolgreich + ausgeführt wurde. + Um diese Option zu nutzen, ist das Attribut "sqlCmdHistoryLength" mit der gewünschten Listenlänge + zu aktivieren.

                + + Zur besseren Übersicht sind die zur Steuerung von sqlCmd relevanten Attribute hier noch einmal + dargestellt:

                + +
                  + + + + + + +
                  allowDeletion : aktiviert Löschmöglichkeit
                  sqlResultFormat : legt die Darstellung des Kommandoergebnis fest
                  sqlResultFieldSep : Auswahl Feldtrenner im Ergebnis
                  sqlCmdHistoryLength : Aktivierung Kommando-Historie und deren Umfang
                  +
                +
                +
                + Hinweis:
                Auch wenn das Modul bezüglich der Datenbankabfrage nichtblockierend arbeitet, kann eine zu große Ergebnismenge (Anzahl Zeilen bzw. Readings) die Browsersesssion bzw. FHEMWEB blockieren. Wenn man sich unsicher ist, sollte man vorsorglich dem Statement ein Limit hinzufügen.


              • -
              + +
            • sqlCmdHistory - Wenn mit dem Attribut "sqlCmdHistoryLength" aktiviert, kann + aus einer Liste ein bereits erfolgreich ausgeführtes sqlCmd-Kommando wiederholt werden.
              + Mit Ausführung des letzten Eintrags der Liste, "__purge_historylist__", kann die Liste gelöscht + werden.
              + Falls das Statement "," enthält, wird dieses Zeichen aus technischen Gründen in der + History-Liste als "<c>" dargestellt.
              +

            • sumValue [display | writeToDB] - - berechnet die Summenwerte des Datenbankfelds "VALUE" in den Zeitgrenzen - (Attribute) "timestamp_begin", "timestamp_end" bzw. "timeDiffToNow / timeOlderThan". - Es muss das auszuwertende Reading im Attribut "reading" - angegeben sein. Diese Funktion ist sinnvoll wenn fortlaufend Wertedifferenzen eines - Readings in die Datenbank geschrieben werden.
              + - Berechnet die Summenwerte des Datenbankfelds "VALUE" in den Zeitgrenzen + (Attribute) "timestamp_begin", "timestamp_end" bzw. "timeDiffToNow / timeOlderThan". + Es muss das auszuwertende Reading im Attribut "reading" + angegeben sein. Diese Funktion ist sinnvoll wenn fortlaufend Wertedifferenzen eines + Readings in die Datenbank geschrieben werden.
              - Ist keine oder die Option "display" angegeben, werden die Ergebnisse nur angezeigt. Mit - der Option "writeToDB" werden die Berechnungsergebnisse mit einem neuen Readingnamen - in der Datenbank gespeichert.
              - Der neue Readingname wird aus einem Präfix und dem originalen Readingnamen gebildet. - Der Präfix setzt sich aus der Bildungsfunktion und der Aggregation zusammen.
              - Der Timestamp der neuen Readings in der Datenbank wird von der eingestellten Aggregationsperiode - abgeleitet, sofern kein eindeutiger Zeitpunkt des Ergebnisses bestimmt werden kann. - Das Feld "EVENT" wird mit "calculated" gefüllt.

              + Ist keine oder die Option "display" angegeben, werden die Ergebnisse nur angezeigt. Mit + der Option "writeToDB" werden die Berechnungsergebnisse mit einem neuen Readingnamen + in der Datenbank gespeichert.
              + Der neue Readingname wird aus einem Präfix und dem originalen Readingnamen gebildet. + Der Präfix setzt sich aus der Bildungsfunktion und der Aggregation zusammen.
              + Der Timestamp der neuen Readings in der Datenbank wird von der eingestellten Aggregationsperiode + abgeleitet, sofern kein eindeutiger Zeitpunkt des Ergebnisses bestimmt werden kann. + Das Feld "EVENT" wird mit "calculated" gefüllt.

              -
                - Beispiel neuer Readingname gebildet aus dem Originalreading "totalpac":
                - sum_day_totalpac
                - # <Bildungsfunktion>_<Aggregation>_<Originalreading>
                -
                -
              -

            • +
                + Beispiel neuer Readingname gebildet aus dem Originalreading "totalpac":
                + sum_day_totalpac
                + # <Bildungsfunktion>_<Aggregation>_<Originalreading>
                +
                +
              +
            • tableCurrentFillup - Die current-Tabelle wird mit einem Extrakt der history-Tabelle aufgefüllt. Die Attribute zur Zeiteinschränkung bzw. device, reading werden ausgewertet. @@ -9839,11 +10181,11 @@ sub bdump {
                Beispiele:
                - attr <Name> device TYPE=DbRep
                - attr <Name> device MySTP_5000
                - attr <Name> device SMA.*,MySTP.*
                - attr <Name> device SMA_Energymeter,MySTP_5000
                - attr <Name> device %5000
                + attr <name> device TYPE=DbRep
                + attr <name> device MySTP_5000
                + attr <name> device SMA.*,MySTP.*
                + attr <name> device SMA_Energymeter,MySTP_5000
                + attr <name> device %5000


              @@ -9897,8 +10239,8 @@ sub bdump {
                Beispiel:

                - attr <DbRep-device> executeAfterProc set og_gz_westfenster off;
                - attr <DbRep-device> executeAfterProc {adump ("<DbRep-device>")}

                + attr <name> executeAfterProc set og_gz_westfenster off;
                + attr <name> executeAfterProc {adump ("<name>")}

                # "adump" ist eine in 99_myUtils definierte Funktion.
                @@ -9920,8 +10262,8 @@ sub adump {
                  Beispiel:

                  - attr <DbRep-device> executeBeforeProc set og_gz_westfenster on;
                  - attr <DbRep-device> executeBeforeProc {bdump ("<DbRep-device>")}

                  + attr <name> executeBeforeProc set og_gz_westfenster on;
                  + attr <name> executeBeforeProc {bdump ("<name>")}

                  # "bdump" ist eine in 99_myUtils definierte Funktion.
                  @@ -9940,6 +10282,9 @@ sub bdump {
                • expimpfile - Pfad/Dateiname für Export/Import in/aus einem File.

                • +
                • fetchMarkDuplicates + - Markierung von mehrfach vorkommenden Datensätzen im Ergebnis des "fetchrows" Kommandos

                • +
                • fetchRoute [descent | ascent] - bestimmt die Leserichtung des fetchrows-Befehl.

                    descent - die Datensätze werden absteigend gelesen (default). Wird @@ -10004,9 +10349,9 @@ sub bdump {
                      Beispiele:
                      - attr <Name> reading etotal
                      - attr <Name> reading et%
                      - attr <Name> reading etotal,etoday
                      + attr <name> reading etotal
                      + attr <name> reading et%
                      + attr <name> reading etotal,etoday


                    @@ -10018,15 +10363,15 @@ sub bdump {
                  • role - die Rolle des DbRep-Device. Standard ist "Client". Die Rolle "Agent" ist im Abschnitt DbRep-Agent beschrieben.

                  • -
                  • seqDoubletsVariance - akzeptierte Abweichung (+/-) für das Kommando "set <Name> delSeqDoublets".
                    +
                  • seqDoubletsVariance - akzeptierte Abweichung (+/-) für das Kommando "set <name> delSeqDoublets".
                    Der Wert des Attributs beschreibt die Abweichung bis zu der aufeinanderfolgende numerische Werte (VALUE) von Datensätze als gleich angesehen und gelöscht werden sollen. "seqDoubletsVariance" ist ein absoluter Zahlenwert, der sowohl als positive als auch negative Abweichung verwendet wird.

                    • Beispiele:
                      - attr <Name> seqDoubletsVariance 0.0014
                      - attr <Name> seqDoubletsVariance 1.45
                      + attr <name> seqDoubletsVariance 0.0014
                      + attr <name> seqDoubletsVariance 1.45


                    @@ -10035,37 +10380,44 @@ sub bdump { SQl-Statement, sondern die Summe aller notwendigen SQL-Abfragen innerhalb der jeweiligen Funktion betrachtet.
                    -
                  • showStatus - grenzt die Ergebnismenge des Befehls "get ... dbstatus" ein. Es können SQL-Wildcard (%) verwendet werden.

                  • +
                  • showStatus - grenzt die Ergebnismenge des Befehls "get <name> dbstatus" ein. Es können SQL-Wildcard (%) verwendet werden.

                    • - Bespiel: attr ... showStatus %uptime%,%qcache%
                      + Bespiel:
                      + attr <name> showStatus %uptime%,%qcache%
                      # Es werden nur Readings erzeugt die im Namen "uptime" und "qcache" enthalten

                    -
                  • showVariables - grenzt die Ergebnismenge des Befehls "get ... dbvars" ein. Es können SQL-Wildcard (%) verwendet werden.

                  • +
                  • showVariables - grenzt die Ergebnismenge des Befehls "get <name> dbvars" ein. Es können SQL-Wildcard (%) verwendet werden.

                    • - Bespiel: attr ... showVariables %version%,%query_cache%
                      + Bespiel:
                      + attr <name> showVariables %version%,%query_cache%
                      # Es werden nur Readings erzeugt die im Namen "version" und "query_cache" enthalten

                    -
                  • showSvrInfo - grenzt die Ergebnismenge des Befehls "get ... svrinfo" ein. Es können SQL-Wildcard (%) verwendet werden.

                  • +
                  • showSvrInfo - grenzt die Ergebnismenge des Befehls "get <name> svrinfo" ein. Es können SQL-Wildcard (%) verwendet werden.

                    • - Bespiel: attr ... showSvrInfo %SQL_CATALOG_TERM%,%NAME%
                      + Bespiel:
                      + attr <name> showSvrInfo %SQL_CATALOG_TERM%,%NAME%
                      # Es werden nur Readings erzeugt die im Namen "SQL_CATALOG_TERM" und "NAME" enthalten

                    -
                  • showTableInfo - grenzt die Ergebnismenge des Befehls "get ... tableinfo" ein. Es können SQL-Wildcard (%) verwendet werden.

                  • +
                  • showTableInfo - grenzt die Ergebnismenge des Befehls "get <name> tableinfo" ein. Es können SQL-Wildcard (%) verwendet werden.

                    • - Bespiel: attr ... showTableInfo current,history
                      + Bespiel:
                      + attr <name> showTableInfo current,history
                      # Es werden nur Information der Tabellen "current" und "history" angezeigt

                  • sqlResultFieldSep - legt den verwendeten Feldseparator (default: "|") im Ergebnis des Kommandos "set ... sqlCmd" fest.

                  • + +
                  • sqlCmdHistoryLength + - aktiviert die Kommandohistorie von "sqlCmd" und legt deren Länge fest

                  • -
                  • sqlResultFormat - legt die Formatierung des Ergebnisses des Kommandos "set ... sqlCmd" fest. +
                  • sqlResultFormat - legt die Formatierung des Ergebnisses des Kommandos "set <name> sqlCmd" fest. Mögliche Optionen sind:

                      @@ -10118,7 +10470,7 @@ sub bdump {
                        Beispiel:

                        - attr <DbRep-device> timeYearPeriod 06-25 06-24

                        + attr <name> timeYearPeriod 06-25 06-24

                        # wertet die Datenbank in den Zeitgrenzen 25. Juni AAAA bis 24. Juni BBBB aus.
                        # Das Jahr AAAA bzw. BBBB wird in Abhängigkeit des aktuellen Datums errechnet.
                        @@ -10162,8 +10514,8 @@ sub bdump {
                          Beispiel:

                          - attr <DbRep-device> timestamp_begin current_year_begin
                          - attr <DbRep-device> timestamp_end current_year_end

                          + attr <name> timestamp_begin current_year_begin
                          + attr <name> timestamp_end current_year_end

                          # Wertet die Datenbank in den Zeitgrenzen des aktuellen Jahres aus.
                        @@ -10182,13 +10534,13 @@ sub bdump {
                          Eingabeformat Beispiel:
                          - attr <Name> timeDiffToNow 86400
                          + attr <name> timeDiffToNow 86400
                          # die Startzeit wird auf "aktuelle Zeit - 86400 Sekunden" gesetzt
                          - attr <Name> timeDiffToNow d:2 h:3 m:2 s:10
                          + attr <name> timeDiffToNow d:2 h:3 m:2 s:10
                          # die Startzeit wird auf "aktuelle Zeit - 2 Tage 3 Stunden 2 Minuten 10 Sekunden" gesetzt
                          - attr <Name> timeDiffToNow m:600
                          + attr <name> timeDiffToNow m:600
                          # die Startzeit wird auf "aktuelle Zeit - 600 Minuten" gesetzt
                          - attr <Name> timeDiffToNow h:2.5
                          + attr <name> timeDiffToNow h:2.5
                          # die Startzeit wird auf "aktuelle Zeit - 2,5 Stunden" gesetzt