Page 1 of 1
Counter Looped detected: what's wrong
Posted: Saturday 29 November 2025 14:53
by Doler
Updated from version 2025.2 (build 16922) to version 2025.2 (build 16954) and found next status in the log:
Code: Select all
Status: ZWave-AD: Counter Looped detected on first received value for: PN1 (PN1_electric_kwh_value)/zwavejs2mqtt_0xfe88fc1e_8-50-0-value-65537, could be an old retained value?
This status is repeatedly reported for every zwave module with an electric_kwh_value device (even though the devics are unused) and thus flooding the log.
Can somebody help me to explain what the cause of this is and how to prevent it?
Re: Counter Looped detected: what's wrong
Posted: Saturday 29 November 2025 17:25
by HvdW
The error ZWave-AD: Counter Looped detected for your energy meter (PN1) usually means:
Cause
- The meter value rolled over (e.g., exceeded 65535 and reset to 0 or 65537).
- An old retained MQTT value was republished.
- A Z-Wave communication glitch.
Possible Fix
1. Clear retained MQTT messages for the topic:
Code: Select all
mosquitto_pub -h [broker_ip] -t "zwavejs2mqtt/0xfe88fc1e/8/50/0/value" -r -n
2. Reset the meter or reinclude it in your Z-Wave network.
3. Check for firmware updates for the meter or Z-Wave controller.
Re: Counter Looped detected: what's wrong
Posted: Saturday 29 November 2025 23:51
by commentator
same problem here since update.
Only in Domoticz it is an issue. No problems in HA
Re: Counter Looped detected: what's wrong
Posted: Monday 01 December 2025 16:54
by waltervl
It is only a remark Domoticz found a possible incorrect value and ignoring it. You can also ignore it.
From the code (implemented last week):
https://github.com/domoticz/domoticz/bl ... .cpp#L2173
Code: Select all
//There could be an anoying situation with MQTT retained messages
//If a user enabled a retained message, and later sends a new value not-retained,
//the retained message is still here, and contains a old value.
//So if we detect a loop on the first message, we ignore the previous value
Log(LOG_STATUS, "Counter Looped detected on first received value for: %s/%s, could be an old retained value?", pSensor->name.c_str(), pSensor->unique_id.c_str());
If you do not want to ignore it check your MQTT retained messages for this sensor and delete them. See wiki page
https://wiki.domoticz.com/MQTT#Delete_retained_topic
If you do not have retained messages then something else is wrong.
Re: Counter Looped detected: what's wrong
Posted: Wednesday 10 December 2025 15:23
by Doler
Sorry for the late answer but I've been hospitalized so couldn't try things out. I'm getting better now but not this problem.
I checked for retained values: there are none. To be sure I deleted all value messages using MQTT Explorer, log messages keep coming.
I excluded/included one of the error devices (Neo Powerswitch) but result remains the same.
My Z-Stick 7 has the latest firmware, Zwave JS UI is on latest release/version.
Ignoring is impossible since the log messages keep coming at every poll interval.
What can I do/check next?
Regards, Mark
Re: Counter Looped detected: what's wrong
Posted: Wednesday 10 December 2025 21:40
by waltervl
Copy and paste here a history list of those counter values from MQTT explorer around the time you get that counter loop status message in the log.
Re: Counter Looped detected: what's wrong
Posted: Thursday 11 December 2025 8:29
by gizmocuz
If you get it on every poll, what is the actual status value ? (0)?
zwavejs2mqtt/0xfe88fc1e/8/50/0/value
(You can use MQTT Explorer to find this)
Re: Counter Looped detected: what's wrong
Posted: Thursday 11 December 2025 10:49
by Doler
I analyzed/tested things last night and this morning: I get (got) the log messages at every poll with the actual value being 0. As soon as the accumulted value is non-zero, the message no longer appears.
So I made sure that the 'faulty' devices had a non-zero kWh value and I have a clean log now. Makes me wonder though what would happen with new devices?
Thanks for the support,
Mark
Re: Counter Looped detected: what's wrong
Posted: Thursday 11 December 2025 16:07
by gizmocuz
With new devices you would see this status message until it increases...
Is it your own MQTT/Device? Why does the counter not increase at the device point? Nothing connected?
We could silence this warning when it is 0.... maybe that is better
Re: Counter Looped detected: what's wrong
Posted: Thursday 11 December 2025 20:59
by Doler
This happened at regular z-wave devices but indeed not connected or connected device not used (yet). Silence the warning would be a good idea to prevent future concerns.
Grtz, Mark