2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

73_ElectricityCalculator.pm: Min dt for calculation reduced from 30 to 1 s

git-svn-id: https://svn.fhem.de/fhem/trunk@16192 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Sailor 2018-02-16 18:30:13 +00:00
parent 26cf5535bd
commit d9242a94f6

View File

@ -689,8 +689,8 @@ sub ElectricityCalculator_Notify($$)
my $ElectricityCountReadingTimestampDelta = $ElectricityCountReadingTimestampCurrentRelative - $ElectricityCountReadingTimestampPreviousRelative;
Log3 $ElectricityCalcName, 5, $ElectricityCalcName. " : ElectricityCalculator - ElectricityCountReadingTimestampDelta : " . $ElectricityCountReadingTimestampDelta . " s";
### Continue with calculations only if time difference is larger than 30 seconds to avoid "Illegal division by zero" and erroneous due to small values for divisor
if ($ElectricityCountReadingTimestampDelta > 30)
### Continue with calculations only if time difference is larger than 1 seconds to avoid "Illegal division by zero" and erroneous due to small values for divisor
if ($ElectricityCountReadingTimestampDelta > 1)
{
### Calculate DW (electric Energy difference) of previous and current value / [kWh]
my $ElectricityCountReadingValueDelta = sprintf('%.3f', ($ElectricityCountReadingValueCurrent - $ElectricityCountReadingValuePrevious));