diff --git a/fhem/contrib/DS_Starter/93_DbLog.pm b/fhem/contrib/DS_Starter/93_DbLog.pm index 287f629a1..7d6bc2d63 100644 --- a/fhem/contrib/DS_Starter/93_DbLog.pm +++ b/fhem/contrib/DS_Starter/93_DbLog.pm @@ -6190,6 +6190,12 @@ sub _DbLog_createQuerySql { elsif ($querytype eq 'last') { $sql = "SELECT TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT from $history ORDER BY TIMESTAMP DESC LIMIT $limit"; } + elsif ($querytype eq 'count') { + if ($device) { + my $table = $device; + $sql = "SELECT COUNT(*) AS COUNT_".$table." from $table"; + } + } elsif ($querytype eq 'timerange') { if ($device && $reading && $starttime && $endtime) { $sql = "SELECT ".$xaxis.", VALUE FROM $history WHERE READING = '$reading' AND DEVICE = '$device' AND TIMESTAMP Between '$starttime' AND '$endtime' ORDER BY TIMESTAMP;"; @@ -9152,7 +9158,7 @@ return;