diff --git a/fhem/contrib/DS_Starter/93_DbLog.pm b/fhem/contrib/DS_Starter/93_DbLog.pm index 783b5fddc..acf226b6b 100644 --- a/fhem/contrib/DS_Starter/93_DbLog.pm +++ b/fhem/contrib/DS_Starter/93_DbLog.pm @@ -187,6 +187,7 @@ sub DbLog_Initialize { "excludeDevs ". "expimpdir ". "exportCacheAppend:1,0 ". + "headerLinks:text,icon ". "insertMode:1,0 ". "noSupportPK:1,0 ". "plotInputFieldLength ". @@ -6973,7 +6974,7 @@ sub _DbLog_plotData { $retval .= sprintf("%s: %s %s %s %s %s %s\n", $out_tstamp, $sql_device, $type, $event, $sql_reading, $out_value, $unit); } elsif ($outf =~ m/(array)/) { - push(@ReturnArray, {"tstamp" => $out_tstamp, "device" => $sql_device, "type" => $type, "event" => $event, "reading" => $sql_reading, "value" => $out_value, "unit" => $unit}); + push @ReturnArray, {"tstamp" => $out_tstamp, "device" => $sql_device, "type" => $type, "event" => $event, "reading" => $sql_reading, "value" => $out_value, "unit" => $unit}; } else { $out_tstamp =~ s/\ /_/g; # needed by generating plots @@ -8588,30 +8589,27 @@ sub DbLog_fhemwebFn { my $ret; my $newIdx = 1; - while($defs{"SVG_${d}_$newIdx"}) { + while ($defs{"SVG_${d}_$newIdx"}) { $newIdx++; } - my $name = "SVG_${d}_$newIdx"; - + my $svgname = "SVG_${d}_$newIdx"; + my $hdlink = AttrVal ($d, 'headerLinks', 'icon'); my $dstyle = qq{style='padding-left: 10px; padding-right: 10px; padding-top: 3px; padding-bottom: 3px; white-space:nowrap;'}; # TD-Style my $cmdchk = qq{"FW_cmd('$FW_ME$FW_subdir?XHR=1&cmd=get $d configCheck', function(data){FW_okDialog(data)})"}; my $cmdfile = qq{"FW_cmd('$FW_ME$FW_subdir?XHR=1&cmd=get $d showConfigFile', function(data){FW_okDialog(data)})"}; - my $svgimg = FW_makeImage('time_graph@grey'); my $svgtitle = 'Create SVG plot from DbLog'; + my $svgimg = FW_makeImage('time_graph@grey'); - my $img = FW_makeImage('time_note@grey'); - my $fthicon = "$img"; my $fthtitle = 'Open DbLog Forum'; + my $fhtimg = FW_makeImage('time_note@grey'); - $img = FW_makeImage('edit_settings@grey'); - my $chkicon = "$img"; my $chktitle = 'Run Configuration Check'; + my $chkimg = FW_makeImage('edit_settings@grey'); - $img = FW_makeImage('control_hamburger_s@grey'); - my $filicon = "$img"; my $filtitle = 'Show Configuration File Content'; + my $filimg = FW_makeImage('control_hamburger_s@grey'); if (AttrVal ('global', 'language', 'EN') eq 'DE') { $svgtitle = "SVG-Diagramm aus DbLog erstellen"; @@ -8619,7 +8617,16 @@ sub DbLog_fhemwebFn { $chktitle = 'Konfigurationsprüfung ausführen'; $filtitle = 'Inhalt der Konfigurationsdatei anzeigen'; } - + + if ($hdlink eq 'text') { + $svgimg = $svgtitle; $filimg = $filtitle; $chkimg = $chktitle; $fhtimg = $fthtitle; + $svgtitle = ''; $filtitle = ''; $chktitle = ''; $fthtitle = ''; + } + + my $filicon = "$filimg"; + my $chkicon = "$chkimg"; + my $fthicon = "$fhtimg"; + my $class = qq{}; $class .= qq{}; $class .= qq{}; @@ -8628,7 +8635,7 @@ sub DbLog_fhemwebFn { $ret = qq{
$svgimg
}; $ret .= qq{}; - $ret .= FW_pH ("cmd=define $name SVG $d:templateDB:HISTORY;set $name copyGplotFile&detail=$name", + $ret .= FW_pH ("cmd=define $svgname SVG $d:templateDB:HISTORY;set $svgname copyGplotFile&detail=$svgname", "
$class
", 1, "dval", 1); $ret .= qq{}; $ret .= qq{}; @@ -8954,7 +8961,7 @@ return; #%dbconfig= ( # connection => "mysql:database=fhem;host=<database host>;port=3306", # # if want communication over socket-file instead of TCP/IP transport, use: - # # connection => "mysql:database=fhem;mysql_socket=</patch/socket-file>", + # # connection => "mysql:database=fhem;mysql_socket=</path/socket-file>", # user => "fhemuser", # password => "fhempassword", # # optional enable UTF-8 support @@ -8971,7 +8978,7 @@ return; #%dbconfig= ( # connection => "MariaDB:database=fhem;host=<database host>;port=3306", # # if want communication over socket-file instead of TCP/IP transport, use: - # # connection => "MariaDB:database=fhem;mariadb_socket=</patch/socket-file>", + # # connection => "MariaDB:database=fhem;mariadb_socket=</path/socket-file>", # user => "fhemuser", # password => "fhempassword", # # optional enable communication compression between client and server @@ -8997,7 +9004,7 @@ return; #); #################################################################################### - If configDB is used, the configuration file has to be uploaded into the configDB !

+ If configDB is used, the configuration file has to be uploaded into the configDB!

Note about special characters:
If special characters, e.g. @,$ or % which have a meaning in the perl programming @@ -9919,15 +9926,14 @@ return; DbLog uses a sub-process to write the log data into the database and processes the data generally not blocking for FHEM.
Thus, the writing process to the database is generally not blocking and FHEM is not affected in the case - the database is not performing or is not available (maintenance, error condition).
- (default: 0) + the database is not performing or is not available (maintenance, error condition).

$filicon $chkicon
- + @@ -10408,6 +10414,18 @@ attr SMA_Energymeter DbLogValueFn
+ + +
0 - Synchronous log mode. The data to be logged is only briefly cached and immediately
written to the database.
written to the database. (default)
Advantages:
In principle, the data is immediately available in the database.
Very little to no data is lost when FHEM crashes.
- +
0 - The data is passed as an array to the database interface.
0 - The data is passed as an array to the database interface. (default)
It is in most cases the most performant way to insert a lot of data into the database at once.
1 - The records are passed sequentially to the database interface and inserted into the DB.
-
- - (default: 0) @@ -10835,7 +10850,7 @@ attr SMA_Energymeter DbLogValueFn #%dbconfig= ( # connection => "mysql:database=fhem;host=<database host>;port=3306", # # if want communication over socket-file instead of TCP/IP transport, use: - # # connection => "mysql:database=fhem;mysql_socket=</patch/socket-file>", + # # connection => "mysql:database=fhem;mysql_socket=</path/socket-file>", # user => "fhemuser", # password => "fhempassword", # # optional enable UTF-8 support @@ -10851,7 +10866,7 @@ attr SMA_Energymeter DbLogValueFn #%dbconfig= ( # connection => "MariaDB:database=fhem;host=<database host>;port=3306", # # if want communication over socket-file instead of TCP/IP transport, use: - # # connection => "MariaDB:database=fhem;mariadb_socket=</patch/socket-file>", + # # connection => "MariaDB:database=fhem;mariadb_socket=</path/socket-file>", # user => "fhemuser", # password => "fhempassword", # # optional enable communication compression between client and server @@ -10878,7 +10893,7 @@ attr SMA_Energymeter DbLogValueFn #################################################################################### - Wird configDB genutzt, ist das Konfigurationsfile in die configDB hochzuladen !

+ Wird configDB genutzt, ist das Konfigurationsfile in die configDB hochzuladen!

Hinweis zu Sonderzeichen:
Werden Sonderzeichen, wie z.B. @, $ oder %, welche eine programmtechnische Bedeutung in Perl haben im Passwort verwendet, @@ -11836,15 +11851,14 @@ attr SMA_Energymeter DbLogValueFn generell nicht blockierend für FHEM.
Dadurch erfolgt der Schreibprozess in die Datenbank generell nicht blockierend und FHEM wird in dem Fall, dass die Datenbank nicht performant arbeitet oder nicht verfügbar ist (Wartung, Fehlerzustand, etc.), - nicht beeinträchtigt.
- (default: 0) + nicht beeinträchtigt.

-
- - (default: 0)