Init Energy Total on energy monitoring devices with Energy Total Register

Init Energy Total on energy monitoring devices with Energy Total Register (#6282)
This commit is contained in:
Theo Arends 2019-09-03 21:56:17 +02:00
parent b3562e030e
commit 8e4dd169f3
1 changed files with 1 additions and 0 deletions

View File

@ -154,6 +154,7 @@ void EnergyUpdateTotal(float value, bool kwh)
Energy.start_energy = value; // Init after restart and handle roll-over if any
RtcSettings.energy_kWhtotal = (unsigned long)(value * multiplier);
Energy.kWhtoday = 0;
RtcSettings.energy_kWhtoday = 0;
}
else if (value != Energy.start_energy) {
Energy.kWhtoday += (unsigned long)((value - Energy.start_energy) * multiplier);