2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

38_netatmo: removed rain sum readings

git-svn-id: https://svn.fhem.de/fhem/trunk@17294 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
moises 2018-09-07 22:07:24 +00:00
parent 9fce2af1f7
commit e94cb2686b
2 changed files with 17 additions and 16 deletions

View File

@ -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.
- change: 38_netatmo: removed rain sum readings
- feature: 00_MYSENSORS: FOTA (thanks Beta-User), gateway fix (thanks Sidey) - feature: 00_MYSENSORS: FOTA (thanks Beta-User), gateway fix (thanks Sidey)
- new: 12_HProtocolGateway / 12_HProtocolTank - new: 12_HProtocolGateway / 12_HProtocolTank
- bugfix: 72_XiaomiDevice: remove unused battery readings for new fans - bugfix: 72_XiaomiDevice: remove unused battery readings for new fans

View File

@ -11,7 +11,7 @@
# #
# #
############################################################################## ##############################################################################
# Release 19 / 2018-08-14 # Release 20 / 2018-09-09
package main; package main;
@ -3407,13 +3407,13 @@ netatmo_parseReadings($$;$)
$reading = sprintf( "%.1f", $reading); $reading = sprintf( "%.1f", $reading);
} }
if($reading ne "undefined" && $rname eq "rain" && $reading > 0) # if($reading ne "undefined" && $rname eq "rain" && $reading > 0)
{ # {
my $rain_sum = ReadingsVal($name,"rain_sum",0); # my $rain_sum = ReadingsVal($name,"rain_sum",0);
$rain_sum += $reading; # $rain_sum += $reading;
readingsSingleUpdate($hash,"rain_sum",$rain_sum,1); # readingsSingleUpdate($hash,"rain_sum",$rain_sum,1);
Log3 $name, 2, $name.": summed rain ".$reading." (to ".$rain_sum.")"; # Log3 $name, 2, $name.": summed rain ".$reading." (to ".$rain_sum.")";
} # }
push(@{$readings}, [$time, $rname, $reading]) if($reading ne "undefined"); push(@{$readings}, [$time, $rname, $reading]) if($reading ne "undefined");
@ -3600,14 +3600,14 @@ netatmo_parseGlobal($$)
} }
if(defined($devicedata->{dashboard_data}{sum_rain_24})) if(defined($devicedata->{dashboard_data}{sum_rain_24}))
{ {
my $rain_day = ReadingsVal($device->{NAME},"rain_day",0); #my $rain_day = ReadingsVal($device->{NAME},"rain_day",0);
if($devicedata->{dashboard_data}{sum_rain_24} < $rain_day) # if($devicedata->{dashboard_data}{sum_rain_24} < $rain_day)
{ # {
my $rain_total = ReadingsVal($device->{NAME},"rain_total",0); # my $rain_total = ReadingsVal($device->{NAME},"rain_total",0);
$rain_total += $rain_day; # $rain_total += $rain_day;
readingsSingleUpdate($device,"rain_total",$rain_total,1); # readingsSingleUpdate($device,"rain_total",$rain_total,1);
Log3 $name, 1, $device->{NAME}.": added rain ".$rain_day." (to ".$rain_total.")"; # Log3 $name, 1, $device->{NAME}.": added rain ".$rain_day." (to ".$rain_total.")";
} # }
readingsBeginUpdate($device); readingsBeginUpdate($device);
$device->{".updateTimestamp"} = FmtDateTime($devicedata->{dashboard_data}{time_utc}); $device->{".updateTimestamp"} = FmtDateTime($devicedata->{dashboard_data}{time_utc});
readingsBulkUpdate( $device, "rain_day", $devicedata->{dashboard_data}{sum_rain_24}, 1 ); readingsBulkUpdate( $device, "rain_day", $devicedata->{dashboard_data}{sum_rain_24}, 1 );