mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 07:16:03 +00:00
git-svn-id: https://svn.fhem.de/fhem/trunk@3035 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
5df83af260
commit
c34111c037
@ -37,6 +37,7 @@
|
|||||||
# Additional attributes are defined in fhem.cfg, in some cases per channel, where <channel>=A,B
|
# Additional attributes are defined in fhem.cfg, in some cases per channel, where <channel>=A,B
|
||||||
#
|
#
|
||||||
# attr <name> LogM <string> = device name (not file name) of monthly log file
|
# attr <name> LogM <string> = device name (not file name) of monthly log file
|
||||||
|
# attr <name> LogY <string> = device name (not file name) of yearly log file
|
||||||
# attr <name> <channel>Name <string>|<string> = name for the channel | a type description for the measured value
|
# attr <name> <channel>Name <string>|<string> = name for the channel | a type description for the measured value
|
||||||
# attr <name> <channel>Unit <string>|<string> = unit of measurement for this channel | its abbreviation
|
# attr <name> <channel>Unit <string>|<string> = unit of measurement for this channel | its abbreviation
|
||||||
# attr <name> <channel>Rate <string>|<string> = name for the channel ratw | a type description for the measured value
|
# attr <name> <channel>Rate <string>|<string> = name for the channel ratw | a type description for the measured value
|
||||||
@ -136,7 +137,7 @@ sub OWCOUNT_Initialize ($) {
|
|||||||
$hash->{SetFn} = "OWCOUNT_Set";
|
$hash->{SetFn} = "OWCOUNT_Set";
|
||||||
|
|
||||||
#-- see header for attributes
|
#-- see header for attributes
|
||||||
my $attlist = "IODev do_not_notify:0,1 showtime:0,1 model:DS2423 loglevel:0,1,2,3,4,5 LogM ".
|
my $attlist = "IODev do_not_notify:0,1 showtime:0,1 model:DS2423 loglevel:0,1,2,3,4,5 LogM LogY ".
|
||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
for( my $i=0;$i<int(@owg_fixed);$i++ ){
|
for( my $i=0;$i<int(@owg_fixed);$i++ ){
|
||||||
$attlist .= " ".$owg_fixed[$i]."Name";
|
$attlist .= " ".$owg_fixed[$i]."Name";
|
||||||
@ -501,11 +502,19 @@ sub OWCOUNT_FormatValues($) {
|
|||||||
|
|
||||||
#-- daybreak postprocessing
|
#-- daybreak postprocessing
|
||||||
if( $daybreak == 1 ){
|
if( $daybreak == 1 ){
|
||||||
my $total;
|
my ($total,$total0,$total1);
|
||||||
#-- daily/monthly accumulated value
|
#-- daily/monthly accumulated value
|
||||||
my @monthv = OWCOUNT_GetMonth($hash);
|
my @monthv = OWCOUNT_GetMonth($hash);
|
||||||
my $total0 = @monthv[0]->[1];
|
#-- error check
|
||||||
my $total1 = @monthv[1]->[1];
|
if( int(@monthv) == 2 ){
|
||||||
|
$total0 = @monthv[0]->[1];
|
||||||
|
$total1 = @monthv[1]->[1];
|
||||||
|
}else{
|
||||||
|
Log 1,"OWCOUNT: no monthly summary possible, ".@monthv[0];
|
||||||
|
$total0 = "";
|
||||||
|
$total1 = "";
|
||||||
|
};
|
||||||
|
#-- todo: put current monthly value also in day-end logging
|
||||||
$dvalue = sprintf("D%02d ",$day).$dvalue;
|
$dvalue = sprintf("D%02d ",$day).$dvalue;
|
||||||
readingsBulkUpdate($hash,"day",$dvalue);
|
readingsBulkUpdate($hash,"day",$dvalue);
|
||||||
if( $monthbreak == 1){
|
if( $monthbreak == 1){
|
||||||
@ -586,8 +595,8 @@ sub OWCOUNT_Get($@) {
|
|||||||
$value="$name.month =>\n";
|
$value="$name.month =>\n";
|
||||||
my @month2 = OWCOUNT_GetMonth($hash);
|
my @month2 = OWCOUNT_GetMonth($hash);
|
||||||
#-- error case
|
#-- error case
|
||||||
if( int(@month2) == 1 ){
|
if( int(@month2) != 2 ){
|
||||||
return $month2[0];
|
return $value." no monthly summary possible, ".$month2[0];
|
||||||
}
|
}
|
||||||
#-- 3 entries for each day
|
#-- 3 entries for each day
|
||||||
for(my $i=0;$i<int(@month2);$i++){
|
for(my $i=0;$i<int(@month2);$i++){
|
||||||
@ -721,8 +730,7 @@ sub OWCOUNT_GetMonth($) {
|
|||||||
#-- Check current logfile
|
#-- Check current logfile
|
||||||
my $ln = $attr{$name}{"LogM"};
|
my $ln = $attr{$name}{"LogM"};
|
||||||
if( !(defined($ln))){
|
if( !(defined($ln))){
|
||||||
Log 1,"OWCOUNT_GetMonth: Attribute LogM is missing";
|
return "attribute LogM is missing";
|
||||||
return undef;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-- get channel names
|
#-- get channel names
|
||||||
@ -1324,6 +1332,9 @@ sub OWXCOUNT_SetPage($$$) {
|
|||||||
<li><a name="owcount_logm"><code>attr <name> LogM
|
<li><a name="owcount_logm"><code>attr <name> LogM
|
||||||
<string>|</code></a>
|
<string>|</code></a>
|
||||||
<br />device name (not file name) of monthly log file.</li>
|
<br />device name (not file name) of monthly log file.</li>
|
||||||
|
<li><a name="owcount_logy"><code>attr <name> LogY
|
||||||
|
<string>|</code></a>
|
||||||
|
<br />device name (not file name) of yearly log file.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>For each of the following attributes, the channel identification A,B may be used.</p>
|
<p>For each of the following attributes, the channel identification A,B may be used.</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user