Page 1 of 1
Python Framework 'Error message': Reference Count not correct, expected
Posted: Wednesday 01 September 2021 9:55
by pipiche
Since recent version of Domoticz, I'm getting this error message when stoping my python plugin .
What does that mean ? what should I do to correct it ?
Code: Select all
52:02 rasp domoticz[31474]: 2021-09-01 09:52:02.250 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - COSensor-EM_Smoke-000d6f0014f6b5d2-01' Reference Count not correct, expected 1 found 2.
Sep 01 09:52:02 rasp domoticz[31474]: 2021-09-01 09:52:02.250 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - lumi.sensor_switch.aq3_SwitchAQ3-00158d0002b06615-01' Reference Count not correct, expected 1 found 2.
Sep 01 09:52:02 rasp domoticz[31474]: 2021-09-01 09:52:02.250 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - lumi.sensor_switch.aq2_SwitchAQ2-00158d00023e7918-01' Reference Count not correct, expected 1 found 2.
Sep 01 09:52:02 rasp domoticz[31474]: 2021-09-01 09:52:02.250 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Shutter switch with neutral_Venetian-00047400008aff8b-01' Reference Count not correct, expected 1 found 2.
Sep 01 09:52:02 rasp domoticz[31474]: 2021-09-01 09:52:02.250 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Micromodule switch_Switch-00047400001f09a4-01' Reference Count not correct, expected 1 found 2.
Sep 01 09:52:02 rasp domoticz[31474]: 2021-09-01 09:52:02.250 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Dimmer switch wo neutral_LvlControl-000474000082a54f-01' Reference Count not correct, expected 1 found 2.
Re: Python Framework 'Error message': Reference Count not correct, expected
Posted: Tuesday 14 September 2021 14:25
by pipiche
Still having this message with a recent Domoticz version 2021.1 Build 13495 !
Anything I should worry ?
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.743 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Zigate Status 9' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.743 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Zigate Notifications 9' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.743 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - TRADFRI Signal Repeater_Voltage-680ae2fffe7aca89-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.743 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - TRADFRI remote control_Ikea_Round_5b-90fd9ffffeea89e8-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.744 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - lumi.remote.b286opcn01_AqaraOppleMiddle-04cf8cdf3c77d06a-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.744 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - lumi.remote.b286opcn01_AqaraOppleMiddle-04cf8cdf3c77d06a-02' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.744 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - lumi.sensor_switch.aq2_SwitchAQ2-00158d00023e7918-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.744 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - COSensor-EM_Smoke-000d6f0014f6b5d2-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.744 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - TH01_Temp+Hum-00124b0022e9785a-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.744 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - TH01_Temp-00124b0022e9785a-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.744 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - TH01_Humi-00124b0022e9785a-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.744 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - lumi.remote.b486opcn01_AqaraOppleMiddle-04cf8cdf3c77c899-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.745 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - lumi.remote.b486opcn01_AqaraOppleMiddle-04cf8cdf3c77c899-02' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.745 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - lumi.remote.b486opcn01_AqaraOppleMiddle-04cf8cdf3c77c899-03' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.745 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - lumi.remote.b486opcn01_AqaraOppleMiddle-04cf8cdf3c77c899-04' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.745 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - ColorControlWW-90fd9ffffe86c7a1-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.745 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Zigate Group 0000' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.745 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Zigate Group 7c42' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.745 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - LXEK-1_ColorControlRGBWW-60a423fffe529d60-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.745 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Micromodule switch_Switch-00047400001f09a4-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.746 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Shutter switch with neutral_Venetian-00047400008aff8b-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.746 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Dimmer switch wo neutral_LvlControl-000474000082a54f-01' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.746 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Zigate Group fff6' Reference Count not correct, expected 1 found 2.
Sep 14 13:49:00 rasp domoticz[16008]: 2021-09-14 13:49:00.746 Error: ZiGate-V2: Stop: Device 'ZiGate-V2 - Zigate Group fff4' Reference Count not correct, expected 1 found 2.
Re: Python Framework 'Error message': Reference Count not correct, expected
Posted: Monday 27 December 2021 10:39
by Masure
Same with one of my plugin, I'm subscribing

Re: Python Framework 'Error message': Reference Count not correct, expected
Posted: Saturday 19 August 2023 6:58
by EscApe
Has this ever been solved? I have the same problem in 2023.2.
Spend hours trying to find the cause in my own plugin, but after creating a completely empty test-setup from official Docker image (now build 15503). I even get this error in a very simple test plugin (code below).
Code: Select all
"""
<plugin key="testthing" name="Python Plugin Tester">
<description>
<h2>Test Python plugin framework</h2><br/>
</description>
</plugin>
"""
import DomoticzEx
class BasePlugin:
def __init__(self):
print("Initializing plugin tester")
def onStart(self):
if not "deviceA" in Devices:
DomoticzEx.Unit("First Device", Unit=1, DeviceID="deviceA", TypeName="Switch", Used=1).Create()
if not "deviceB" in Devices:
DomoticzEx.Unit("Second Device", Unit=5, DeviceID="deviceB", TypeName="Switch", Used=1).Create()
DomoticzEx.Log("<<<<< onstart completed >>>>>")
def onStop(self):
DomoticzEx.Log("<<<<<<onstop>>>>>>")
for d in Devices:
DomoticzEx.Status('>> ' + str(d))
DomoticzEx.Log("<<<<<<onstop completed>>>>>>")
global _plugin
_plugin = BasePlugin()
def onStart():
global _plugin
_plugin.onStart()
def onStop():
global _plugin
_plugin.onStop()
Re: Python Framework 'Error message': Reference Count not correct, expected
Posted: Friday 15 September 2023 18:56
by pipiche
The problem is in the DomoticZ code not in the login itself.
Until we have someone able to find and fix the code, we will get this during the stop of the plugin
Re: Python Framework 'Error message': Reference Count not correct, expected
Posted: Friday 03 November 2023 14:04
by rezzalex
Hello,
does anyone know if there is an open ticket/issue in DZ Github ?
currently, is this error message caused something or anything?
Because I have trouble with one of my plugins and would like to get rid of this possibility
Re: Python Framework 'Error message': Reference Count not correct, expected
Posted: Monday 27 November 2023 17:48
by meal
Hello
I have the same issue with domoticz version 2023.2.
See my subject "Stop: Device 'XXX' Reference Count not correct, expected 1" posted on 27/11/2023 in the forum.
May be a missing decrementation of the pDevice reference count in the Cplugin::Start method.
@pipiche : did you investigate the point on your side.
BR
Re: Python Framework 'Error message': Reference Count not correct, expected
Posted: Sunday 14 January 2024 21:49
by madpatrick
Version: 2023.2 (build 15457)
Build Hash: 25624ca14
Compile Date: 2023-07-22 10:39:06
dzVents Version: 3.1.8
Python Version: 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
i've the same error in the logs now.
It started with 1 plugin, but now all plugins are giving this error.
Code: Select all
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Status' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Line voltage' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Load percentage' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Battery charge level' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Model' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Serial Number' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Battery voltage' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Nominal battery voltage' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Battery date' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Date of last self test' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Reason for last transfer to battery' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Nominal UPS power output' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Time left on battery' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Number of transfers to battery' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Time on battery' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.217 Error: APC UPS: Stop: Device 'APC UPS - Cumulative time on battery' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Woonkamer Temp Toon' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Toon Thermostaat' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Toon - Auto Program' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Toon - Scene' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Keteldruk' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Toon - Program info' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'P1 Gas' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Toon - Electricity' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Toon - Generated Electricity' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'P1 Elektra' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Ketelstand' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'ModulationLevel' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Ketel Setpoint' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.421 Error: Toon: Stop: Device 'Toon - Luchtvochtigheid' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Mileage' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Doors' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Windows' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Remain mileage (fuel)' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Remain mileage (elec)' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Charging' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Charging time' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Battery Level' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Remote Services' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Car' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Mileage (Day)' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Driving' Reference Count not correct, expected 1 found 2.
2024-01-14 19:47:27.525 Error: BMW: Stop: Device 'BMW - Home' Reference Count not correct, expected 1 found 2.
Somebody any idea how to fix this ?
Re: Python Framework 'Error message': Reference Count not correct, expected
Posted: Monday 15 January 2024 6:58
by meal
Hello,
I had the same issue when running domoticz version 2023.2.
A couple of python plugins issues have been fixed in that version.
I do not have the issue since upgrading to domoticz version 2024.1
Try to upgrade to 2024.1 and first make a system backup prior to it.
BR
Re: Python Framework 'Error message': Reference Count not correct, expected
Posted: Tuesday 16 January 2024 21:30
by madpatrick
meal wrote: Monday 15 January 2024 6:58
Hello,
I had the same issue when running domoticz version 2023.2.
A couple of python plugins issues have been fixed in that version.
I do not have the issue since upgrading to domoticz version 2024.1
Try to upgrade to 2024.1 and first make a system backup prior to it.
BR
Thanks.
I just upgraded to 2024.2 stable and i don't see there errors
Fingers crossed
