zigbeefordomoticz / Domoticz-Zigbee

Zigbee plugin for Domoticz. Allow to connect various zigbee controllers like Zigate but also Texas Instrument CC2531, CC13x2, CC26x2 ; Silicon-Labs; deConz based chipset to be connected to Domoticz
GNU General Public License v3.0
99 stars 43 forks source link

3.0.0 or beta-3.1.0 / Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''. #229

Closed lboue closed 5 years ago

lboue commented 5 years ago

Describe the bug I tried to upgrade Domoticz-Zigate plugin versions Version 3.0.0 and beta-3.1.0. I have Domoticz V4.10059.

I had no error with the previous 2.3.3 plugin version.

I am getting many time the following error: 2018-10-11 20:12:22.413 Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.

To Reproduce Steps to reproduce the behavior:

  1. Install Domoticz V4.100
  2. Install Domoticz-Zigate plugin beta-3.1.0 or 3.0.0
  3. Start Domoticz service
  4. See error

2018-10-11 20:12:22.413 Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.

Expected behavior No error.

Screenshots

cd domoticz/plugins/
cd Domoticz-Zigate/
mv Domoticz-Zigate/ /tmp/
wget https://github.com/sasu-drooz/Domoticz-Zigate/archive/beta-3.1.0.zip
unzip beta-3.1.0.zip 

pi@raspberrypi:~/domoticz $ sudo service domoticz restart

sudo tailf /tmp/domoticz.txt
2018-10-11 20:12:01.561  Status: Domoticz V4.10059 (c)2012-2018 GizMoCuz
2018-10-11 20:12:01.561  Status: Build Hash: 06741959, Date: 2018-10-11 08:59:01
2018-10-11 20:12:01.562  Status: Startup Path: /home/pi/domoticz/
2018-10-11 20:12:01.603  Sunrise: 08:16:00 SunSet: 19:23:00
2018-10-11 20:12:01.603  Day length: 11:08:00 Sun at south: 13:05:00
2018-10-11 20:12:01.603  Civil twilight start: 07:45:00 Civil twilight end: 19:54:00
2018-10-11 20:12:01.603  Nautical twilight start: 07:09:00 Nautical twilight end: 20:30:00
2018-10-11 20:12:01.603  Astronomical twilight start: 06:34:00 Astronomical twilight end: 21:05:00
2018-10-11 20:12:01.603  Status: EventSystem: reset all events...
2018-10-11 20:12:01.781  Status: PluginSystem: Started, Python version '3.5.3'.
2018-10-11 20:12:01.792  Active notification Subsystems: email, pushover (2/13)
2018-10-11 20:12:01.794  Status: WebServer(HTTP) started on address: :: with port 8080
2018-10-11 20:12:01.806  Status: WebServer(SSL) started on address: :: with port 8443
2018-10-11 20:12:01.809  Status: Proxymanager started.
2018-10-11 20:12:01.880  Starting shared server on: :::6144
2018-10-11 20:12:01.881  Status: TCPServer: shared server started...
2018-10-11 20:12:01.881  Status: RxQueue: queue worker started...
2018-10-11 20:12:03.246  Status: PROXY: Authenticate result: success.
2018-10-11 20:12:03.882  Status: Wunderground: Worker started...
2018-10-11 20:12:03.883  Status: XiaomiGateway (ID=10): Delaying worker startup...
2018-10-11 20:12:08.883  Status: XiaomiGateway (ID=10): Selected as main Gateway
2018-10-11 20:12:08.884  Status: XiaomiGateway (ID=10): Worker started...
2018-10-11 20:12:08.884  Status: (Zigate) Started.
2018-10-11 20:12:08.884  Status: Netatmo: Worker started...
2018-10-11 20:12:08.885  Status: (Pots_Fleurs) Started.
2018-10-11 20:12:08.886  Status: (ECO-DEVICES): Worker started...
2018-10-11 20:12:08.886  Status: EventSystem: reset all events...
2018-10-11 20:12:08.887  Status: EventSystem: reset all device statuses...
2018-10-11 20:12:09.106  Status: PluginSystem: Entering work loop.
2018-10-11 20:12:09.174  Status: Python EventSystem: Initalizing event module.
2018-10-11 20:12:09.180  Status: EventSystem: Started
2018-10-11 20:12:09.181  Status: EventSystem: Queue thread started...
2018-10-11 20:12:09.397  Status: (Zigate) Entering work loop.
2018-10-11 20:12:09.397  Status: (Zigate) Initialized version 3.9.99999, author 'zaraki673  pipiche38'
2018-10-11 20:12:09.624  Status: (Pots_Fleurs) Entering work loop.
2018-10-11 20:12:09.624  Status: (Pots_Fleurs) Initialized version 1.0.0, author 'blauwebuis'
2018-10-11 20:12:09.628  Status: (Zigate) onStart called - Zigate plugin V 3.9.999 (dev branch)
2018-10-11 20:12:09.633  Status: (Zigate) Zigate Structure V2
2018-10-11 20:12:09.633  Error: (Zigate) 'onStart' failed 'ValueError':'invalid literal for int() with base 10: 'Debug''.
2018-10-11 20:12:09.633  Error: (Zigate) ----> Line 302 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onStart
2018-10-11 20:12:09.633  Error: (Zigate) ----> Line 75 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onStart
2018-10-11 20:12:22.413  Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.
2018-10-11 20:12:22.413  Error: (Zigate) ----> Line 330 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:12:22.413  Error: (Zigate) ----> Line 291 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:12:23.207  Status: Incoming connection from: 192.168.1.59
2018-10-11 20:12:32.383  Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.
2018-10-11 20:12:32.383  Error: (Zigate) ----> Line 330 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:12:32.384  Error: (Zigate) ----> Line 291 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:12:39.162  Status: Incoming connection from: 127.0.0.1
2018-10-11 20:12:42.354  Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.
2018-10-11 20:12:42.354  Error: (Zigate) ----> Line 330 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:12:42.354  Error: (Zigate) ----> Line 291 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:12:52.374  Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.
2018-10-11 20:12:52.375  Error: (Zigate) ----> Line 330 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:12:52.375  Error: (Zigate) ----> Line 291 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:13:02.347  Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.
2018-10-11 20:13:02.348  Error: (Zigate) ----> Line 330 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:13:02.348  Error: (Zigate) ----> Line 291 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:13:12.369  Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.
2018-10-11 20:13:12.369  Error: (Zigate) ----> Line 330 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:13:12.370  Error: (Zigate) ----> Line 291 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:13:22.388  Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.
2018-10-11 20:13:22.389  Error: (Zigate) ----> Line 330 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:13:22.389  Error: (Zigate) ----> Line 291 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:13:32.358  Error: (Zigate) 'onHeartbeat' failed 'AttributeError':''str' object has no attribute 'Connected''.
2018-10-11 20:13:32.358  Error: (Zigate) ----> Line 330 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat
2018-10-11 20:13:32.358  Error: (Zigate) ----> Line 291 in '/home/pi/domoticz/plugins/Domoticz-Zigate-beta-3.1.0/plugin.py', function onHeartbeat

Plugin (please complete the following information):

Additional context I had no error with 2.3.3 plugin version.

pipiche38 commented 5 years ago

Please do consider the Beta as unstable and make sure that you have a proper backup of the Domoticz.db and DeviceList.txt.

could you kindly cleanup the python cache after having stop domoticz service

rm Domoticz-Zigate/__pycache__/*

and then restart it.

lboue commented 5 years ago

Thanks it works fine now 👍

2018-10-11 21:23:45.267  Status: Python EventSystem: Initalizing event module.
2018-10-11 21:23:45.268  Status: EventSystem: Started
2018-10-11 21:23:45.268  Status: EventSystem: Queue thread started...
2018-10-11 21:23:45.293  Status: PluginSystem: Entering work loop.
2018-10-11 21:23:45.551  Status: (Zigate) Entering work loop.
2018-10-11 21:23:45.551  Status: (Zigate) Initialized version 3.9.99999, author 'zaraki673  pipiche38'
2018-10-11 21:23:45.788  Status: (Zigate) onStart called - Zigate plugin V 3.9.999 (dev branch)
2018-10-11 21:23:45.792  Status: (Zigate) Zigate Structure V2
2018-10-11 21:23:45.794  (Zigate) Device : [1] ID = 1e05 Options['Zigate'] = {'ProfileID': {}, 'Type': 'Switch', 'IEEE': '00158d000*******', 'RIA': '327', 'Ep': {'01': {'0006': '00', '0000': {}}}, 'Battery': 92, 'ZDeviceID': {}, 'MacCapa': '80', 'Heartbeat': '93693', 'Model': 'lumi.sensor_switch.aq2', 'Version': '2', 'Status': 'inDB'} loaded into self.ListOfDevices
2018-10-11 21:23:45.795  (Zigate) Device : [2] ID = c8cb Options['Zigate'] = {'ProfileID': {}, 'Type': 'DSwitch', 'IEEE': '00158d000*******', 'RIA': '4', 'Ep': {'02': {'0006': {}}, '01': {'0006': {}, '0000': {}}}, 'Battery': 91, 'ZDeviceID': {}, 'MacCapa': '80', 'Heartbeat': '0', 'Model': 'lumi.sensor_86sw2', 'Version': '2', 'Status': 'inDB'} loaded into self.ListOfDevices
2018-10-11 21:23:45.795  (Zigate) Device : [3] ID = c8cb Options['Zigate'] = {'ProfileID': {}, 'Type': 'DSwitch', 'IEEE': '00158d000*******', 'RIA': '4', 'Ep': {'02': {'0006': {}}, '01': {'0006': {}, '0000': {}}}, 'Battery': 91, 'ZDeviceID': {}, 'MacCapa': '80', 'Heartbeat': '0', 'Model': 'lumi.sensor_86sw2', 'Version': '2', 'Status': 'inDB'} loaded into self.ListOfDevices
2018-10-11 21:23:45.796  (Zigate) Device : [9] ID = 2791 Options['Zigate'] = {'ProfileID': {}, 'Type': 'Temp/Humi/Baro', 'IEEE': '00158d000*******', 'RIA': '1176', 'Ep': {'01': {'0402': 13.9, '0000': {}, '0405': 74.0, '0403': 'ff'}}, 'Battery': 90, 'ZDeviceID': {}, 'MacCapa': '80', 'Heartbeat': '38099', 'Model': 'lumi.weather', 'Version': '2', 'Status': 'inDB'} loaded into self.ListOfDevices
2018-10-11 21:23:45.797  (Zigate) Device : [10] ID = d25e Options['Zigate'] = {'ProfileID': {}, 'Type': 'Temp/Humi/Baro', 'IEEE': '00158d000*******', 'RIA': '21989', 'Ep': {'01': {'0402': 17.9, '0000': {}, '0405': 67.2, '0403': 'ff'}}, 'Battery': 90, 'ZDeviceID': {}, 'MacCapa': '80', 'Heartbeat': '1093087', 'Model': 'lumi.weather', 'Version': '2', 'Status': 'inDB'} loaded into self.ListOfDevices
2018-10-11 21:23:45.798  (Zigate) Device : [12] ID = d25e Options['Zigate'] = {'ProfileID': {}, 'Type': 'Temp/Humi/Baro', 'IEEE': '00158d000*******', 'RIA': '21985', 'Ep': {'01': {'0402': 18.0, '0000': {}, '0405': 66.9, '0403': 992.5}}, 'Battery': 90, 'ZDeviceID': {}, 'MacCapa': '80', 'Heartbeat': '1093087', 'Model': 'lumi.weather', 'Version': '2', 'Status': 'inDB'} loaded into self.ListOfDevices
2018-10-11 21:23:45.803  (Zigate) self.ListOfDevices[1e05][DomoID] needs to be updated with 1e05
2018-10-11 21:23:45.803  (Zigate) self.ListOfDevices[1e05][Heartbeat] needs to be updated with 7
2018-10-11 21:23:45.803  (Zigate) self.ListOfDevices[1e05][RSSI] needs to be updated with 153
2018-10-11 21:23:45.804  (Zigate) self.ListOfDevices[2791][DomoID] needs to be updated with 2791
2018-10-11 21:23:45.805  (Zigate) self.ListOfDevices[2791][Heartbeat] needs to be updated with 7
2018-10-11 21:23:45.806  (Zigate) self.ListOfDevices[d25e][DomoID] needs to be updated with d25e
2018-10-11 21:23:45.806  (Zigate) self.ListOfDevices[d25e][Heartbeat] needs to be updated with 7
2018-10-11 21:23:45.806  (Zigate) self.ListOfDevices[d25e][RSSI] needs to be updated with 165
2018-10-11 21:23:45.808  (Zigate) self.ListOfDevices[c8cb][DomoID] needs to be updated with c8cb
2018-10-11 21:23:45.808  (Zigate) self.ListOfDevices[c8cb][Heartbeat] needs to be updated with 7
2018-10-11 21:23:49.009  Status: (Zigate) onConnect called
2018-10-11 21:23:49.009  (Zigate) Connected successfully

Regards

pipiche38 commented 5 years ago

Excellent, was it the removal of pycache doing the trick ? or did you do something else ?