diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 67d210e83..1a68f7c98 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -3,6 +3,7 @@ * Change command PulseTime JSON message format and allow display of all pulsetimer information (#6519) * Add support for Chint DDSU666 Modbus energy meter by Pablo Zerón * Add support for SM2135 as used in Action LSC Smart Led E14 (#6495) + * Add command SetOption72 0/1 to switch between software (0) or hardware (1) energy total counter (#6561) * * 6.6.0.14 20190925 * Change command Tariffx to allow time entries like 23 (hours), 1320 (minutes) or 23:00. NOTE: As this is development branch previous tariffs are lost! (#6488) diff --git a/sonoff/xdrv_03_energy.ino b/sonoff/xdrv_03_energy.ino index 2dec233f3..af51682a5 100644 --- a/sonoff/xdrv_03_energy.ino +++ b/sonoff/xdrv_03_energy.ino @@ -199,7 +199,7 @@ void EnergyUpdateTotal(float value, bool kwh) Energy.kWhtoday = (unsigned long)((value - Energy.start_energy) * multiplier); } - if (Energy.total < (value - 0.01) && Settings.flag3.hardware_energy_total){ // We subtract a little offset to avoid continuous updates + if ((Energy.total < (value - 0.01)) && Settings.flag3.hardware_energy_total) { // We subtract a little offset to avoid continuous updates RtcSettings.energy_kWhtotal = (unsigned long)((value * multiplier) - Energy.kWhtoday_offset - Energy.kWhtoday); Settings.energy_kWhtotal = RtcSettings.energy_kWhtotal; Energy.total = (float)(RtcSettings.energy_kWhtotal + Energy.kWhtoday_offset + Energy.kWhtoday) / 100000;