mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-13 17:26:34 +00:00
93_DbRep: new aggregation value 'minute', some fixes
git-svn-id: https://svn.fhem.de/fhem/trunk@22455 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
5d1b2fa27d
commit
3a0dbe629e
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 93_DbRep: new aggregation value 'minute', some fixes
|
||||||
- feature: 14_SD_UT.pm
|
- feature: 14_SD_UT.pm
|
||||||
new model Westinghouse Bendan, NAVARIS touch light switch,
|
new model Westinghouse Bendan, NAVARIS touch light switch,
|
||||||
Remote control BF-301 from Shenzhen BOFU Mechanic & Electronic Co
|
Remote control BF-301 from Shenzhen BOFU Mechanic & Electronic Co
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -57,7 +57,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
|||||||
|
|
||||||
# Version History intern
|
# Version History intern
|
||||||
our %DbRep_vNotesIntern = (
|
our %DbRep_vNotesIntern = (
|
||||||
"8.40.4" => "22.07.2020 new aggregation value 'minute' ",
|
"8.40.4" => "23.07.2020 new aggregation value 'minute', some fixes ",
|
||||||
"8.40.3" => "22.07.2020 delete prototypes ",
|
"8.40.3" => "22.07.2020 delete prototypes ",
|
||||||
"8.40.2" => "27.06.2020 improve versionNotes 2 ",
|
"8.40.2" => "27.06.2020 improve versionNotes 2 ",
|
||||||
"8.40.1" => "18.05.2020 improve 'restore' setlist, revised comRef, fix compare timesettings for delEntries,reduceLog ",
|
"8.40.1" => "18.05.2020 improve 'restore' setlist, revised comRef, fix compare timesettings for delEntries,reduceLog ",
|
||||||
@ -551,7 +551,7 @@ sub DbRep_Set {
|
|||||||
if ($opt =~ /eraseReadings/) {
|
if ($opt =~ /eraseReadings/) {
|
||||||
$hash->{LASTCMD} = $prop?"$opt $prop":"$opt";
|
$hash->{LASTCMD} = $prop?"$opt $prop":"$opt";
|
||||||
DbRep_delread($hash); # Readings löschen die nicht in der Ausnahmeliste (Attr readingPreventFromDel) stehen
|
DbRep_delread($hash); # Readings löschen die nicht in der Ausnahmeliste (Attr readingPreventFromDel) stehen
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt eq "dumpMySQL" && $hash->{ROLE} ne "Agent") {
|
if ($opt eq "dumpMySQL" && $hash->{ROLE} ne "Agent") {
|
||||||
@ -567,7 +567,7 @@ sub DbRep_Set {
|
|||||||
}
|
}
|
||||||
DbRep_beforeproc($hash, "dump");
|
DbRep_beforeproc($hash, "dump");
|
||||||
DbRep_Main($hash,$opt,$prop);
|
DbRep_Main($hash,$opt,$prop);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt eq "dumpSQLite" && $hash->{ROLE} ne "Agent") {
|
if ($opt eq "dumpSQLite" && $hash->{ROLE} ne "Agent") {
|
||||||
@ -577,7 +577,7 @@ sub DbRep_Set {
|
|||||||
Log3 ($name, 3, "DbRep $name - ################################################################");
|
Log3 ($name, 3, "DbRep $name - ################################################################");
|
||||||
DbRep_beforeproc($hash, "dump");
|
DbRep_beforeproc($hash, "dump");
|
||||||
DbRep_Main($hash,$opt,$prop);
|
DbRep_Main($hash,$opt,$prop);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt eq "repairSQLite" && $hash->{ROLE} ne "Agent") {
|
if ($opt eq "repairSQLite" && $hash->{ROLE} ne "Agent") {
|
||||||
@ -596,7 +596,7 @@ sub DbRep_Set {
|
|||||||
|
|
||||||
DbRep_beforeproc($hash, "repair");
|
DbRep_beforeproc($hash, "repair");
|
||||||
DbRep_Main($hash,$opt);
|
DbRep_Main($hash,$opt);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt =~ /restoreMySQL|restoreSQLite/ && $hash->{ROLE} ne "Agent") {
|
if ($opt =~ /restoreMySQL|restoreSQLite/ && $hash->{ROLE} ne "Agent") {
|
||||||
@ -606,7 +606,7 @@ sub DbRep_Set {
|
|||||||
Log3 ($name, 3, "DbRep $name - ################################################################");
|
Log3 ($name, 3, "DbRep $name - ################################################################");
|
||||||
DbRep_beforeproc($hash, "restore");
|
DbRep_beforeproc($hash, "restore");
|
||||||
DbRep_Main($hash,$opt,$prop);
|
DbRep_Main($hash,$opt,$prop);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt =~ /optimizeTables|vacuum/ && $hash->{ROLE} ne "Agent") {
|
if ($opt =~ /optimizeTables|vacuum/ && $hash->{ROLE} ne "Agent") {
|
||||||
@ -616,7 +616,7 @@ sub DbRep_Set {
|
|||||||
Log3 ($name, 3, "DbRep $name - ################################################################");
|
Log3 ($name, 3, "DbRep $name - ################################################################");
|
||||||
DbRep_beforeproc($hash, "optimize");
|
DbRep_beforeproc($hash, "optimize");
|
||||||
DbRep_Main($hash,$opt);
|
DbRep_Main($hash,$opt);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt =~ m/delSeqDoublets|delDoublets/ && $hash->{ROLE} ne "Agent") {
|
if ($opt =~ m/delSeqDoublets|delDoublets/ && $hash->{ROLE} ne "Agent") {
|
||||||
@ -626,7 +626,7 @@ sub DbRep_Set {
|
|||||||
}
|
}
|
||||||
DbRep_beforeproc($hash, "delDoublets");
|
DbRep_beforeproc($hash, "delDoublets");
|
||||||
DbRep_Main($hash,$opt,$prop);
|
DbRep_Main($hash,$opt,$prop);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt =~ m/reduceLog/ && $hash->{ROLE} ne "Agent") {
|
if ($opt =~ m/reduceLog/ && $hash->{ROLE} ne "Agent") {
|
||||||
@ -643,7 +643,7 @@ sub DbRep_Set {
|
|||||||
Log3 ($name, 3, "DbRep $name - ################################################################");
|
Log3 ($name, 3, "DbRep $name - ################################################################");
|
||||||
DbRep_beforeproc($hash, "reduceLog");
|
DbRep_beforeproc($hash, "reduceLog");
|
||||||
DbRep_Main($hash,$opt);
|
DbRep_Main($hash,$opt);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -667,7 +667,7 @@ sub DbRep_Set {
|
|||||||
BlockingKill($hash->{HELPER}{RUNNING_BACKUP_CLIENT});
|
BlockingKill($hash->{HELPER}{RUNNING_BACKUP_CLIENT});
|
||||||
Log3 ($name, 3, "DbRep $name -> running Dump has been canceled");
|
Log3 ($name, 3, "DbRep $name -> running Dump has been canceled");
|
||||||
ReadingsSingleUpdateValue ($hash, "state", "Dump canceled", 1);
|
ReadingsSingleUpdateValue ($hash, "state", "Dump canceled", 1);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt eq "cancelRepair" && $hash->{ROLE} ne "Agent") {
|
if ($opt eq "cancelRepair" && $hash->{ROLE} ne "Agent") {
|
||||||
@ -675,7 +675,7 @@ sub DbRep_Set {
|
|||||||
BlockingKill($hash->{HELPER}{RUNNING_REPAIR});
|
BlockingKill($hash->{HELPER}{RUNNING_REPAIR});
|
||||||
Log3 ($name, 3, "DbRep $name -> running Repair has been canceled");
|
Log3 ($name, 3, "DbRep $name -> running Repair has been canceled");
|
||||||
ReadingsSingleUpdateValue ($hash, "state", "Repair canceled", 1);
|
ReadingsSingleUpdateValue ($hash, "state", "Repair canceled", 1);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt eq "cancelRestore" && $hash->{ROLE} ne "Agent") {
|
if ($opt eq "cancelRestore" && $hash->{ROLE} ne "Agent") {
|
||||||
@ -683,13 +683,13 @@ sub DbRep_Set {
|
|||||||
BlockingKill($hash->{HELPER}{RUNNING_RESTORE});
|
BlockingKill($hash->{HELPER}{RUNNING_RESTORE});
|
||||||
Log3 ($name, 3, "DbRep $name -> running Restore has been canceled");
|
Log3 ($name, 3, "DbRep $name -> running Restore has been canceled");
|
||||||
ReadingsSingleUpdateValue ($hash, "state", "Restore canceled", 1);
|
ReadingsSingleUpdateValue ($hash, "state", "Restore canceled", 1);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt =~ m/tableCurrentFillup/ && $hash->{ROLE} ne "Agent") {
|
if ($opt =~ m/tableCurrentFillup/ && $hash->{ROLE} ne "Agent") {
|
||||||
$hash->{LASTCMD} = $prop?"$opt $prop":"$opt";
|
$hash->{LASTCMD} = $prop?"$opt $prop":"$opt";
|
||||||
DbRep_Main($hash,$opt);
|
DbRep_Main($hash,$opt);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt eq "index" && $hash->{ROLE} ne "Agent") {
|
if ($opt eq "index" && $hash->{ROLE} ne "Agent") {
|
||||||
@ -697,10 +697,11 @@ sub DbRep_Set {
|
|||||||
Log3 ($name, 3, "DbRep $name - ################################################################");
|
Log3 ($name, 3, "DbRep $name - ################################################################");
|
||||||
Log3 ($name, 3, "DbRep $name - ### New Index operation ###");
|
Log3 ($name, 3, "DbRep $name - ### New Index operation ###");
|
||||||
Log3 ($name, 3, "DbRep $name - ################################################################");
|
Log3 ($name, 3, "DbRep $name - ################################################################");
|
||||||
|
|
||||||
# Befehl vor Procedure ausführen
|
# Befehl vor Procedure ausführen
|
||||||
DbRep_beforeproc ($hash, "index");
|
DbRep_beforeproc ($hash, "index");
|
||||||
DbRep_Main ($hash,$opt,$prop);
|
DbRep_Main ($hash,$opt,$prop);
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt eq "adminCredentials" && $hash->{ROLE} ne "Agent") {
|
if ($opt eq "adminCredentials" && $hash->{ROLE} ne "Agent") {
|
||||||
@ -1415,7 +1416,8 @@ sub DbRep_Attr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return undef;
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################################################################
|
###################################################################################
|
||||||
@ -1510,7 +1512,7 @@ sub DbRep_Undef {
|
|||||||
|
|
||||||
DbRep_delread($hash,1);
|
DbRep_delread($hash,1);
|
||||||
|
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################################################################
|
###################################################################################
|
||||||
@ -1531,7 +1533,7 @@ sub DbRep_Delete {
|
|||||||
my $index = $hash->{TYPE}."_".$name."_adminCredentials";
|
my $index = $hash->{TYPE}."_".$name."_adminCredentials";
|
||||||
setKeyValue($index, undef);
|
setKeyValue($index, undef);
|
||||||
|
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################################################################
|
###################################################################################
|
||||||
@ -1545,7 +1547,7 @@ sub DbRep_Shutdown {
|
|||||||
DbRep_delread($hash,1);
|
DbRep_delread($hash,1);
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
|
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################################################################
|
###################################################################################
|
||||||
@ -1948,9 +1950,10 @@ sub DbRep_Main {
|
|||||||
Log3 ($name, 4, "DbRep $name - Timestamp end human readable: not set") if($opt !~ /tableCurrentPurge/);
|
Log3 ($name, 4, "DbRep $name - Timestamp end human readable: not set") if($opt !~ /tableCurrentPurge/);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3 ($name, 4, "DbRep $name - Aggregation: $aggregation") if($opt !~ /tableCurrentPurge|tableCurrentFillup|fetchrows|insert|reduceLog|delEntries/);
|
Log3 ($name, 4, "DbRep $name - Aggregation: $aggregation") if($opt !~ /tableCurrentPurge|tableCurrentFillup|fetchrows|insert|reduceLog|delEntries|^sql/x);
|
||||||
|
|
||||||
##### Funktionsaufrufe #####
|
##### Funktionsaufrufe #####
|
||||||
|
#############################
|
||||||
if ($opt eq "sumValue") {
|
if ($opt eq "sumValue") {
|
||||||
$hash->{HELPER}{RUNNING_PID} = BlockingCall("sumval_DoParse", "$name§$device§$reading§$prop§$ts", "sumval_ParseDone", $to, "DbRep_ParseAborted", $hash);
|
$hash->{HELPER}{RUNNING_PID} = BlockingCall("sumval_DoParse", "$name§$device§$reading§$prop§$ts", "sumval_ParseDone", $to, "DbRep_ParseAborted", $hash);
|
||||||
|
|
||||||
@ -2106,6 +2109,7 @@ sub DbRep_Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$hash->{HELPER}{RUNNING_PID}{loglevel} = 5 if($hash->{HELPER}{RUNNING_PID}); # Forum #77057
|
$hash->{HELPER}{RUNNING_PID}{loglevel} = 5 if($hash->{HELPER}{RUNNING_PID}); # Forum #77057
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9784,7 +9788,7 @@ sub DbRep_checktimeaggr {
|
|||||||
$aggregation = "day"; # für Tagesmittelwertberechnung des deutschen Wetterdienstes immer "day"
|
$aggregation = "day"; # für Tagesmittelwertberechnung des deutschen Wetterdienstes immer "day"
|
||||||
$IsAggrSet = 1;
|
$IsAggrSet = 1;
|
||||||
}
|
}
|
||||||
if($hash->{LASTCMD} =~ /delEntries|fetchrows|deviceRename|readingRename|tableCurrentFillup|reduceLog|\breadingsDifferenceByTimeDelta\b/) {
|
if($hash->{LASTCMD} =~ /^sql|delEntries|fetchrows|deviceRename|readingRename|tableCurrentFillup|reduceLog|\breadingsDifferenceByTimeDelta\b/) {
|
||||||
$IsAggrSet = 0;
|
$IsAggrSet = 0;
|
||||||
$aggregation = "no";
|
$aggregation = "no";
|
||||||
}
|
}
|
||||||
@ -13092,8 +13096,8 @@ return;
|
|||||||
If the session variable or PRAGMA has to be set every time before executing a SQL statement, the
|
If the session variable or PRAGMA has to be set every time before executing a SQL statement, the
|
||||||
attribute <a href="#sqlCmdVars">'sqlCmdVars'</a> can be set. <br>
|
attribute <a href="#sqlCmdVars">'sqlCmdVars'</a> can be set. <br>
|
||||||
If the attribute <a href="#timestamp_begin">'timestamp_begin'</a> respectively 'timestamp_end'
|
If the attribute <a href="#timestamp_begin">'timestamp_begin'</a> respectively 'timestamp_end'
|
||||||
is assumed in the statement, it is possible to use placeholder "<b>§timestamp_begin§</b>" respectively
|
is assumed in the statement, it is possible to use placeholder <b>§timestamp_begin§</b> respectively
|
||||||
"<b>§timestamp_end§</b>" on suitable place. <br><br>
|
<b>§timestamp_end§</b> on suitable place. <br><br>
|
||||||
|
|
||||||
If you want update a dataset, you have to add "TIMESTAMP=TIMESTAMP" to the update-statement to avoid changing the
|
If you want update a dataset, you have to add "TIMESTAMP=TIMESTAMP" to the update-statement to avoid changing the
|
||||||
original timestamp. <br><br>
|
original timestamp. <br><br>
|
||||||
@ -15672,19 +15676,19 @@ sub bdump {
|
|||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<li><b> sqlCmd </b> - führt ein beliebiges benutzerspezifisches Kommando aus. <br>
|
<li><b> sqlCmd </b> - führt ein beliebiges benutzerspezifisches Kommando aus. <br>
|
||||||
Enthält dieses Kommando eine Delete-Operation, muss zur Sicherheit das
|
Enthält dieses Kommando eine Delete-Operation, muss zur Sicherheit das Attribut
|
||||||
<a href="#DbRepattr">Attribut</a> "allowDeletion" gesetzt sein. <br>
|
<a href="#allowDeletion">allowDeletion</a> gesetzt sein. <br>
|
||||||
Bei der Ausführung dieses Kommandos werden keine Einschränkungen durch gesetzte Attribute
|
Bei der Ausführung dieses Kommandos werden keine Einschränkungen durch gesetzte Attribute
|
||||||
"device", "reading", "time.*" bzw. "aggregation" berücksichtigt. <br>
|
"device", "reading", "time.*" bzw. "aggregation" berücksichtigt. <br>
|
||||||
Dieses Kommando akzeptiert ebenfalls das Setzen von SQL Session Variablen wie z.B.
|
Dieses Kommando akzeptiert ebenfalls das Setzen von SQL Session Variablen wie z.B.
|
||||||
"SET @open:=NULL, @closed:=NULL;" oder die Verwendung von SQLite PRAGMA vor der
|
"SET @open:=NULL, @closed:=NULL;" oder die Verwendung von SQLite PRAGMA vor der
|
||||||
Ausführung des SQL-Statements.
|
Ausführung des SQL-Statements.
|
||||||
Soll die Session Variable oder das PRAGMA vor jeder Ausführung eines SQL Statements
|
Soll die Session Variable oder das PRAGMA vor jeder Ausführung eines SQL Statements
|
||||||
gesetzt werden, kann dafür das <a href="#DbRepattr">Attribut</a> "sqlCmdVars"
|
gesetzt werden, kann dafür das Attribut <a href="#sqlCmdVars">sqlCmdVars</a>
|
||||||
verwendet werden. <br>
|
verwendet werden. <br>
|
||||||
Sollen die im Modul gesetzten <a href="#DbRepattr">Attribute</a> "timestamp_begin" bzw.
|
Sollen die im Modul gesetzten Attribute <a href="#timestamp_begin">timestamp_begin</a> bzw.
|
||||||
"timestamp_end" im Statement berücksichtigt werden, können die Platzhalter
|
<a href="#timestamp_end">timestamp_end</a> im Statement berücksichtigt werden, können die Platzhalter
|
||||||
"<b>§timestamp_begin§</b>" bzw. "<b>§timestamp_end§</b>" dafür verwendet werden. <br><br>
|
<b>§timestamp_begin§</b> bzw. <b>§timestamp_end§</b> dafür verwendet werden. <br><br>
|
||||||
|
|
||||||
Soll ein Datensatz upgedated werden, ist dem Statement "TIMESTAMP=TIMESTAMP" hinzuzufügen um eine Änderung des
|
Soll ein Datensatz upgedated werden, ist dem Statement "TIMESTAMP=TIMESTAMP" hinzuzufügen um eine Änderung des
|
||||||
originalen Timestamps zu verhindern. <br><br>
|
originalen Timestamps zu verhindern. <br><br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user