Add comment regarding rounding error

This commit is contained in:
Theo Arends 2020-08-26 16:56:40 +02:00
parent 2e63d8f671
commit 73ea5d6ef8
1 changed files with 1 additions and 1 deletions

View File

@ -205,7 +205,7 @@ void HlwEverySecond(void)
unsigned long hlw_len;
if (Hlw.energy_period_counter) {
hlw_len = 10000 * 1000 / Hlw.energy_period_counter;
hlw_len = 10000 * 1000 / Hlw.energy_period_counter; // Add *1000 to fix rounding on loads at 3.6kW (#9160)
Hlw.energy_period_counter = 0;
if (hlw_len) {
Energy.kWhtoday_delta += ((Hlw.power_ratio * Settings.energy_power_calibration) * 1000 / hlw_len) / 36;