mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-13 05:06:35 +00:00
93_DbRep: V5.6.2, commandref revised
git-svn-id: https://svn.fhem.de/fhem/trunk@14973 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4bbf703985
commit
33659eaa97
@ -1,5 +1,6 @@
|
||||
# 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.
|
||||
- bugfix: 93_DbRep: V5.6.2, commandref revised
|
||||
- feature: 00_MQTT: OnMessageFn, last-will, onConnect/onDisconnect
|
||||
- feature: 10_MQTT_DEVICE: improved publishSet, retain, subscribeReadings
|
||||
- feature: 10_MQTT_BRIDGE: improved retain, subscribeSet
|
||||
|
@ -37,6 +37,7 @@
|
||||
###########################################################################################################################
|
||||
# Versions History:
|
||||
#
|
||||
# 5.6.2 28.08.2017 commandref revised
|
||||
# 5.6.1 18.07.2017 commandref revised, minor fixes
|
||||
# 5.6.0 17.07.2017 default timeout changed to 86400, new get-command "procinfo" (MySQL)
|
||||
# 5.5.2 16.07.2017 dbmeta_DoParse -> show variables (no global)
|
||||
@ -231,7 +232,7 @@ use Encode qw(encode_utf8);
|
||||
|
||||
sub DbRep_Main($$;$);
|
||||
|
||||
my $DbRepVersion = "5.6.1";
|
||||
my $DbRepVersion = "5.6.2";
|
||||
|
||||
my %dbrep_col = ("DEVICE" => 64,
|
||||
"TYPE" => 64,
|
||||
@ -6472,29 +6473,38 @@ sub bdump {
|
||||
(*) The format of timestamp is as used with DbLog "YYYY-MM-DD HH:MM:SS". For the attributes "timestamp_begin", "timestamp_end"
|
||||
you can also use one of the following entries. The timestamp-attribute will be dynamically set to: <br><br>
|
||||
<ul>
|
||||
<b>current_year_begin</b> : "<current year>-01-01 00:00:00" <br>
|
||||
<b>current_year_end</b> : "<current year>-12-31 23:59:59" <br>
|
||||
<b>previous_year_begin</b> : "<previous year>-01-01 00:00:00" <br>
|
||||
<b>previous_year_end</b> : "<previous year>-12-31 23:59:59" <br>
|
||||
<b>current_month_begin</b> : "<current month first day> 00:00:00" <br>
|
||||
<b>current_month_end</b> : "<current month last day> 23:59:59" <br>
|
||||
<b>previous_month_begin</b> : "<previous month first day> 00:00:00" <br>
|
||||
<b>previous_month_end</b> : "<previous month last day> 23:59:59" <br>
|
||||
<b>current_week_begin</b> : "<first day of current week> 00:00:00" <br>
|
||||
<b>current_week_end</b> : "<last day of current week> 23:59:59" <br>
|
||||
<b>previous_week_begin</b> : "<first day of previous week> 00:00:00" <br>
|
||||
<b>previous_week_end</b> : "<last day of previous week> 23:59:59" <br>
|
||||
<b>current_day_begin</b> : "<current day> 00:00:00" <br>
|
||||
<b>current_day_end</b> : "<current day> 23:59:59" <br>
|
||||
<b>previous_day_begin</b> : "<previous day> 00:00:00" <br>
|
||||
<b>previous_day_end</b> : "<previous day> 23:59:59" <br>
|
||||
<b>current_hour_begin</b> : "<current hour>:00:00" <br>
|
||||
<b>current_hour_end</b> : "<current hour>:59:59" <br>
|
||||
<b>previous_hour_begin</b> : "<previous hour>:00:00" <br>
|
||||
<b>previous_hour_end</b> : "<previous hour>:59:59" <br> </ul><br>
|
||||
<b>current_year_begin</b> : matches "<current year>-01-01 00:00:00" <br>
|
||||
<b>current_year_end</b> : matches "<current year>-12-31 23:59:59" <br>
|
||||
<b>previous_year_begin</b> : matches "<previous year>-01-01 00:00:00" <br>
|
||||
<b>previous_year_end</b> : matches "<previous year>-12-31 23:59:59" <br>
|
||||
<b>current_month_begin</b> : matches "<current month first day> 00:00:00" <br>
|
||||
<b>current_month_end</b> : matches "<current month last day> 23:59:59" <br>
|
||||
<b>previous_month_begin</b> : matches "<previous month first day> 00:00:00" <br>
|
||||
<b>previous_month_end</b> : matches "<previous month last day> 23:59:59" <br>
|
||||
<b>current_week_begin</b> : matches "<first day of current week> 00:00:00" <br>
|
||||
<b>current_week_end</b> : matches "<last day of current week> 23:59:59" <br>
|
||||
<b>previous_week_begin</b> : matches "<first day of previous week> 00:00:00" <br>
|
||||
<b>previous_week_end</b> : matches "<last day of previous week> 23:59:59" <br>
|
||||
<b>current_day_begin</b> : matches "<current day> 00:00:00" <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_end</b> : matches "<previous day> 23:59:59" <br>
|
||||
<b>current_hour_begin</b> : matches "<current hour>:00:00" <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_end</b> : matches "<previous hour>:59:59" <br> </ul><br>
|
||||
|
||||
Make sure that "timestamp_begin" < "timestamp_end" is fulfilled. <br><br>
|
||||
|
||||
<ul>
|
||||
<b>Example:</b> <br><br>
|
||||
attr <DbRep-device> timestamp_begin current_year_begin <br>
|
||||
attr <DbRep-device> timestamp_end current_year_end <br><br>
|
||||
|
||||
# Analyzes the database between the time limits of the current year. <br>
|
||||
</ul>
|
||||
<br><br>
|
||||
|
||||
<b>Note </b> <br>
|
||||
|
||||
If the attribute "timeDiffToNow" will be set, the attributes "timestamp_begin" respectively "timestamp_end" will be deleted if they were set before.
|
||||
@ -6520,7 +6530,7 @@ sub bdump {
|
||||
called by the interface in your 99_myUtls.pm as shown in by the example: <br>
|
||||
|
||||
<pre>
|
||||
sub UserExitFn {
|
||||
sub UserFunction {
|
||||
my ($name,$reading,$value) = @_;
|
||||
my $hash = $defs{$name};
|
||||
...
|
||||
@ -6548,7 +6558,7 @@ sub bdump {
|
||||
For further processing following parameters will be forwarded to the function: <br><br>
|
||||
|
||||
<ul>
|
||||
<li>$hash - the hash of the DbRep-Device </li>
|
||||
<li>$name - the name of the DbRep-Device </li>
|
||||
<li>$reading - the name of the created reading </li>
|
||||
<li>$value - the value of the reading </li>
|
||||
|
||||
@ -7404,30 +7414,39 @@ sub bdump {
|
||||
(*) Das Format von Timestamp ist wie in DbLog "YYYY-MM-DD HH:MM:SS". Für die Attribute "timestamp_begin", "timestamp_end"
|
||||
kann ebenso eine der folgenden Eingaben verwendet werden. Dabei wird das timestamp-Attribut dynamisch belegt: <br><br>
|
||||
<ul>
|
||||
<b>current_year_begin</b> : "<aktuelles Jahr>-01-01 00:00:00" <br>
|
||||
<b>current_year_end</b> : "<aktuelles Jahr>-12-31 23:59:59" <br>
|
||||
<b>previous_year_begin</b> : "<vorheriges Jahr>-01-01 00:00:00" <br>
|
||||
<b>previous_year_end</b> : "<vorheriges Jahr>-12-31 23:59:59" <br>
|
||||
<b>current_month_begin</b> : "<aktueller Monat erster Tag> 00:00:00" <br>
|
||||
<b>current_month_end</b> : "<aktueller Monat letzter Tag> 23:59:59" <br>
|
||||
<b>previous_month_begin</b> : "<Vormonat erster Tag> 00:00:00" <br>
|
||||
<b>previous_month_end</b> : "<Vormonat letzter Tag> 23:59:59" <br>
|
||||
<b>current_week_begin</b> : "<erster Tag der akt. Woche> 00:00:00" <br>
|
||||
<b>current_week_end</b> : "<letzter Tag der akt. Woche> 23:59:59" <br>
|
||||
<b>previous_week_begin</b> : "<erster Tag Vorwoche> 00:00:00" <br>
|
||||
<b>previous_week_end</b> : "<letzter Tag Vorwoche> 23:59:59" <br>
|
||||
<b>current_day_begin</b> : "<aktueller Tag> 00:00:00" <br>
|
||||
<b>current_day_end</b> : "<aktueller Tag> 23:59:59" <br>
|
||||
<b>previous_day_begin</b> : "<Vortag> 00:00:00" <br>
|
||||
<b>previous_day_end</b> : "<Vortag> 23:59:59" <br>
|
||||
<b>current_hour_begin</b> : "<aktuelle Stunde>:00:00" <br>
|
||||
<b>current_hour_end</b> : "<aktuelle Stunde>:59:59" <br>
|
||||
<b>previous_hour_begin</b> : "<vorherige Stunde>:00:00" <br>
|
||||
<b>previous_hour_end</b> : "<vorherige Stunde>:59:59" <br>
|
||||
<b>current_year_begin</b> : entspricht "<aktuelles Jahr>-01-01 00:00:00" <br>
|
||||
<b>current_year_end</b> : entspricht "<aktuelles Jahr>-12-31 23:59:59" <br>
|
||||
<b>previous_year_begin</b> : entspricht "<vorheriges Jahr>-01-01 00:00:00" <br>
|
||||
<b>previous_year_end</b> : entspricht "<vorheriges Jahr>-12-31 23:59:59" <br>
|
||||
<b>current_month_begin</b> : entspricht "<aktueller Monat erster Tag> 00:00:00" <br>
|
||||
<b>current_month_end</b> : entspricht "<aktueller Monat letzter Tag> 23:59:59" <br>
|
||||
<b>previous_month_begin</b> : entspricht "<Vormonat erster Tag> 00:00:00" <br>
|
||||
<b>previous_month_end</b> : entspricht "<Vormonat letzter Tag> 23:59:59" <br>
|
||||
<b>current_week_begin</b> : entspricht "<erster Tag der akt. Woche> 00:00:00" <br>
|
||||
<b>current_week_end</b> : entspricht "<letzter Tag der akt. Woche> 23:59:59" <br>
|
||||
<b>previous_week_begin</b> : entspricht "<erster Tag Vorwoche> 00:00:00" <br>
|
||||
<b>previous_week_end</b> : entspricht "<letzter Tag Vorwoche> 23:59:59" <br>
|
||||
<b>current_day_begin</b> : entspricht "<aktueller Tag> 00:00:00" <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_end</b> : entspricht "<Vortag> 23:59:59" <br>
|
||||
<b>current_hour_begin</b> : entspricht "<aktuelle Stunde>:00:00" <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_end</b> : entspricht "<vorherige Stunde>:59:59" <br>
|
||||
</ul><br>
|
||||
|
||||
Natürlich sollte man immer darauf achten dass "timestamp_begin" < "timestamp_end" ist. <br><br>
|
||||
|
||||
<ul>
|
||||
<b>Beispiel:</b> <br><br>
|
||||
attr <DbRep-device> timestamp_begin current_year_begin <br>
|
||||
attr <DbRep-device> timestamp_end current_year_end <br><br>
|
||||
|
||||
# Wertet die Datenbank in den Zeitgrenzen des aktuellen Jahres aus. <br>
|
||||
</ul>
|
||||
<br><br>
|
||||
|
||||
<b>Hinweis </b> <br>
|
||||
|
||||
Wird das Attribut "timeDiffToNow" gesetzt, werden die evtentuell gesetzten Attribute "timestamp_begin" bzw. "timestamp_end" gelöscht.
|
||||
@ -7452,7 +7471,7 @@ sub bdump {
|
||||
99_myUtls.pm nach folgendem Muster erstellt: <br>
|
||||
|
||||
<pre>
|
||||
sub UserExitFn {
|
||||
sub UserFunction {
|
||||
my ($name,$reading,$value) = @_;
|
||||
my $hash = $defs{$name};
|
||||
...
|
||||
@ -7481,7 +7500,7 @@ sub bdump {
|
||||
Zur Weiterverarbeitung werden der aufgerufenenen Funktion folgende Variablen übergeben: <br><br>
|
||||
|
||||
<ul>
|
||||
<li>$hash - der Hash des DbRep-Devices </li>
|
||||
<li>$name - der Name des DbRep-Devices </li>
|
||||
<li>$reading - der Namen des erstellen Readings </li>
|
||||
<li>$value - der Wert des Readings </li>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user