diff --git a/fhem/contrib/DS_Starter/93_DbRep.pm b/fhem/contrib/DS_Starter/93_DbRep.pm
index 9ad5db0ee..ec4a3c98b 100644
--- a/fhem/contrib/DS_Starter/93_DbRep.pm
+++ b/fhem/contrib/DS_Starter/93_DbRep.pm
@@ -6511,8 +6511,8 @@ sub sqlCmd_DoParse {
# Allow inplace replacement of keywords for timings (use time attribute syntax), device, reading
$sql =~ s/§timestamp_begin§/'$runtime_string_first'/g;
$sql =~ s/§timestamp_end§/'$runtime_string_next'/g;
- $sql =~ s/§device§/'$device'/ig;
- $sql =~ s/§reading§/'$reading'/ig;
+ $sql =~ s/§device§/'$device'/xg if ($device);
+ $sql =~ s/§reading§/'$reading'/xg if ($reading);
$sql =~ s/ESC_ESC_ESC/;/gx; # wiederherstellen von escapeten ";" -> umwandeln von ";;" in ";"
@@ -13470,10 +13470,12 @@ return;
This command also accept the setting of MySQL session variables like "SET @open:=NULL,
@closed:=NULL;" or the usage of SQLite PRAGMA before execution the SQL-Statement.
If the session variable or PRAGMA has to be set every time before executing a SQL statement, the
- attribute 'sqlCmdVars' can be set.
- 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.
+ attribute 'sqlCmdVars' can be set.
+ If the attributes device, reading,
+ 'timestamp_begin' respectively 'timestamp_end'
+ set in the module are to be taken into account in the statement,
+ the placeholders §device§, §reading§, §timestamp_begin§ respectively
+ §timestamp_end§ can be used for this purpose.
If you want update a dataset, you have to add "TIMESTAMP=TIMESTAMP" to the update-statement to avoid changing the
original timestamp.
@@ -16116,9 +16118,11 @@ sub bdump {
Soll die Session Variable oder das PRAGMA vor jeder Ausführung eines SQL Statements
gesetzt werden, kann dafür das Attribut sqlCmdVars
verwendet werden.
- Sollen die im Modul gesetzten Attribute timestamp_begin bzw.
+ Sollen die im Modul gesetzten Attribute device, reading,
+ timestamp_begin bzw.
timestamp_end im Statement berücksichtigt werden, können die Platzhalter
- §timestamp_begin§ bzw. §timestamp_end§ dafür verwendet werden.
+ §device§, §reading§, §timestamp_begin§ bzw.
+ §timestamp_end§ dafür verwendet werden.
Soll ein Datensatz upgedated werden, ist dem Statement "TIMESTAMP=TIMESTAMP" hinzuzufügen um eine Änderung des
originalen Timestamps zu verhindern.