diff --git a/fhem/CHANGED b/fhem/CHANGED index d3f035612..cafefed66 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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. + - change: 93_DbRep: commandRef revised - new Version: 98_Siro.pm: V1.0 (Forum: https://forum.fhem.de/index.php/topic,100605.0.html) !!! NOTE !!! Configuration must be adjusted . diff --git a/fhem/FHEM/93_DbRep.pm b/fhem/FHEM/93_DbRep.pm index a66d26255..8bffddbf1 100644 --- a/fhem/FHEM/93_DbRep.pm +++ b/fhem/FHEM/93_DbRep.pm @@ -58,6 +58,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch'; # Version History intern our %DbRep_vNotesIntern = ( + "8.21.1" => "31.05.2019 syncStandby considers executeBeforeProc, commandRef revised ", "8.21.0" => "28.04.2019 implement FHEM command \"dbReadingsVal\" ", "8.20.1" => "28.04.2019 set index verbose changed, check index \"Report_Idx\" in getInitData ", "8.20.0" => "27.04.2019 don't save hash refs in central hash to prevent potential memory leak, new set \"index\" ". @@ -152,6 +153,7 @@ our %DbRep_vNotesIntern = ( # Version History extern: our %DbRep_vNotesExtern = ( + "8.21.0" => "28.04.2019 FHEM command \"dbReadingsVal\" implemented.", "8.20.0" => "27.04.2019 With the new set \"index\" command it is now possible to list and (re)create the indexes which are ". "needed for DbLog and/or DbRep operation.", "8.19.0" => "04.04.2019 The \"explain\" SQL-command is possible in sqlCmd ", @@ -884,7 +886,8 @@ sub DbRep_Set($@) { if(!exists($defs{$prop}) || $defs{$prop}->{TYPE} ne "DbLog") { return "The device \"$prop\" doesn't exist or is not a DbLog-device. "; } - $hash->{LASTCMD} = $prop?"$opt $prop":"$opt"; + $hash->{LASTCMD} = $prop?"$opt $prop":"$opt"; + DbRep_beforeproc($hash, "syncStandby"); DbRep_Main($hash,$opt,$prop); } else { @@ -8215,6 +8218,10 @@ sub DbRep_syncStandbyDone($) { my $bt = $a[2]; my ($rt,$brt) = split(",", $bt); my $err = $a[3]?decode_base64($a[3]):undef; + my $erread; + + # Befehl nach Procedure ausführen + $erread = DbRep_afterproc($hash, "syncStandby"); if ($err) { ReadingsSingleUpdateValue ($hash, "errortext", $err, 1); @@ -8224,16 +8231,14 @@ sub DbRep_syncStandbyDone($) { return; } - # only for this block because of warnings if details of readings are not set no warnings 'uninitialized'; + my $state = $erread?$erread:"done"; + readingsBeginUpdate($hash); ReadingsBulkUpdateValue ($hash, "number_lines_inserted_Standby", $irows); - ReadingsBulkUpdateTimeState($hash,$brt,$rt,"done"); + ReadingsBulkUpdateTimeState($hash,$brt,$rt,$state); readingsEndUpdate($hash, 1); - - # Befehl nach Procedure ausführen - my $erread = DbRep_afterproc($hash, "syncStandby"); delete($hash->{HELPER}{RUNNING_PID}); @@ -10987,8 +10992,8 @@ return; averageCalcForm : choose the calculation variant for average determination device : include or exclude <device> from selection - executeBeforeProc : execution of FHEM command (or perl-routine) before operation - executeAfterProc : execution of FHEM command (or perl-routine) after operation + executeBeforeProc : execution of FHEM command (or Perl-routine) before operation + executeAfterProc : execution of FHEM command (or Perl-routine) after operation reading : include or exclude <reading> from selection time.* : a number of attributes to limit selection by time valueFilter : an additional REGEXP to control the record selection. The REGEXP is applied to the database field 'VALUE'. @@ -11051,8 +11056,8 @@ return; device : include or exclude <device> from selection reading : include or exclude <reading> from selection time.* : a number of attributes to limit selection by time - executeBeforeProc : execute a FHEM command (or perl-routine) before start of changeValue - executeAfterProc : execute a FHEM command (or perl-routine) after changeValue is finished + executeBeforeProc : execute a FHEM command (or Perl-routine) before start of changeValue + executeAfterProc : execute a FHEM command (or Perl-routine) after changeValue is finished valueFilter : an additional REGEXP to control the record selection. The REGEXP is applied to the database field 'VALUE'. @@ -11141,8 +11146,8 @@ return; limit : limits ONLY the count of datasets to display device : include or exclude <device> from selection reading : include or exclude <reading> from selection - executeBeforeProc : execute a FHEM command (or perl-routine) before start of the function - executeAfterProc : execute a FHEM command (or perl-routine) after the function is finished + executeBeforeProc : execute a FHEM command (or Perl-routine) before start of the function + executeAfterProc : execute a FHEM command (or Perl-routine) after the function is finished time.* : a number of attributes to limit selection by time valueFilter : an additional REGEXP to control the record selection. The REGEXP is applied to the database field 'VALUE'. @@ -11175,8 +11180,8 @@ return; device : include or exclude <device> from selection reading : include or exclude <reading> from selection time.* : a number of attributes to limit selection by time - executeBeforeProc : execute a FHEM command (or perl-routine) before start of delEntries - executeAfterProc : execute a FHEM command (or perl-routine) after delEntries is finished + executeBeforeProc : execute a FHEM command (or Perl-routine) before start of delEntries + executeAfterProc : execute a FHEM command (or Perl-routine) after delEntries is finished
@@ -11262,8 +11267,8 @@ return; limit : limits ONLY the count of datasets to display device : include or exclude <device> from selection reading : include or exclude <reading> from selection - executeBeforeProc : execute a FHEM command (or perl-routine) before start of the function - executeAfterProc : execute a FHEM command (or perl-routine) after the function is finished + executeBeforeProc : execute a FHEM command (or Perl-routine) before start of the function + executeAfterProc : execute a FHEM command (or Perl-routine) after the function is finished seqDoubletsVariance : Up to this value consecutive numerical datasets are handled as identical and should be deleted time.* : a number of attributes to limit selection by time valueFilter : an additional REGEXP to control the record selection. The REGEXP is applied to the database field 'VALUE'. @@ -11342,8 +11347,8 @@ return; aggregation : choose the aggregation period diffAccept : the maximum accepted difference between sequential records device : include or exclude <device> from selection - executeBeforeProc : execution of FHEM command (or perl-routine) before operation - executeAfterProc : execution of FHEM command (or perl-routine) after operation + executeBeforeProc : execution of FHEM command (or Perl-routine) before operation + executeAfterProc : execution of FHEM command (or Perl-routine) after operation reading : include or exclude <reading> from selection readingNameMap : rename the resulted reading name time.* : a number of attributes to limit selection by time @@ -11393,8 +11398,8 @@ return; dumpMemlimit : limits memory usage dumpSpeed : limits CPU utilization dumpFilesKeep : number of dump files to keep - executeBeforeProc : execution of FHEM command (or perl-routine) before dump - executeAfterProc : execution of FHEM command (or perl-routine) after dump + executeBeforeProc : execution of FHEM command (or Perl-routine) before dump + executeAfterProc : execution of FHEM command (or Perl-routine) after dump optimizeTablesBeforeDump : table optimization before dump @@ -11448,8 +11453,8 @@ return; dumpCompress : compress of dump files after creation dumpDirLocal : the local mounted directory dumpDirRemote dumpFilesKeep : number of dump files to keep - executeBeforeProc : execution of FHEM command (or perl-routine) before dump - executeAfterProc : execution of FHEM command (or perl-routine) after dump + executeBeforeProc : execution of FHEM command (or Perl-routine) before dump + executeAfterProc : execution of FHEM command (or Perl-routine) after dump optimizeTablesBeforeDump : table optimization before dump @@ -11547,8 +11552,8 @@ return; dumpCompress : compress of dump files after creation dumpDirLocal : the local mounted directory dumpDirRemote dumpFilesKeep : number of dump files to keep - executeBeforeProc : execution of FHEM command (or perl-routine) before dump - executeAfterProc : execution of FHEM command (or perl-routine) after dump + executeBeforeProc : execution of FHEM command (or Perl-routine) before dump + executeAfterProc : execution of FHEM command (or Perl-routine) after dump optimizeTablesBeforeDump : table optimization before dump @@ -11597,8 +11602,8 @@ return; aggregation : determination of selection time slices device : include or exclude <device> from selection reading : include or exclude <reading> from selection time.* : a number of attributes to limit selection by time - executeBeforeProc : execution of FHEM command (or perl-routine) before export - executeAfterProc : execution of FHEM command (or perl-routine) after export + executeBeforeProc : execution of FHEM command (or Perl-routine) before export + executeAfterProc : execution of FHEM command (or Perl-routine) after export expimpfile : the name of exportfile time.* : a number of attributes to limit selection by time valueFilter : an additional REGEXP to control the record selection. The REGEXP is applied to the database field 'VALUE'. @@ -11730,8 +11735,8 @@ return; @@ -11771,8 +11776,8 @@ return; aggregation : choose the aggregation period device : include or exclude <device> from selection - executeBeforeProc : execution of FHEM command (or perl-routine) before operation - executeAfterProc : execution of FHEM command (or perl-routine) after operation + executeBeforeProc : execution of FHEM command (or Perl-routine) before operation + executeAfterProc : execution of FHEM command (or Perl-routine) after operation reading : include or exclude <reading> from selection readingNameMap : rename the resulted readings time.* : a number of attributes to limit selection by time @@ -11813,8 +11818,8 @@ return; aggregation : choose the aggregation period device : include or exclude <device> from selection - executeBeforeProc : execution of FHEM command (or perl-routine) before operation - executeAfterProc : execution of FHEM command (or perl-routine) after operation + executeBeforeProc : execution of FHEM command (or Perl-routine) before operation + executeAfterProc : execution of FHEM command (or Perl-routine) after operation reading : include or exclude <reading> from selection readingNameMap : rename the resulted readings time.* : a number of attributes to limit selection by time @@ -11882,8 +11887,8 @@ return; @@ -13685,8 +13692,8 @@ sub bdump { readingNameMap : die entstehenden Ergebnisreadings werden partiell umbenannt seqDoubletsVariance : bis zu diesem Wert werden aufeinander folgende numerische Datensätze als identisch angesehen und werden gelöscht time.* : eine Reihe von Attributen zur Zeitabgrenzung - executeBeforeProc : ausführen FHEM Kommando (oder perl-Routine) vor Start des Befehls - executeAfterProc : ausführen FHEM Kommando (oder perl-Routine) nach Ende des Befehls + executeBeforeProc : ausführen FHEM Kommando (oder Perl-Routine) vor Start des Befehls + executeAfterProc : ausführen FHEM Kommando (oder Perl-Routine) nach Ende des Befehls valueFilter : ein zusätzliches REGEXP um die Datenselektion zu steuern. Der REGEXP wird auf das Datenbankfeld 'VALUE' angewendet. @@ -13761,8 +13768,8 @@ sub bdump { aggregation : Auswahl einer Aggregationsperiode device : einschließen oder ausschließen von Datensätzen die <device> enthalten - executeBeforeProc : ausführen FHEM Kommando (oder perl-Routine) vor Start Operation - executeAfterProc : ausführen FHEM Kommando (oder perl-Routine) nach Ende Operation + executeBeforeProc : ausführen FHEM Kommando (oder Perl-Routine) vor Start Operation + executeAfterProc : ausführen FHEM Kommando (oder Perl-Routine) nach Ende Operation reading : einschließen oder ausschließen von Datensätzen die <reading> enthalten readingNameMap : die entstehenden Ergebnisreadings werden partiell umbenannt time.* : eine Reihe von Attributen zur Zeitabgrenzung @@ -13810,8 +13817,8 @@ sub bdump { dumpMemlimit : Begrenzung der Speicherverwendung dumpSpeed : Begrenzung die CPU-Belastung dumpFilesKeep : Anzahl der aufzubwahrenden Dumpfiles - executeBeforeProc : ausführen FHEM Kommando (oder perl-Routine) vor dem Dump - executeAfterProc : ausführen FHEM Kommando (oder perl-Routine) nach dem Dump + executeBeforeProc : ausführen FHEM Kommando (oder Perl-Routine) vor dem Dump + executeAfterProc : ausführen FHEM Kommando (oder Perl-Routine) nach dem Dump optimizeTablesBeforeDump : Tabelloptimierung vor dem Dump ausführen @@ -13865,8 +13872,8 @@ sub bdump { dumpCompress : Komprimierung des Dumpfiles nach der Erstellung dumpDirLocal : Directory des lokal gemounteten dumpDirRemote-Verzeichnisses dumpFilesKeep : Anzahl der aufzubwahrenden Dumpfiles - executeBeforeProc : ausführen FHEM Kommando (oder perl-Routine) vor dem Dump - executeAfterProc : ausführen FHEM Kommando (oder perl-Routine) nach dem Dump + executeBeforeProc : ausführen FHEM Kommando (oder Perl-Routine) vor dem Dump + executeAfterProc : ausführen FHEM Kommando (oder Perl-Routine) nach dem Dump optimizeTablesBeforeDump : Tabelloptimierung vor dem Dump ausführen @@ -13963,8 +13970,8 @@ sub bdump { dumpCompress : Komprimierung des Dumpfiles nach der Erstellung dumpDirLocal : Directory des lokal gemounteten dumpDirRemote-Verzeichnisses dumpFilesKeep : Anzahl der aufzubwahrenden Dumpfiles - executeBeforeProc : ausführen FHEM Kommando (oder perl-Routine) vor dem Dump - executeAfterProc : ausführen FHEM Kommando (oder perl-Routine) nach dem Dump + executeBeforeProc : ausführen FHEM Kommando (oder Perl-Routine) vor dem Dump + executeAfterProc : ausführen FHEM Kommando (oder Perl-Routine) nach dem Dump optimizeTablesBeforeDump : Tabelloptimierung vor dem Dump ausführen @@ -14012,8 +14019,8 @@ sub bdump { aggregation : Festlegung der Selektionspaketierung device : einschließen oder ausschließen von Datensätzen die <device> enthalten reading : einschließen oder ausschließen von Datensätzen die <reading> enthalten - executeBeforeProc : FHEM Kommando (oder perl-Routine) vor dem Export ausführen - executeAfterProc : FHEM Kommando (oder perl-Routine) nach dem Export ausführen + executeBeforeProc : FHEM Kommando (oder Perl-Routine) vor dem Export ausführen + executeAfterProc : FHEM Kommando (oder Perl-Routine) nach dem Export ausführen expimpfile : der Name des Exportfiles time.* : eine Reihe von Attributen zur Zeitabgrenzung valueFilter : ein zusätzliches REGEXP um die Datenselektion zu steuern. Der REGEXP wird auf das Datenbankfeld 'VALUE' angewendet. @@ -14151,8 +14158,8 @@ sub bdump { @@ -14194,8 +14201,8 @@ sub bdump { aggregation : Auswahl einer Aggregationsperiode device : einschließen oder ausschließen von Datensätzen die <device> enthalten - executeBeforeProc : ausführen FHEM Kommando (oder perl-Routine) vor Start Operation - executeAfterProc : ausführen FHEM Kommando (oder perl-Routine) nach Ende Operation + executeBeforeProc : ausführen FHEM Kommando (oder Perl-Routine) vor Start Operation + executeAfterProc : ausführen FHEM Kommando (oder Perl-Routine) nach Ende Operation reading : einschließen oder ausschließen von Datensätzen die <reading> enthalten readingNameMap : die entstehenden Ergebnisreadings werden partiell umbenannt time.* : eine Reihe von Attributen zur Zeitabgrenzung @@ -14241,8 +14248,8 @@ sub bdump { aggregation : Auswahl einer Aggregationsperiode device : einschließen oder ausschließen von Datensätzen die <device> enthalten - executeBeforeProc : ausführen FHEM Kommando (oder perl-Routine) vor Start Operation - executeAfterProc : ausführen FHEM Kommando (oder perl-Routine) nach Ende Operation + executeBeforeProc : ausführen FHEM Kommando (oder Perl-Routine) vor Start Operation + executeAfterProc : ausführen FHEM Kommando (oder Perl-Routine) nach Ende Operation reading : einschließen oder ausschließen von Datensätzen die <reading> enthalten readingNameMap : die entstehenden Ergebnisreadings werden partiell umbenannt time.* : eine Reihe von Attributen zur Zeitabgrenzung @@ -14314,8 +14321,8 @@ sub bdump {