mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-05 08:20:23 +00:00
93_DbRep: values next_day_begin, next_day_end for time attributes
git-svn-id: https://svn.fhem.de/fhem/trunk@23163 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d1c728c7f5
commit
29385a29b1
@ -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: values next_day_begin, next_day_end for time attributes
|
||||||
- feature: 23_LUXTRONIK2: new set parameter opModeVentilation
|
- feature: 23_LUXTRONIK2: new set parameter opModeVentilation
|
||||||
- feature: 93_DbRep: new attrbute avgDailyMeanGWSwithGTS for Grassland
|
- feature: 93_DbRep: new attrbute avgDailyMeanGWSwithGTS for Grassland
|
||||||
temperature sum calculation
|
temperature sum calculation
|
||||||
|
@ -57,6 +57,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
|||||||
|
|
||||||
# Version History intern
|
# Version History intern
|
||||||
my %DbRep_vNotesIntern = (
|
my %DbRep_vNotesIntern = (
|
||||||
|
"8.42.0" => "14.11.2020 new vals next_day_begin, next_day_end for time attr Forum: https://forum.fhem.de/index.php/topic,53584.msg1100040.html#msg1100040 ",
|
||||||
"8.41.0" => "08.11.2020 new attrbute avgDailyMeanGWSwithGTS for Grassland temperature sum, minor bugfixes in create time array ",
|
"8.41.0" => "08.11.2020 new attrbute avgDailyMeanGWSwithGTS for Grassland temperature sum, minor bugfixes in create time array ",
|
||||||
"8.40.8" => "17.09.2020 sqlCmd supports PREPARE statament Forum: #114293, commandRef revised ",
|
"8.40.8" => "17.09.2020 sqlCmd supports PREPARE statament Forum: #114293, commandRef revised ",
|
||||||
"8.40.7" => "03.09.2020 rename getter dbValue to sqlCmdBlocking, consider attr timeout in function DbRep_sqlCmdBlocking (blocking function), commandRef revised ",
|
"8.40.7" => "03.09.2020 rename getter dbValue to sqlCmdBlocking, consider attr timeout in function DbRep_sqlCmdBlocking (blocking function), commandRef revised ",
|
||||||
@ -735,8 +736,8 @@ sub DbRep_Set {
|
|||||||
|
|
||||||
} elsif ($opt =~ m/delEntries|tableCurrentPurge/ && $hash->{ROLE} ne "Agent") {
|
} elsif ($opt =~ m/delEntries|tableCurrentPurge/ && $hash->{ROLE} ne "Agent") {
|
||||||
$hash->{LASTCMD} = $prop?"$opt $prop":"$opt";
|
$hash->{LASTCMD} = $prop?"$opt $prop":"$opt";
|
||||||
delete $hash->{HELPER}{DELENTRIES};
|
delete $hash->{HELPER}{DELENTRIES};
|
||||||
|
|
||||||
if (!AttrVal($hash->{NAME}, "allowDeletion", undef)) {
|
if (!AttrVal($hash->{NAME}, "allowDeletion", undef)) {
|
||||||
return " Set attribute 'allowDeletion' if you want to allow deletion of any database entries. Use it with care !";
|
return " Set attribute 'allowDeletion' if you want to allow deletion of any database entries. Use it with care !";
|
||||||
}
|
}
|
||||||
@ -989,12 +990,12 @@ sub DbRep_Get {
|
|||||||
|
|
||||||
} elsif ($opt =~ /sqlCmdBlocking|dbValue/) {
|
} elsif ($opt =~ /sqlCmdBlocking|dbValue/) {
|
||||||
return qq{get "$opt" needs at least an argument} if ( @a < 3 );
|
return qq{get "$opt" needs at least an argument} if ( @a < 3 );
|
||||||
|
|
||||||
if($opt eq "dbValue") {
|
|
||||||
Log3($name, 1, qq{$name - WARNING - the command "dbValue" is deprecated and will be removed soon. Please use "sqlCmdBlocking" instead.});
|
|
||||||
}
|
|
||||||
|
|
||||||
my @cmd = @a;
|
if($opt eq "dbValue") {
|
||||||
|
Log3($name, 1, qq{$name - WARNING - the command "dbValue" is deprecated and will be removed soon. Please use "sqlCmdBlocking" instead.});
|
||||||
|
}
|
||||||
|
|
||||||
|
my @cmd = @a;
|
||||||
shift @cmd; shift @cmd;
|
shift @cmd; shift @cmd;
|
||||||
|
|
||||||
my $sqlcmd = join " ", @cmd;
|
my $sqlcmd = join " ", @cmd;
|
||||||
@ -1302,7 +1303,7 @@ sub DbRep_Attr {
|
|||||||
|
|
||||||
if ($aName eq "timeYearPeriod") {
|
if ($aName eq "timeYearPeriod") {
|
||||||
# 06-01 02-28
|
# 06-01 02-28
|
||||||
unless ($aVal =~ /^(\d{2})-(\d{2}) (\d{2})-(\d{2})$/ )
|
unless ($aVal =~ /^(\d{2})-(\d{2})\s(\d{2})-(\d{2})$/x )
|
||||||
{ return "The Value of \"$aName\" isn't valid. Set the account period as \"MM-DD MM-DD\".";}
|
{ return "The Value of \"$aName\" isn't valid. Set the account period as \"MM-DD MM-DD\".";}
|
||||||
my ($mm1, $dd1, $mm2, $dd2) = ($aVal =~ /^(\d{2})-(\d{2}) (\d{2})-(\d{2})$/);
|
my ($mm1, $dd1, $mm2, $dd2) = ($aVal =~ /^(\d{2})-(\d{2}) (\d{2})-(\d{2})$/);
|
||||||
my (undef,undef,undef,$mday,$mon,$year1,undef,undef,undef) = localtime(time); # Istzeit Ableitung
|
my (undef,undef,undef,$mday,$mon,$year1,undef,undef,undef) = localtime(time); # Istzeit Ableitung
|
||||||
@ -1326,21 +1327,48 @@ sub DbRep_Attr {
|
|||||||
delete($attr{$name}{timestamp_end}) if ($attr{$name}{timestamp_end});
|
delete($attr{$name}{timestamp_end}) if ($attr{$name}{timestamp_end});
|
||||||
delete($attr{$name}{timeDiffToNow}) if ($attr{$name}{timeDiffToNow});
|
delete($attr{$name}{timeDiffToNow}) if ($attr{$name}{timeDiffToNow});
|
||||||
delete($attr{$name}{timeOlderThan}) if ($attr{$name}{timeOlderThan});
|
delete($attr{$name}{timeOlderThan}) if ($attr{$name}{timeOlderThan});
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
if ($aName eq "timestamp_begin" || $aName eq "timestamp_end") {
|
if ($aName eq "timestamp_begin" || $aName eq "timestamp_end") {
|
||||||
my ($a,$b,$c) = split('_',$aVal);
|
my @dtas = qw(current_year_begin
|
||||||
if ($a =~ /^current$|^previous$/ && $b =~ /^hour$|^day$|^week$|^month$|^year$/ && $c =~ /^begin$|^end$/) {
|
current_year_end
|
||||||
delete($attr{$name}{timeDiffToNow}) if ($attr{$name}{timeDiffToNow});
|
previous_year_begin
|
||||||
delete($attr{$name}{timeOlderThan}) if ($attr{$name}{timeOlderThan});
|
previous_year_end
|
||||||
delete($attr{$name}{timeYearPeriod}) if ($attr{$name}{timeYearPeriod});
|
current_month_begin
|
||||||
return undef;
|
current_month_end
|
||||||
|
previous_month_begin
|
||||||
|
previous_month_end
|
||||||
|
current_week_begin
|
||||||
|
current_week_end
|
||||||
|
previous_week_begin
|
||||||
|
previous_week_end
|
||||||
|
current_day_begin
|
||||||
|
current_day_end
|
||||||
|
previous_day_begin
|
||||||
|
previous_day_end
|
||||||
|
next_day_begin
|
||||||
|
next_day_end
|
||||||
|
current_hour_begin
|
||||||
|
current_hour_end
|
||||||
|
previous_hour_begin
|
||||||
|
previous_hour_end
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($aVal ~~ @dtas) {
|
||||||
|
delete($attr{$name}{timeDiffToNow});
|
||||||
|
delete($attr{$name}{timeOlderThan});
|
||||||
|
delete($attr{$name}{timeYearPeriod});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aVal = DbRep_formatpicker($aVal);
|
$aVal = DbRep_formatpicker($aVal);
|
||||||
unless ($aVal =~ /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/)
|
if ($aVal !~ /^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/x)
|
||||||
{return " The Value of $aName is not valid. Use format YYYY-MM-DD HH:MM:SS or one of \"current_[year|month|day|hour]_begin\",\"current_[year|month|day|hour]_end\", \"previous_[year|month|day|hour]_begin\", \"previous_[year|month|day|hour]_end\" !";}
|
{return "The Value of $aName is not valid. Use format YYYY-MM-DD HH:MM:SS or one of:\n".
|
||||||
|
"current_[year|month|day|hour]_begin, current_[year|month|day|hour]_end,\n".
|
||||||
|
"previous_[year|month|day|hour]_begin, previous_[year|month|day|hour]_end,\n".
|
||||||
|
"next_day_begin, next_day_end";}
|
||||||
|
|
||||||
my ($yyyy, $mm, $dd, $hh, $min, $sec) = ($aVal =~ /(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/);
|
my ($yyyy, $mm, $dd, $hh, $min, $sec) = ($aVal =~ /(\d+)-(\d+)-(\d+)\s(\d+):(\d+):(\d+)/x);
|
||||||
|
|
||||||
eval { my $epoch_seconds_begin = timelocal($sec, $min, $hh, $dd, $mm-1, $yyyy-1900); };
|
eval { my $epoch_seconds_begin = timelocal($sec, $min, $hh, $dd, $mm-1, $yyyy-1900); };
|
||||||
|
|
||||||
@ -1348,9 +1376,9 @@ sub DbRep_Attr {
|
|||||||
my @l = split (/at/, $@);
|
my @l = split (/at/, $@);
|
||||||
return " The Value of $aName is out of range - $l[0]";
|
return " The Value of $aName is out of range - $l[0]";
|
||||||
}
|
}
|
||||||
delete($attr{$name}{timeDiffToNow}) if ($attr{$name}{timeDiffToNow});
|
delete($attr{$name}{timeDiffToNow});
|
||||||
delete($attr{$name}{timeOlderThan}) if ($attr{$name}{timeOlderThan});
|
delete($attr{$name}{timeOlderThan});
|
||||||
delete($attr{$name}{timeYearPeriod}) if ($attr{$name}{timeYearPeriod});
|
delete($attr{$name}{timeYearPeriod});
|
||||||
}
|
}
|
||||||
if ($aName =~ /ftpTimeout|timeout|diffAccept/) {
|
if ($aName =~ /ftpTimeout|timeout|diffAccept/) {
|
||||||
unless ($aVal =~ /^[0-9]+$/) { return " The Value of $aName is not valid. Use only figures 0-9 without decimal places !";}
|
unless ($aVal =~ /^[0-9]+$/) { return " The Value of $aName is not valid. Use only figures 0-9 without decimal places !";}
|
||||||
@ -1361,16 +1389,16 @@ sub DbRep_Attr {
|
|||||||
if ($aName eq "timeDiffToNow") {
|
if ($aName eq "timeDiffToNow") {
|
||||||
unless ($aVal =~ /^[0-9]+$/ || $aVal =~ /^\s*[ydhms]:([\d]+)\s*/ && $aVal !~ /.*,.*/ )
|
unless ($aVal =~ /^[0-9]+$/ || $aVal =~ /^\s*[ydhms]:([\d]+)\s*/ && $aVal !~ /.*,.*/ )
|
||||||
{ return "The Value of \"$aName\" isn't valid. Set simple seconds like \"86400\" or use form like \"y:1 d:10 h:6 m:12 s:20\". Refer to commandref !";}
|
{ return "The Value of \"$aName\" isn't valid. Set simple seconds like \"86400\" or use form like \"y:1 d:10 h:6 m:12 s:20\". Refer to commandref !";}
|
||||||
delete($attr{$name}{timestamp_begin}) if ($attr{$name}{timestamp_begin});
|
delete($attr{$name}{timestamp_begin});
|
||||||
delete($attr{$name}{timestamp_end}) if ($attr{$name}{timestamp_end});
|
delete($attr{$name}{timestamp_end});
|
||||||
delete($attr{$name}{timeYearPeriod}) if ($attr{$name}{timeYearPeriod});
|
delete($attr{$name}{timeYearPeriod});
|
||||||
}
|
}
|
||||||
if ($aName eq "timeOlderThan") {
|
if ($aName eq "timeOlderThan") {
|
||||||
unless ($aVal =~ /^[0-9]+$/ || $aVal =~ /^\s*[ydhms]:([\d]+)\s*/ && $aVal !~ /.*,.*/ )
|
unless ($aVal =~ /^[0-9]+$/ || $aVal =~ /^\s*[ydhms]:([\d]+)\s*/ && $aVal !~ /.*,.*/ )
|
||||||
{ return "The Value of \"$aName\" isn't valid. Set simple seconds like \"86400\" or use form like \"y:1 d:10 h:6 m:12 s:20\". Refer to commandref !";}
|
{ return "The Value of \"$aName\" isn't valid. Set simple seconds like \"86400\" or use form like \"y:1 d:10 h:6 m:12 s:20\". Refer to commandref !";}
|
||||||
delete($attr{$name}{timestamp_begin}) if ($attr{$name}{timestamp_begin});
|
delete($attr{$name}{timestamp_begin});
|
||||||
delete($attr{$name}{timestamp_end}) if ($attr{$name}{timestamp_end});
|
delete($attr{$name}{timestamp_end});
|
||||||
delete($attr{$name}{timeYearPeriod}) if ($attr{$name}{timeYearPeriod});
|
delete($attr{$name}{timeYearPeriod});
|
||||||
}
|
}
|
||||||
if ($aName eq "dumpMemlimit" || $aName eq "dumpSpeed") {
|
if ($aName eq "dumpMemlimit" || $aName eq "dumpSpeed") {
|
||||||
unless ($aVal =~ /^[0-9]+$/) { return "The Value of $aName is not valid. Use only figures 0-9 without decimal places.";}
|
unless ($aVal =~ /^[0-9]+$/) { return "The Value of $aName is not valid. Use only figures 0-9 without decimal places.";}
|
||||||
@ -1991,10 +2019,10 @@ sub DbRep_Main {
|
|||||||
my $othants = fhemTimeLocal($sec2, $min2, $hh2, $dd2, $mm2-1, $yyyy2-1900);
|
my $othants = fhemTimeLocal($sec2, $min2, $hh2, $dd2, $mm2-1, $yyyy2-1900);
|
||||||
if($nthants > $othants) {
|
if($nthants > $othants) {
|
||||||
ReadingsSingleUpdateValue ($hash, "state", "Error - Wrong time limits. The <nn> (days newer than) option must be greater than the <no> (older than) one !", 1);
|
ReadingsSingleUpdateValue ($hash, "state", "Error - Wrong time limits. The <nn> (days newer than) option must be greater than the <no> (older than) one !", 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$hash->{HELPER}{RUNNING_PID} = BlockingCall("del_DoParse", "$name|history|$device|$reading|$runtime_string_first|$runtime_string_next", "del_ParseDone", $to, "DbRep_ParseAborted", $hash);
|
$hash->{HELPER}{RUNNING_PID} = BlockingCall("del_DoParse", "$name|history|$device|$reading|$runtime_string_first|$runtime_string_next", "del_ParseDone", $to, "DbRep_ParseAborted", $hash);
|
||||||
|
|
||||||
} elsif ($opt eq "tableCurrentPurge") {
|
} elsif ($opt eq "tableCurrentPurge") {
|
||||||
@ -2091,14 +2119,14 @@ sub DbRep_Main {
|
|||||||
my ($yyyy2, $mm2, $dd2, $hh2, $min2, $sec2) = $runtime_string_next =~ /(\d+)-(\d+)-(\d+)\s(\d+):(\d+):(\d+)/x;
|
my ($yyyy2, $mm2, $dd2, $hh2, $min2, $sec2) = $runtime_string_next =~ /(\d+)-(\d+)-(\d+)\s(\d+):(\d+):(\d+)/x;
|
||||||
my $nthants = fhemTimeLocal($sec1, $min1, $hh1, $dd1, $mm1-1, $yyyy1-1900);
|
my $nthants = fhemTimeLocal($sec1, $min1, $hh1, $dd1, $mm1-1, $yyyy1-1900);
|
||||||
my $othants = fhemTimeLocal($sec2, $min2, $hh2, $dd2, $mm2-1, $yyyy2-1900);
|
my $othants = fhemTimeLocal($sec2, $min2, $hh2, $dd2, $mm2-1, $yyyy2-1900);
|
||||||
|
|
||||||
if($nthants > $othants) {
|
if($nthants > $othants) {
|
||||||
ReadingsSingleUpdateValue ($hash, "state", "Error - Wrong time limits. The <nn> (days newer than) option must be greater than the <no> (older than) one !", 1);
|
ReadingsSingleUpdateValue ($hash, "state", "Error - Wrong time limits. The <nn> (days newer than) option must be greater than the <no> (older than) one !", 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$hash->{HELPER}{RUNNING_REDUCELOG} = BlockingCall("DbRep_reduceLog", "$name|$device|$reading|$runtime_string_first|$runtime_string_next", "DbRep_reduceLogDone", $to, "DbRep_reduceLogAborted", $hash);
|
$hash->{HELPER}{RUNNING_REDUCELOG} = BlockingCall("DbRep_reduceLog", "$name|$device|$reading|$runtime_string_first|$runtime_string_next", "DbRep_reduceLogDone", $to, "DbRep_reduceLogAborted", $hash);
|
||||||
$hash->{HELPER}{RUNNING_REDUCELOG}{loglevel} = 5 if($hash->{HELPER}{RUNNING_REDUCELOG}); # Forum #77057
|
$hash->{HELPER}{RUNNING_REDUCELOG}{loglevel} = 5 if($hash->{HELPER}{RUNNING_REDUCELOG}); # Forum #77057
|
||||||
ReadingsSingleUpdateValue ($hash, "state", "reduceLog database is running - be patient and see Logfile !", 1);
|
ReadingsSingleUpdateValue ($hash, "state", "reduceLog database is running - be patient and see Logfile !", 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2147,14 +2175,14 @@ sub DbRep_createTimeArray {
|
|||||||
my $dep = $4;
|
my $dep = $4;
|
||||||
my $c = ($mon+1).$mday;
|
my $c = ($mon+1).$mday;
|
||||||
my $e = $mep.$dep;
|
my $e = $mep.$dep;
|
||||||
|
|
||||||
if ($mep <= $mbp && $c <= $e) {
|
if ($mep <= $mbp && $c <= $e) {
|
||||||
$ybp--;
|
$ybp--;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$yep++;
|
$yep++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tsbegin = "$ybp-$mbp-$dbp 00:00:00";
|
$tsbegin = "$ybp-$mbp-$dbp 00:00:00";
|
||||||
$tsend = "$yep-$mep-$dep 23:59:59";
|
$tsend = "$yep-$mep-$dep 23:59:59";
|
||||||
}
|
}
|
||||||
@ -2162,38 +2190,38 @@ sub DbRep_createTimeArray {
|
|||||||
if (AttrVal($name,"timestamp_begin","") eq "current_year_begin" ||
|
if (AttrVal($name,"timestamp_begin","") eq "current_year_begin" ||
|
||||||
AttrVal($name,"timestamp_end","") eq "current_year_begin") {
|
AttrVal($name,"timestamp_end","") eq "current_year_begin") {
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,0,$year)) if(AttrVal($name,"timestamp_begin","") eq "current_year_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,0,$year)) if(AttrVal($name,"timestamp_begin","") eq "current_year_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,0,$year)) if(AttrVal($name,"timestamp_end","") eq "current_year_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,0,$year)) if(AttrVal($name,"timestamp_end","") eq "current_year_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "current_year_end" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "current_year_end" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "current_year_end") {
|
AttrVal($name, "timestamp_end", "") eq "current_year_end") {
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,31,11,$year)) if(AttrVal($name,"timestamp_begin","") eq "current_year_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,31,11,$year)) if(AttrVal($name,"timestamp_begin","") eq "current_year_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,31,11,$year)) if(AttrVal($name,"timestamp_end","") eq "current_year_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,31,11,$year)) if(AttrVal($name,"timestamp_end","") eq "current_year_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_year_begin" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_year_begin" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "previous_year_begin") {
|
AttrVal($name, "timestamp_end", "") eq "previous_year_begin") {
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,0,$year-1)) if(AttrVal($name, "timestamp_begin", "") eq "previous_year_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,0,$year-1)) if(AttrVal($name, "timestamp_begin", "") eq "previous_year_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,0,$year-1)) if(AttrVal($name, "timestamp_end", "") eq "previous_year_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,0,$year-1)) if(AttrVal($name, "timestamp_end", "") eq "previous_year_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_year_end" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_year_end" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "previous_year_end") {
|
AttrVal($name, "timestamp_end", "") eq "previous_year_end") {
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,31,11,$year-1)) if(AttrVal($name, "timestamp_begin", "") eq "previous_year_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,31,11,$year-1)) if(AttrVal($name, "timestamp_begin", "") eq "previous_year_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,31,11,$year-1)) if(AttrVal($name, "timestamp_end", "") eq "previous_year_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,31,11,$year-1)) if(AttrVal($name, "timestamp_end", "") eq "previous_year_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "current_month_begin" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "current_month_begin" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "current_month_begin") {
|
AttrVal($name, "timestamp_end", "") eq "current_month_begin") {
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_month_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_month_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_month_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_month_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "current_month_end" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "current_month_end" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "current_month_end") {
|
AttrVal($name, "timestamp_end", "") eq "current_month_end") {
|
||||||
$dim = $mon-1?30+(($mon+1)*3%7<4):28+!($year%4||$year%400*!($year%100));
|
$dim = $mon-1?30+(($mon+1)*3%7<4):28+!($year%4||$year%400*!($year%100));
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$dim,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_month_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$dim,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_month_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$dim,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_month_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$dim,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_month_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_month_begin" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_month_begin" ||
|
||||||
@ -2201,7 +2229,7 @@ sub DbRep_createTimeArray {
|
|||||||
$ryear = ($mon-1<0)?$year-1:$year;
|
$ryear = ($mon-1<0)?$year-1:$year;
|
||||||
$rmon = ($mon-1<0)?11:$mon-1;
|
$rmon = ($mon-1<0)?11:$mon-1;
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_month_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_month_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_month_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,1,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_month_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_month_end" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_month_end" ||
|
||||||
@ -2210,7 +2238,7 @@ sub DbRep_createTimeArray {
|
|||||||
$rmon = ($mon-1<0)?11:$mon-1;
|
$rmon = ($mon-1<0)?11:$mon-1;
|
||||||
$dim = $rmon-1?30+(($rmon+1)*3%7<4):28+!($ryear%4||$ryear%400*!($ryear%100));
|
$dim = $rmon-1?30+(($rmon+1)*3%7<4):28+!($ryear%4||$ryear%400*!($ryear%100));
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$dim,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_month_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$dim,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_month_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$dim,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_month_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$dim,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_month_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "current_week_begin" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "current_week_begin" ||
|
||||||
@ -2224,7 +2252,7 @@ sub DbRep_createTimeArray {
|
|||||||
$tsub = 518400 if($wday == 0); # wenn Start am "So" dann Korrektur -6 Tage
|
$tsub = 518400 if($wday == 0); # wenn Start am "So" dann Korrektur -6 Tage
|
||||||
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time-$tsub);
|
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time-$tsub);
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "current_week_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "current_week_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "current_week_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "current_week_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "current_week_end" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "current_week_end" ||
|
||||||
@ -2238,7 +2266,7 @@ sub DbRep_createTimeArray {
|
|||||||
$tadd = 0 if($wday == 0); # wenn Start am "So" keine Korrektur
|
$tadd = 0 if($wday == 0); # wenn Start am "So" keine Korrektur
|
||||||
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time+$tadd);
|
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time+$tadd);
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "current_week_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "current_week_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "current_week_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "current_week_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_week_begin" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_week_begin" ||
|
||||||
@ -2252,7 +2280,7 @@ sub DbRep_createTimeArray {
|
|||||||
$tsub = 1123200 if($wday == 0); # wenn Start am "So" dann Korrektur -13 Tage
|
$tsub = 1123200 if($wday == 0); # wenn Start am "So" dann Korrektur -13 Tage
|
||||||
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time-$tsub);
|
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time-$tsub);
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_week_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_week_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_week_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_week_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_week_end" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_week_end" ||
|
||||||
@ -2266,21 +2294,35 @@ sub DbRep_createTimeArray {
|
|||||||
$tsub = 604800 if($wday == 0); # wenn Start am "So" dann Korrektur -7 Tage
|
$tsub = 604800 if($wday == 0); # wenn Start am "So" dann Korrektur -7 Tage
|
||||||
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time-$tsub);
|
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time-$tsub);
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_week_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_week_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_week_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_week_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "current_day_begin" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "current_day_begin" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "current_day_begin") {
|
AttrVal($name, "timestamp_end", "") eq "current_day_begin") {
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$mday,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_day_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$mday,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_day_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$mday,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_day_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$mday,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_day_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "current_day_end" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "current_day_end" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "current_day_end") {
|
AttrVal($name, "timestamp_end", "") eq "current_day_end") {
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$mday,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_day_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$mday,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_day_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$mday,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_day_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$mday,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_day_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AttrVal($name, "timestamp_begin", "") eq "next_day_begin" ||
|
||||||
|
AttrVal($name, "timestamp_end", "") eq "next_day_begin") {
|
||||||
|
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time+86400); # Istzeit + 1 Tag
|
||||||
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "next_day_begin");
|
||||||
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "next_day_begin");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AttrVal($name, "timestamp_begin", "") eq "next_day_end" ||
|
||||||
|
AttrVal($name, "timestamp_end", "") eq "next_day_end") {
|
||||||
|
($rsec,$rmin,$rhour,$rmday,$rmon,$ryear) = localtime(time+86400); # Istzeit + 1 Tag
|
||||||
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "next_day_end");
|
||||||
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "next_day_end");
|
||||||
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_day_begin" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_day_begin" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "previous_day_begin") {
|
AttrVal($name, "timestamp_end", "") eq "previous_day_begin") {
|
||||||
$rmday = $mday-1;
|
$rmday = $mday-1;
|
||||||
@ -2295,7 +2337,7 @@ sub DbRep_createTimeArray {
|
|||||||
$rmday = $rmon-1?30+(($rmon+1)*3%7<4):28+!($ryear%4||$ryear%400*!($ryear%100)); # Achtung: Monat als 1...12 (statt 0...11)
|
$rmday = $rmon-1?30+(($rmon+1)*3%7<4):28+!($ryear%4||$ryear%400*!($ryear%100)); # Achtung: Monat als 1...12 (statt 0...11)
|
||||||
}
|
}
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_day_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_day_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_day_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,0,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_day_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_day_end" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_day_end" ||
|
||||||
@ -2312,19 +2354,19 @@ sub DbRep_createTimeArray {
|
|||||||
$rmday = $rmon-1?30+(($rmon+1)*3%7<4):28+!($ryear%4||$ryear%400*!($ryear%100)); # Achtung: Monat als 1...12 (statt 0...11)
|
$rmday = $rmon-1?30+(($rmon+1)*3%7<4):28+!($ryear%4||$ryear%400*!($ryear%100)); # Achtung: Monat als 1...12 (statt 0...11)
|
||||||
}
|
}
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_day_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_day_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_day_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,23,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_day_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "current_hour_begin" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "current_hour_begin" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "current_hour_begin") {
|
AttrVal($name, "timestamp_end", "") eq "current_hour_begin") {
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,$hour,$mday,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_hour_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,$hour,$mday,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_hour_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,$hour,$mday,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_hour_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,$hour,$mday,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_hour_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "current_hour_end" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "current_hour_end" ||
|
||||||
AttrVal($name, "timestamp_end", "") eq "current_hour_end") {
|
AttrVal($name, "timestamp_end", "") eq "current_hour_end") {
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,$hour,$mday,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_hour_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,$hour,$mday,$mon,$year)) if(AttrVal($name, "timestamp_begin", "") eq "current_hour_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,$hour,$mday,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_hour_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,$hour,$mday,$mon,$year)) if(AttrVal($name, "timestamp_end", "") eq "current_hour_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_hour_begin" ||
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_hour_begin" ||
|
||||||
@ -2346,7 +2388,7 @@ sub DbRep_createTimeArray {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,$rhour,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_hour_begin");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,$rhour,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_hour_begin");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,$rhour,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_hour_begin");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(0,0,$rhour,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_hour_begin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AttrVal($name, "timestamp_begin", "") eq "previous_hour_end" || AttrVal($name, "timestamp_end", "") eq "previous_hour_end") {
|
if (AttrVal($name, "timestamp_begin", "") eq "previous_hour_end" || AttrVal($name, "timestamp_end", "") eq "previous_hour_end") {
|
||||||
@ -2354,7 +2396,7 @@ sub DbRep_createTimeArray {
|
|||||||
$rmday = $mday;
|
$rmday = $mday;
|
||||||
$rmon = $mon;
|
$rmon = $mon;
|
||||||
$ryear = $year;
|
$ryear = $year;
|
||||||
|
|
||||||
if($rhour<0) {
|
if($rhour<0) {
|
||||||
$rhour = 23;
|
$rhour = 23;
|
||||||
$rmday = $mday-1;
|
$rmday = $mday-1;
|
||||||
@ -2367,9 +2409,9 @@ sub DbRep_createTimeArray {
|
|||||||
$rmday = $rmon-1?30+(($rmon+1)*3%7<4):28+!($ryear%4||$ryear%400*!($ryear%100)); # Achtung: Monat als 1...12 (statt 0...11)
|
$rmday = $rmon-1?30+(($rmon+1)*3%7<4):28+!($ryear%4||$ryear%400*!($ryear%100)); # Achtung: Monat als 1...12 (statt 0...11)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,$rhour,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_hour_end");
|
$tsbegin = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,$rhour,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_begin", "") eq "previous_hour_end");
|
||||||
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,$rhour,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_hour_end");
|
$tsend = strftime "%Y-%m-%d %T",localtime(timelocal(59,59,$rhour,$rmday,$rmon,$ryear)) if(AttrVal($name, "timestamp_end", "") eq "previous_hour_end");
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($yyyy1, $mm1, $dd1, $hh1, $min1, $sec1) = $tsbegin =~ /(\d+)-(\d+)-(\d+)\s(\d+):(\d+):(\d+)/x; # extrahieren der Einzelwerte von Datum/Zeit Beginn
|
my ($yyyy1, $mm1, $dd1, $hh1, $min1, $sec1) = $tsbegin =~ /(\d+)-(\d+)-(\d+)\s(\d+):(\d+):(\d+)/x; # extrahieren der Einzelwerte von Datum/Zeit Beginn
|
||||||
@ -6250,7 +6292,7 @@ sub sqlCmd_DoParse {
|
|||||||
my $vars = AttrVal($name, "sqlCmdVars", "");
|
my $vars = AttrVal($name, "sqlCmdVars", "");
|
||||||
if ($vars) {
|
if ($vars) {
|
||||||
@pms = split(";",$vars);
|
@pms = split(";",$vars);
|
||||||
|
|
||||||
for my $pm (@pms) {
|
for my $pm (@pms) {
|
||||||
if($pm !~ /PRAGMA|SET/i) {
|
if($pm !~ /PRAGMA|SET/i) {
|
||||||
next;
|
next;
|
||||||
@ -6273,7 +6315,7 @@ sub sqlCmd_DoParse {
|
|||||||
if($cmd =~ /^\s*SET.*;/i) {
|
if($cmd =~ /^\s*SET.*;/i) {
|
||||||
@pms = split(";",$cmd);
|
@pms = split(";",$cmd);
|
||||||
$sql = q{};
|
$sql = q{};
|
||||||
|
|
||||||
for my $pm (@pms) {
|
for my $pm (@pms) {
|
||||||
|
|
||||||
if($pm !~ /SET/i) {
|
if($pm !~ /SET/i) {
|
||||||
@ -6301,7 +6343,7 @@ sub sqlCmd_DoParse {
|
|||||||
if($cmd =~ /^\s*PRAGMA.*;/i) {
|
if($cmd =~ /^\s*PRAGMA.*;/i) {
|
||||||
@pms = split(";",$cmd);
|
@pms = split(";",$cmd);
|
||||||
$sql = q{};
|
$sql = q{};
|
||||||
|
|
||||||
for my $pm (@pms) {
|
for my $pm (@pms) {
|
||||||
|
|
||||||
if($pm !~ /PRAGMA/i) {
|
if($pm !~ /PRAGMA/i) {
|
||||||
@ -6328,7 +6370,7 @@ sub sqlCmd_DoParse {
|
|||||||
# z.B. PREPARE statement FROM @CMD
|
# z.B. PREPARE statement FROM @CMD
|
||||||
if($sql =~ /^\s*PREPARE.*;/i) {
|
if($sql =~ /^\s*PREPARE.*;/i) {
|
||||||
@pms = split(";",$sql);
|
@pms = split(";",$sql);
|
||||||
$sql = q{};
|
$sql = q{};
|
||||||
for my $pm (@pms) {
|
for my $pm (@pms) {
|
||||||
|
|
||||||
if($pm !~ /PREPARE/i) {
|
if($pm !~ /PREPARE/i) {
|
||||||
@ -13557,7 +13599,7 @@ return;
|
|||||||
</li>
|
</li>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a name="dbstatus"></a>
|
<a name="dbstatus"></a>
|
||||||
<li><b> dbstatus </b> - lists global information about MySQL server status (e.g. informations related to cache, threads, bufferpools, etc. ).
|
<li><b> dbstatus </b> - lists global information about MySQL server status (e.g. informations related to cache, threads, bufferpools, etc. ).
|
||||||
Initially all available informations are reported. Using the attribute <a href="#showStatus">showStatus</a> the quantity of
|
Initially all available informations are reported. Using the attribute <a href="#showStatus">showStatus</a> the quantity of
|
||||||
results can be limited to show only the desired values. Further detailed informations of items meaning are
|
results can be limited to show only the desired values. Further detailed informations of items meaning are
|
||||||
@ -13578,16 +13620,16 @@ return;
|
|||||||
The timeout can be set with the attribute <a href="#dbreptimeout">timeout</a>.
|
The timeout can be set with the attribute <a href="#dbreptimeout">timeout</a>.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Examples:</b> <br>
|
<b>Examples:</b> <br>
|
||||||
{ fhem("get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") } <br>
|
{ fhem("get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") } <br>
|
||||||
{ CommandGet(undef,"Rep.LogDB1 sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") } <br>
|
{ CommandGet(undef,"Rep.LogDB1 sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") } <br>
|
||||||
get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device <br>
|
get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device <br>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
Because of its mode of operation this function is particular convenient for user own perl scripts. <br>
|
Because of its mode of operation this function is particular convenient for user own perl scripts. <br>
|
||||||
The input accepts multi line commands and delivers multi line results as well.
|
The input accepts multi line commands and delivers multi line results as well.
|
||||||
This command also accept the setting of SQL session variables like "SET @open:=NULL,
|
This command also accept the setting of SQL session variables like "SET @open:=NULL,
|
||||||
@closed:=NULL;". <br>
|
@closed:=NULL;". <br>
|
||||||
@ -13596,7 +13638,7 @@ return;
|
|||||||
are separated by newline ("\n"). <br>
|
are separated by newline ("\n"). <br>
|
||||||
This function only set/update status readings, the userExitFn function isn't called.
|
This function only set/update status readings, the userExitFn function isn't called.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
If you create a little routine in 99_myUtils, for example:
|
If you create a little routine in 99_myUtils, for example:
|
||||||
<br>
|
<br>
|
||||||
<pre>
|
<pre>
|
||||||
@ -13610,15 +13652,15 @@ sub dbval {
|
|||||||
it can be accessed with e.g. those calls:
|
it can be accessed with e.g. those calls:
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Examples:</b> <br>
|
<b>Examples:</b> <br>
|
||||||
{ dbval("<name>","select count(*) from history") } <br>
|
{ dbval("<name>","select count(*) from history") } <br>
|
||||||
$ret = dbval("<name>","select count(*) from history"); <br>
|
$ret = dbval("<name>","select count(*) from history"); <br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a name="dbvars"></a>
|
<a name="dbvars"></a>
|
||||||
<li><b> dbvars </b> - lists global informations about MySQL system variables. Included are e.g. readings related to InnoDB-Home, datafile path,
|
<li><b> dbvars </b> - lists global informations about MySQL system variables. Included are e.g. readings related to InnoDB-Home, datafile path,
|
||||||
memory- or cache-parameter and so on. The Output reports initially all available informations. Using the
|
memory- or cache-parameter and so on. The Output reports initially all available informations. Using the
|
||||||
attribute <a href="#showVariables">showVariables</a> the quantity of results can be limited to show only the desired values.
|
attribute <a href="#showVariables">showVariables</a> the quantity of results can be limited to show only the desired values.
|
||||||
@ -13634,14 +13676,14 @@ sub dbval {
|
|||||||
</li>
|
</li>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a name="minTimestamp"></a>
|
<a name="minTimestamp"></a>
|
||||||
<li><b> minTimestamp </b> - Identifies the oldest timestamp in the database (will be executed implicitely at FHEM start).
|
<li><b> minTimestamp </b> - Identifies the oldest timestamp in the database (will be executed implicitely at FHEM start).
|
||||||
The timestamp is used as begin of data selection if no time attribut is set to determine the
|
The timestamp is used as begin of data selection if no time attribut is set to determine the
|
||||||
start date.
|
start date.
|
||||||
</li>
|
</li>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a name="procinfo"></a>
|
<a name="procinfo"></a>
|
||||||
<li><b> procinfo </b> - Reports the existing database processes in a summary table (only MySQL). <br>
|
<li><b> procinfo </b> - Reports the existing database processes in a summary table (only MySQL). <br>
|
||||||
Typically only the own processes of the connection user (set in DbLog configuration file) will be
|
Typically only the own processes of the connection user (set in DbLog configuration file) will be
|
||||||
reported. If all precesses have to be reported, the global "PROCESS" right has to be granted to the
|
reported. If all precesses have to be reported, the global "PROCESS" right has to be granted to the
|
||||||
@ -13655,7 +13697,7 @@ sub dbval {
|
|||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a name="storedCredentials"></a>
|
<a name="storedCredentials"></a>
|
||||||
<li><b> storedCredentials </b> - Reports the users / passwords stored for database access by the device. <br>
|
<li><b> storedCredentials </b> - Reports the users / passwords stored for database access by the device. <br>
|
||||||
(only valid if database type is MYSQL)
|
(only valid if database type is MYSQL)
|
||||||
</li>
|
</li>
|
||||||
<br><br>
|
<br><br>
|
||||||
@ -13694,7 +13736,7 @@ sub dbval {
|
|||||||
<a name="versionNotes"></a>
|
<a name="versionNotes"></a>
|
||||||
<li><b> versionNotes [hints | rel | <key>] </b> -
|
<li><b> versionNotes [hints | rel | <key>] </b> -
|
||||||
Shows realease informations and/or hints about the module.
|
Shows realease informations and/or hints about the module.
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
@ -13707,10 +13749,10 @@ sub dbval {
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
It contains only main release informations for module users. <br>
|
It contains only main release informations for module users. <br>
|
||||||
If no options are specified, both release informations and hints will be shown. "rel" shows
|
If no options are specified, both release informations and hints will be shown. "rel" shows
|
||||||
only release informations and "hints" shows only hints. By the <key>-specification only
|
only release informations and "hints" shows only hints. By the <key>-specification only
|
||||||
the hint with the specified number is shown.
|
the hint with the specified number is shown.
|
||||||
@ -14308,6 +14350,8 @@ sub bdump {
|
|||||||
<b>current_day_end</b> : matches "<current day> 23:59:59" <br>
|
<b>current_day_end</b> : matches "<current day> 23:59:59" <br>
|
||||||
<b>previous_day_begin</b> : matches "<previous day> 00:00:00" <br>
|
<b>previous_day_begin</b> : matches "<previous day> 00:00:00" <br>
|
||||||
<b>previous_day_end</b> : matches "<previous day> 23:59:59" <br>
|
<b>previous_day_end</b> : matches "<previous day> 23:59:59" <br>
|
||||||
|
<b>next_day_begin</b> : matches "<next day> 00:00:00" <br>
|
||||||
|
<b>next_day_end</b> : matches "<next day> 23:59:59" <br>
|
||||||
<b>current_hour_begin</b> : matches "<current hour>:00:00" <br>
|
<b>current_hour_begin</b> : matches "<current hour>:00:00" <br>
|
||||||
<b>current_hour_end</b> : matches "<current hour>:59:59" <br>
|
<b>current_hour_end</b> : matches "<current hour>:59:59" <br>
|
||||||
<b>previous_hour_begin</b> : matches "<previous hour>:00:00" <br>
|
<b>previous_hour_begin</b> : matches "<previous hour>:00:00" <br>
|
||||||
@ -14340,6 +14384,8 @@ sub bdump {
|
|||||||
<b>current_day_end</b> : matches "<current day> 23:59:59" <br>
|
<b>current_day_end</b> : matches "<current day> 23:59:59" <br>
|
||||||
<b>previous_day_begin</b> : matches "<previous day> 00:00:00" <br>
|
<b>previous_day_begin</b> : matches "<previous day> 00:00:00" <br>
|
||||||
<b>previous_day_end</b> : matches "<previous day> 23:59:59" <br>
|
<b>previous_day_end</b> : matches "<previous day> 23:59:59" <br>
|
||||||
|
<b>next_day_begin</b> : matches "<next day> 00:00:00" <br>
|
||||||
|
<b>next_day_end</b> : matches "<next day> 23:59:59" <br>
|
||||||
<b>current_hour_begin</b> : matches "<current hour>:00:00" <br>
|
<b>current_hour_begin</b> : matches "<current hour>:00:00" <br>
|
||||||
<b>current_hour_end</b> : matches "<current hour>:59:59" <br>
|
<b>current_hour_end</b> : matches "<current hour>:59:59" <br>
|
||||||
<b>previous_hour_begin</b> : matches "<previous hour>:00:00" <br>
|
<b>previous_hour_begin</b> : matches "<previous hour>:00:00" <br>
|
||||||
@ -14777,12 +14823,12 @@ sub bdump {
|
|||||||
(nur gültig bei Datenbanktyp MYSQL und DbRep-Typ "Client")
|
(nur gültig bei Datenbanktyp MYSQL und DbRep-Typ "Client")
|
||||||
</li> <br>
|
</li> <br>
|
||||||
|
|
||||||
|
|
||||||
<li><b> averageValue [display | writeToDB | writeToDBSingle | writeToDBInTime]</b>
|
<li><b> averageValue [display | writeToDB | writeToDBSingle | writeToDBInTime]</b>
|
||||||
- berechnet einen Durchschnittswert des Datenbankfelds "VALUE" in den Zeitgrenzen
|
- berechnet einen Durchschnittswert des Datenbankfelds "VALUE" in den Zeitgrenzen
|
||||||
der möglichen time.*-Attribute. <br><br>
|
der möglichen time.*-Attribute. <br><br>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
Es muss das auszuwertende Reading im Attribut <a href="#reading">reading</a>
|
Es muss das auszuwertende Reading im Attribut <a href="#reading">reading</a>
|
||||||
angegeben sein.
|
angegeben sein.
|
||||||
Mit dem Attribut <a href="#averageCalcForm">averageCalcForm</a> wird die Berechnungsvariante zur
|
Mit dem Attribut <a href="#averageCalcForm">averageCalcForm</a> wird die Berechnungsvariante zur
|
||||||
@ -14800,7 +14846,7 @@ sub bdump {
|
|||||||
</table>
|
</table>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
Der neue Readingname wird aus einem Präfix und dem originalen Readingnamen gebildet,
|
Der neue Readingname wird aus einem Präfix und dem originalen Readingnamen gebildet,
|
||||||
wobei der originale Readingname durch das Attribut "readingNameMap" ersetzt werden kann.
|
wobei der originale Readingname durch das Attribut "readingNameMap" ersetzt werden kann.
|
||||||
Der Präfix setzt sich aus der Bildungsfunktion und der Aggregation zusammen. <br>
|
Der Präfix setzt sich aus der Bildungsfunktion und der Aggregation zusammen. <br>
|
||||||
@ -14836,7 +14882,7 @@ sub bdump {
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
<li><b> cancelDump </b> - bricht einen laufenden Datenbankdump ab. </li> <br>
|
<li><b> cancelDump </b> - bricht einen laufenden Datenbankdump ab. </li> <br>
|
||||||
|
|
||||||
|
|
||||||
@ -14846,7 +14892,7 @@ sub bdump {
|
|||||||
berücksichtigt wie gesetzte Zeitgrenzen (Attribute time.*). <br>
|
berücksichtigt wie gesetzte Zeitgrenzen (Attribute time.*). <br>
|
||||||
Fehlen diese Beschränkungen, wird die gesamte Datenbank durchsucht und der angegebene Wert
|
Fehlen diese Beschränkungen, wird die gesamte Datenbank durchsucht und der angegebene Wert
|
||||||
geändert. <br><br>
|
geändert. <br><br>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Syntax: </b> <br>
|
<b>Syntax: </b> <br>
|
||||||
@ -14866,10 +14912,10 @@ sub bdump {
|
|||||||
des Perl-Code geändert werden. Der zurückgebene Wert von $VALUE und $UNIT wird in dem Feld
|
des Perl-Code geändert werden. Der zurückgebene Wert von $VALUE und $UNIT wird in dem Feld
|
||||||
VALUE bzw. UNIT des Datensatzes gespeichert. </li></td></tr>
|
VALUE bzw. UNIT des Datensatzes gespeichert. </li></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Beispiele: </b> <br>
|
<b>Beispiele: </b> <br>
|
||||||
set <name> changeValue "OL","12 OL" <br>
|
set <name> changeValue "OL","12 OL" <br>
|
||||||
# der alte Feldwert "OL" wird in "12 OL" geändert. <br><br>
|
# der alte Feldwert "OL" wird in "12 OL" geändert. <br><br>
|
||||||
@ -14907,18 +14953,18 @@ sub bdump {
|
|||||||
<br>
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<li><b> countEntries [history | current] </b>
|
<li><b> countEntries [history | current] </b>
|
||||||
- liefert die Anzahl der Tabelleneinträge (default: history) in den gegebenen
|
- liefert die Anzahl der Tabelleneinträge (default: history) in den gegebenen
|
||||||
Zeitgrenzen (siehe <a href="#DbRepattr">Attribute</a>).
|
Zeitgrenzen (siehe <a href="#DbRepattr">Attribute</a>).
|
||||||
Sind die Timestamps nicht gesetzt, werden alle Einträge der Tabelle gezählt.
|
Sind die Timestamps nicht gesetzt, werden alle Einträge der Tabelle gezählt.
|
||||||
Beschränkungen durch die Attribute <a href="#device">device</a> bzw. <a href="#reading">reading</a>
|
Beschränkungen durch die Attribute <a href="#device">device</a> bzw. <a href="#reading">reading</a>
|
||||||
gehen in die Selektion mit ein. <br>
|
gehen in die Selektion mit ein. <br>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
Standardmäßig wird die Summe aller Datensätze, gekennzeichnet mit "ALLREADINGS", erstellt.
|
Standardmäßig wird die Summe aller Datensätze, gekennzeichnet mit "ALLREADINGS", erstellt.
|
||||||
Ist das Attribut "countEntriesDetail" gesetzt, wird die Anzahl jedes einzelnen Readings
|
Ist das Attribut "countEntriesDetail" gesetzt, wird die Anzahl jedes einzelnen Readings
|
||||||
zusätzlich ausgegeben. <br><br>
|
zusätzlich ausgegeben. <br><br>
|
||||||
|
|
||||||
Die für diese Funktion relevanten Attribute sind: <br><br>
|
Die für diese Funktion relevanten Attribute sind: <br><br>
|
||||||
|
|
||||||
@ -14938,14 +14984,14 @@ sub bdump {
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
<li><b> delDoublets [adviceDelete | delete]</b> - zeigt bzw. löscht doppelte / mehrfach vorkommende Datensätze.
|
<li><b> delDoublets [adviceDelete | delete]</b> - zeigt bzw. löscht doppelte / mehrfach vorkommende Datensätze.
|
||||||
Dazu wird Timestamp, Device,Reading und Value ausgewertet. <br>
|
Dazu wird Timestamp, Device,Reading und Value ausgewertet. <br>
|
||||||
Die <a href="#DbRepattr">Attribute</a> zur Aggregation,Zeit-,Device- und Reading-Abgrenzung werden dabei
|
Die <a href="#DbRepattr">Attribute</a> zur Aggregation,Zeit-,Device- und Reading-Abgrenzung werden dabei
|
||||||
berücksichtigt. Ist das Attribut "aggregation" nicht oder auf "no" gesetzt, wird im Standard die Aggregation
|
berücksichtigt. Ist das Attribut "aggregation" nicht oder auf "no" gesetzt, wird im Standard die Aggregation
|
||||||
"day" verwendet.
|
"day" verwendet.
|
||||||
<br><br>
|
<br><br>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<table>
|
<table>
|
||||||
@ -14965,7 +15011,7 @@ sub bdump {
|
|||||||
beeinflusst <b>NUR</b> die Anzeige der Daten. <br>
|
beeinflusst <b>NUR</b> die Anzeige der Daten. <br>
|
||||||
Vor und nach der Ausführung von "delDoublets" kann ein FHEM-Kommando bzw. Perl-Routine ausgeführt
|
Vor und nach der Ausführung von "delDoublets" kann ein FHEM-Kommando bzw. Perl-Routine ausgeführt
|
||||||
werden. (siehe Attribute <a href="#executeBeforeProc">executeBeforeProc</a>, <a href="#executeAfterProc">executeAfterProc</a>)
|
werden. (siehe Attribute <a href="#executeBeforeProc">executeBeforeProc</a>, <a href="#executeAfterProc">executeAfterProc</a>)
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Beispiel:</b> <br><br>
|
<b>Beispiel:</b> <br><br>
|
||||||
@ -16211,14 +16257,14 @@ sub bdump {
|
|||||||
Ergebnismenge eingeschränkt werden, um nur gewünschte Ergebnisse abzurufen. Detailinformationen zur Bedeutung der einzelnen Readings
|
Ergebnismenge eingeschränkt werden, um nur gewünschte Ergebnisse abzurufen. Detailinformationen zur Bedeutung der einzelnen Readings
|
||||||
sind <a href="http://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html">hier</a> verfügbar. <br><br>
|
sind <a href="http://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html">hier</a> verfügbar. <br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Beispiel</b> <br>
|
<b>Beispiel</b> <br>
|
||||||
attr <name> showStatus %uptime%,%qcache% <br>
|
attr <name> showStatus %uptime%,%qcache% <br>
|
||||||
get <name> dbstatus <br>
|
get <name> dbstatus <br>
|
||||||
# Es werden nur Readings erzeugt die im Namen "uptime" und "qcache" enthaltenen
|
# Es werden nur Readings erzeugt die im Namen "uptime" und "qcache" enthaltenen
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a name="sqlCmdBlocking"></a>
|
<a name="sqlCmdBlocking"></a>
|
||||||
<li><b> sqlCmdBlocking <SQL-Statement></b> -
|
<li><b> sqlCmdBlocking <SQL-Statement></b> -
|
||||||
@ -16226,14 +16272,14 @@ sub bdump {
|
|||||||
Der Timeout kann mit dem Attribut <a href="#dbreptimeout">timeout</a> eingestellt werden.
|
Der Timeout kann mit dem Attribut <a href="#dbreptimeout">timeout</a> eingestellt werden.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Beispiele:</b> <br>
|
<b>Beispiele:</b> <br>
|
||||||
{ fhem("get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") } <br>
|
{ fhem("get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") } <br>
|
||||||
{ CommandGet(undef,"Rep.LogDB1 sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") } <br>
|
{ CommandGet(undef,"Rep.LogDB1 sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device") } <br>
|
||||||
get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device <br>
|
get <name> sqlCmdBlocking select device,count(*) from history where timestamp > '2018-04-01' group by device <br>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
Diese Funktion ist durch ihre Arbeitsweise speziell für den Einsatz in benutzerspezifischen Scripten geeignet. <br>
|
Diese Funktion ist durch ihre Arbeitsweise speziell für den Einsatz in benutzerspezifischen Scripten geeignet. <br>
|
||||||
Die Eingabe akzeptiert Mehrzeiler und gibt ebenso mehrzeilige Ergebisse zurück.
|
Die Eingabe akzeptiert Mehrzeiler und gibt ebenso mehrzeilige Ergebisse zurück.
|
||||||
@ -16246,7 +16292,7 @@ sub bdump {
|
|||||||
wird nicht aufgerufen.
|
wird nicht aufgerufen.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
Erstellt man eine kleine Routine in 99_myUtils, wie z.B.:
|
Erstellt man eine kleine Routine in 99_myUtils, wie z.B.:
|
||||||
<br>
|
<br>
|
||||||
<pre>
|
<pre>
|
||||||
sub dbval {
|
sub dbval {
|
||||||
@ -16259,12 +16305,12 @@ sub dbval {
|
|||||||
kann sqlCmdBlocking vereinfacht verwendet werden mit Aufrufen wie:
|
kann sqlCmdBlocking vereinfacht verwendet werden mit Aufrufen wie:
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Beispiele:</b> <br>
|
<b>Beispiele:</b> <br>
|
||||||
{ dbval("<name>","select count(*) from history") } <br>
|
{ dbval("<name>","select count(*) from history") } <br>
|
||||||
oder <br>
|
oder <br>
|
||||||
$ret = dbval("<name>","select count(*) from history"); <br>
|
$ret = dbval("<name>","select count(*) from history"); <br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
@ -16275,14 +16321,14 @@ sub dbval {
|
|||||||
abzurufen. Weitere Informationen zur Bedeutung der ausgegebenen Variablen sind
|
abzurufen. Weitere Informationen zur Bedeutung der ausgegebenen Variablen sind
|
||||||
<a href="http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html">hier</a> verfügbar. <br><br>
|
<a href="http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html">hier</a> verfügbar. <br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Beispiel</b> <br>
|
<b>Beispiel</b> <br>
|
||||||
attr <name> showVariables %version%,%query_cache% <br>
|
attr <name> showVariables %version%,%query_cache% <br>
|
||||||
get <name> dbvars <br>
|
get <name> dbvars <br>
|
||||||
# Es werden nur Readings erzeugt die im Namen "version" und "query_cache" enthalten
|
# Es werden nur Readings erzeugt die im Namen "version" und "query_cache" enthalten
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a name="minTimestamp"></a>
|
<a name="minTimestamp"></a>
|
||||||
<li><b> minTimestamp </b> - Ermittelt den Zeitstempel des ältesten Datensatzes in der Datenbank (wird implizit beim Start von
|
<li><b> minTimestamp </b> - Ermittelt den Zeitstempel des ältesten Datensatzes in der Datenbank (wird implizit beim Start von
|
||||||
@ -16316,14 +16362,14 @@ sub dbval {
|
|||||||
Weitere Erläuterungen zu den gelieferten Informationen sind
|
Weitere Erläuterungen zu den gelieferten Informationen sind
|
||||||
<a href="https://msdn.microsoft.com/en-us/library/ms711681(v=vs.85).aspx">hier</a> zu finden. <br><br>
|
<a href="https://msdn.microsoft.com/en-us/library/ms711681(v=vs.85).aspx">hier</a> zu finden. <br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Beispiel</b> <br>
|
<b>Beispiel</b> <br>
|
||||||
attr <name> showSvrInfo %SQL_CATALOG_TERM%,%NAME% <br>
|
attr <name> showSvrInfo %SQL_CATALOG_TERM%,%NAME% <br>
|
||||||
get <name> svrinfo <br>
|
get <name> svrinfo <br>
|
||||||
# Es werden nur Readings erzeugt die im Namen "SQL_CATALOG_TERM" und "NAME" enthalten
|
# Es werden nur Readings erzeugt die im Namen "SQL_CATALOG_TERM" und "NAME" enthalten
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a name="tableinfo"></a>
|
<a name="tableinfo"></a>
|
||||||
<li><b> tableinfo </b> - ruft Tabelleninformationen aus der mit dem DbRep-Device verbundenen Datenbank ab (MySQL).
|
<li><b> tableinfo </b> - ruft Tabelleninformationen aus der mit dem DbRep-Device verbundenen Datenbank ab (MySQL).
|
||||||
@ -16331,14 +16377,14 @@ sub dbval {
|
|||||||
Mit dem Attribut <a href="#showTableInfo">showTableInfo</a> können die Ergebnisse eingeschränkt werden. Erläuterungen zu den erzeugten
|
Mit dem Attribut <a href="#showTableInfo">showTableInfo</a> können die Ergebnisse eingeschränkt werden. Erläuterungen zu den erzeugten
|
||||||
Readings sind <a href="http://dev.mysql.com/doc/refman/5.7/en/show-table-status.html">hier</a> zu finden. <br><br>
|
Readings sind <a href="http://dev.mysql.com/doc/refman/5.7/en/show-table-status.html">hier</a> zu finden. <br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<b>Beispiel</b> <br>
|
<b>Beispiel</b> <br>
|
||||||
attr <name> showTableInfo current,history <br>
|
attr <name> showTableInfo current,history <br>
|
||||||
get <name> tableinfo <br>
|
get <name> tableinfo <br>
|
||||||
# Es werden nur Information der Tabellen "current" und "history" angezeigt
|
# Es werden nur Information der Tabellen "current" und "history" angezeigt
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a name="versionNotes"></a>
|
<a name="versionNotes"></a>
|
||||||
<li><b> versionNotes [hints | rel | <key>] </b> -
|
<li><b> versionNotes [hints | rel | <key>] </b> -
|
||||||
@ -16355,10 +16401,10 @@ sub dbval {
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
Sind keine Optionen angegeben, werden sowohl Release Informationen als auch Hinweise angezeigt.
|
Sind keine Optionen angegeben, werden sowohl Release Informationen als auch Hinweise angezeigt.
|
||||||
Es sind nur Release Informationen mit Bedeutung für den Modulnutzer enthalten. <br>
|
Es sind nur Release Informationen mit Bedeutung für den Modulnutzer enthalten. <br>
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
@ -16959,6 +17005,8 @@ sub bdump {
|
|||||||
<b>current_day_end</b> : entspricht "<aktueller Tag> 23:59:59" <br>
|
<b>current_day_end</b> : entspricht "<aktueller Tag> 23:59:59" <br>
|
||||||
<b>previous_day_begin</b> : entspricht "<Vortag> 00:00:00" <br>
|
<b>previous_day_begin</b> : entspricht "<Vortag> 00:00:00" <br>
|
||||||
<b>previous_day_end</b> : entspricht "<Vortag> 23:59:59" <br>
|
<b>previous_day_end</b> : entspricht "<Vortag> 23:59:59" <br>
|
||||||
|
<b>next_day_begin</b> : entspricht "<nächster Tag> 00:00:00" <br>
|
||||||
|
<b>next_day_end</b> : entspricht "<nächster Tag> 23:59:59" <br>
|
||||||
<b>current_hour_begin</b> : entspricht "<aktuelle Stunde>:00:00" <br>
|
<b>current_hour_begin</b> : entspricht "<aktuelle Stunde>:00:00" <br>
|
||||||
<b>current_hour_end</b> : entspricht "<aktuelle Stunde>:59:59" <br>
|
<b>current_hour_end</b> : entspricht "<aktuelle Stunde>:59:59" <br>
|
||||||
<b>previous_hour_begin</b> : entspricht "<vorherige Stunde>:00:00" <br>
|
<b>previous_hour_begin</b> : entspricht "<vorherige Stunde>:00:00" <br>
|
||||||
@ -16990,6 +17038,8 @@ sub bdump {
|
|||||||
<b>current_day_end</b> : entspricht "<aktueller Tag> 23:59:59" <br>
|
<b>current_day_end</b> : entspricht "<aktueller Tag> 23:59:59" <br>
|
||||||
<b>previous_day_begin</b> : entspricht "<Vortag> 00:00:00" <br>
|
<b>previous_day_begin</b> : entspricht "<Vortag> 00:00:00" <br>
|
||||||
<b>previous_day_end</b> : entspricht "<Vortag> 23:59:59" <br>
|
<b>previous_day_end</b> : entspricht "<Vortag> 23:59:59" <br>
|
||||||
|
<b>next_day_begin</b> : entspricht "<nächster Tag> 00:00:00" <br>
|
||||||
|
<b>next_day_end</b> : entspricht "<nächster Tag> 23:59:59" <br>
|
||||||
<b>current_hour_begin</b> : entspricht "<aktuelle Stunde>:00:00" <br>
|
<b>current_hour_begin</b> : entspricht "<aktuelle Stunde>:00:00" <br>
|
||||||
<b>current_hour_end</b> : entspricht "<aktuelle Stunde>:59:59" <br>
|
<b>current_hour_end</b> : entspricht "<aktuelle Stunde>:59:59" <br>
|
||||||
<b>previous_hour_begin</b> : entspricht "<vorherige Stunde>:00:00" <br>
|
<b>previous_hour_begin</b> : entspricht "<vorherige Stunde>:00:00" <br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user