From 436cf830b9b5690d3f41a122160352c5106d87cf Mon Sep 17 00:00:00 2001 From: Andre Thomas <470015+andrethomas@users.noreply.github.com> Date: Sat, 28 Dec 2019 16:49:57 +0200 Subject: [PATCH] Add support for resetting counters on tele_period Add support for resetting counters on tele_period if SetOption78 is enabled. --- tasmota/xsns_01_counter.ino | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasmota/xsns_01_counter.ino b/tasmota/xsns_01_counter.ino index 8ed615c86..c664ff811 100644 --- a/tasmota/xsns_01_counter.ino +++ b/tasmota/xsns_01_counter.ino @@ -150,6 +150,9 @@ void CounterShow(bool json) ResponseAppend_P(PSTR(",\"COUNTER\":{")); } ResponseAppend_P(PSTR("%s\"C%d\":%s"), (header)?",":"", i +1, counter); + if ((0 == tele_period ) && (Settings.flag3.counter_reset_on_tele)) { + RtcSettings.pulse_counter[i] = 0; + } header = true; #ifdef USE_DOMOTICZ if ((0 == tele_period) && (1 == dsxflg)) {