From 4f035d18f6e3772dbb8d3337f5cba3394cf92348 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 4 Aug 2024 18:06:24 +0200 Subject: [PATCH] Fix invalid ADC energy reset --- tasmota/tasmota_xsns_sensor/xsns_02_analog.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/tasmota/tasmota_xsns_sensor/xsns_02_analog.ino b/tasmota/tasmota_xsns_sensor/xsns_02_analog.ino index b905f880f..b72e3da8f 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_02_analog.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_02_analog.ino @@ -687,6 +687,7 @@ void AdcEverySecond(void) { uint32_t voltage_phase = (voltage_count == current_count) ? phase : 0; Energy->active_power[phase] = Energy->voltage[voltage_phase] * Energy->current[phase]; // Watt Energy->kWhtoday_delta[phase] += (uint32_t)(Energy->active_power[phase] * 1000) / 36; // deca_microWh + Energy->data_valid[phase] = 0; } EnergyUpdateToday(); }