diff --git a/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino b/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino index 5cb7fbb468ec..baec24922247 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino @@ -407,7 +407,7 @@ void Energy200ms(void) { } bool midnight = (LocalTime() == Midnight()); - if ((midnight || RtcTime.day_of_year > Settings->energy_kWhdoy) && TasmotaGlobal.uptime > 10) { + if ((midnight || RtcTime.day_of_year != Settings->energy_kWhdoy) && TasmotaGlobal.uptime > 10) { Energy->kWhtoday_offset_init = true; Settings->energy_kWhdoy = RtcTime.day_of_year; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino index 9fd4a0c47cb1..a30880199a18 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino @@ -663,7 +663,7 @@ void Energy200ms(void) { } bool midnight = (LocalTime() == Midnight()); - if ((midnight || RtcTime.day_of_year > Energy->Settings.energy_kWhdoy) && TasmotaGlobal.uptime > 10) { + if ((midnight || RtcTime.day_of_year != Energy->Settings.energy_kWhdoy) && TasmotaGlobal.uptime > 10) { Energy->kWhtoday_offset_init = true; Energy->Settings.energy_kWhdoy = RtcTime.day_of_year;