diff --git a/fhem/contrib/DS_Starter/93_DbLog.pm b/fhem/contrib/DS_Starter/93_DbLog.pm index 0710fc788..287f629a1 100644 --- a/fhem/contrib/DS_Starter/93_DbLog.pm +++ b/fhem/contrib/DS_Starter/93_DbLog.pm @@ -1,5 +1,5 @@ ############################################################################################################################################ -# $Id: 93_DbLog.pm 27111 2023-01-29 19:06:28Z DS_Starter $ +# $Id: 93_DbLog.pm 27111 2023-01-30 19:06:28Z DS_Starter $ # # 93_DbLog.pm # written by Dr. Boris Neubert 2007-12-30 @@ -38,7 +38,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch'; # Version History intern by DS_Starter: my %DbLog_vNotesIntern = ( - "5.8.0" => "27.01.2023 new Get menu for a selection of getters, fix creation of new subprocess during shutdown sequence ", + "5.8.0" => "30.01.2023 new Get menu for a selection of getters, fix creation of new subprocess during shutdown sequence ", "5.7.0" => "25.01.2023 send Log3() data back ro parent process, improve _DbLog_dbReadings function ", "5.6.2" => "22.01.2023 check Syntax of DbLogValueFn attribute with Log output, Forum:#131777 ", "5.6.1" => "16.01.2023 rewrite sub _DbLog_SBP_connectDB, rewrite sub DbLog_ExecSQL, _DbLog_SBP_onRun_deleteOldDays ", @@ -132,7 +132,7 @@ my %DbLog_hget = ( ReadingsAvgVal => { fn => \&_DbLog_dbReadings }, webchart => { fn => \&_DbLog_chartQuery }, plotdata => { fn => \&_DbLog_plotData }, - dataRetrieval => { fn => \&_DbLog_chartQuery }, + retrieve => { fn => \&_DbLog_chartQuery }, ); my %DbLog_columns = ("DEVICE" => 64, @@ -5840,7 +5840,7 @@ sub DbLog_Get { "ReadingsMinVal ". "ReadingsMinValTimestamp ". "ReadingsAvgVal ". - "dataRetrieval: " + "retrieve: " ; return $getlist; @@ -5977,7 +5977,7 @@ sub _DbLog_chartQuery { my $i = 0; my $jsonstring = q({); - $jsonstring .= q("success": "true", ) if($opt eq 'dataRetrieval'); + $jsonstring .= q("success": "true", ) if($opt eq 'retrieve'); $jsonstring .= q("data":[); while ( my @data = $query_handle->fetchrow_array()) { @@ -6052,7 +6052,7 @@ sub _DbLog_createQuerySql { my $history = $hash->{HELPER}{TH}; my $current = $hash->{HELPER}{TC}; - if ($opt eq 'dataRetrieval') { + if ($opt eq 'retrieve') { $querytype = $a[1]; $device = $a[2]; $reading = $a[3]; @@ -6179,10 +6179,10 @@ sub _DbLog_createQuerySql { $sql = 'error'; - if ($querytype eq 'getdevices') { + if ($querytype eq 'getdevices' || $querytype eq 'alldevices') { $sql = "SELECT distinct(device) FROM $history"; } - elsif($querytype eq 'getreadings') { + elsif ($querytype eq 'getreadings' || $querytype eq 'allreadings') { if ($device) { $sql = "SELECT distinct(reading) FROM $history WHERE device = '$device'"; } @@ -6225,7 +6225,7 @@ sub _DbLog_createQuerySql { elsif ($querytype eq 'getcharts') { $sql = "SELECT * FROM frontend WHERE TYPE = 'savedchart'"; } - elsif ($querytype eq 'getTableData') { + elsif ($querytype eq 'getTableData' || $querytype eq 'fetchrows') { if ($device ne '""' && $reading ne '""') { $sql = "SELECT * FROM $history WHERE READING = '$reading' AND DEVICE = '$device' "; $sql .= "AND TIMESTAMP Between '$starttime' AND '$endtime'"; @@ -9151,8 +9151,8 @@ return;