Smanar / Domoticz-deCONZ

deCONZ plugin for Domoticz (Zigbee application)
GNU General Public License v3.0
37 stars 26 forks source link

Domoticz Crashing when deCONZ is enabled #49

Closed xxLeoxx93 closed 4 years ago

xxLeoxx93 commented 4 years ago

Hi there,

today I added a new Xiaomi Plug in Phoscon and wanted to add it in Domoticuz afterwards. However domoticz crashed, so I restarted it with the result that 30 later it crashed again. So I checked the log and it seems like once the Plugin gets loaded, Domoticz simply reashes: Last lines of my log:

2020-03-01 13:07:47.504 (ConBee2) ### Update device (Ersatz - Office Sofa Lampe Power) : {'nValue': 0, 'sValue': '6', 'TimedOut': 1}
2020-03-01 13:07:47.504 (Ersatz - Office Sofa Lampe Power) Updating device from 0:'6' to have values 0:'6'.
2020-03-01 13:07:47.508 (ConBee2) ### Device > 41 Name:Consumption 41 Type:ZHAConsumption Details:{'consumption': None, 'lastupdated': 'none'} and {'on': True, 'reachable': False, 'temperature': 2800}
2020-03-01 13:07:47.508 (ConBee2) ### Update device (Ersatz - Office Sofa Lampe Consumption) : {'nValue': 0, 'sValue': '0', 'TimedOut': 1}
2020-03-01 13:07:47.508 (Ersatz - Office Sofa Lampe Consumption) Updating device from 0:'0' to have values 0:'0'.
2020-03-01 13:07:47.363 Status: (ConBee2) Firmware version : 0x264a0700
2020-03-01 13:07:47.363 Status: (ConBee2) Websocketnotifyall : True
2020-03-01 13:07:47.508 Error: Domoticz(pid:6156, tid:6159('PluginMgr')) received fatal signal 11 (Segmentation fault)
2020-03-01 13:07:47.508 Error: siginfo address=0x180c, address=(nil)
2020-03-01 13:07:49.895 Error: Domoticz(pid:6156, tid:6173('XiaomiGatewayIO')) received fatal signal 11 (Segmentation fault) while backtracing
2020-03-01 13:07:49.895 Error: siginfo address=0x44, address=0x3dfe90

When I dissable the addin, domoticz runs fine. I've verified that I'm on the latest version of the plugin and also reinstalled it (1.0.12). Domoticz Version: Domoticz V4.11740

Smanar commented 4 years ago

OK, so bad news for you. Last beta domoticz are now incompatible with lot of machine, for exemple you need inevitably buster to don't have problem.

Lot of users had this problem and only 2 solutions have worked

For code recompilation https://www.domoticz.com/wiki/Build_Domoticz_from_source It will make a domoticz version according to your libs and versions.

Or it have worked before you add this device (and if you haven't updated something) ? Because you had some deconz log (2020-03-01 13:07:47.363 Status: (ConBee2) Firmware version : 0x264a0700) and usualy, domoticz crash immediatly.

Can you make a try with removing the device from phoscon and reload domoticz to be sure the bug is not provoked by data corruption from API, pls ?

xxLeoxx93 commented 4 years ago

Hey, thanks for the quick reply. What do you mean with "Complete re-installation from scratch"? Do I only need to setup Domoticz again or also Phoscon (repairing of each device)?

I tried to remove the switch from Phoscon web but I can't. I can click remove but it's still there... Then I realized that my deConz isn't correctly and I can't contol some of the switches. So I guess the last smart plug messed something up and hence causeing issues in domoticz. Do you have any idea what I can do to remove the device? Thnaks!

Smanar commented 4 years ago

Forget the complete re-installation, if it s broken suddenly (without updating the system) it can't be the problem.

Do you have the deconz version with GUI ?

We can try directly using the API

curl -X DELETE http://IP:PORT/api/KEY/sensors/ID

xxLeoxx93 commented 4 years ago

Hey,

I managed to delete the device, unfortunalty domoticz still crashes when I enable the addin. I restored also a backup from last night to make sure - no luck. Once the ConBee plugin starts domoticz gets unreachable.

I've access to the gui via VNC if that helps.

Smanar commented 4 years ago

So deconz is working now ? You have solved your problem on it ? So We don't need to use the GUI.

If domoticz don't crash immediatly, for exemple if you have this lines

2020-03-01 13:07:47.363 Status: (ConBee2) Firmware version : 0x264a0700 2020-03-01 13:07:47.363 Status: (ConBee2) Websocketnotifyall : True

Enable log in plugin " debug info only" If I m right, you will see before the crash

2020-03-01 18:17:56.236 (deCONZ) Making Request XXXXXXXXXXXXXXXXXXXXXXX

Else Enable full log

I think there is a answer from one request that are not "digest" for domoticz. At the startup domoticz ask for group/light/sensor/config, it seem it crash at one of them.

It works for config because it display the 2 previous lines, so I don't think the problem concern your installation.

When you have take a look in sensor list (using the API), you haven't see somethink bad ? like chinese character ?

xxLeoxx93 commented 4 years ago

Hello,

with log "Debug info only" I see this in domoticz log:

2020-03-01 18:24:53.324 Status: (ConBee2) Firmware version : 0x264a0700
2020-03-01 18:24:53.324 Status: (ConBee2) Websocketnotifyall : True
2020-03-01 18:24:53.507 Error: Domoticz(pid:8618, tid:8621('PluginMgr')) received fatal signal 11 (Segmentationw

if I set it to Full I see this as latest:

2020-03-01 18:26:22.400 (ConBee2) Domoticz and deCONZ are on same machine
2020-03-01 18:26:22.400 (ConBee2) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE

or do I have to access the log outside the webinterface from domoticz?

I had the latest device named with an "ü", but I've used that in an group name and it worked fine. Could it be that a "ü" is working in a group name but not in a device name? I also recognized that instead of the usual combination of Switch,Power,Consumption I only got the switch this time.

Smanar commented 4 years ago

You don't have line starting with

(deCONZ) Making Request ?

Lines doesn't appear in chronological time for status or error.

Another thing to try line 88 in plugin.py

self.INIT_STEP = ['config','lights','sensors','groups']

Try remove sensors and groups

self.INIT_STEP = ['config','lights']

The plugin will not work, but can help to find the bad request.

For the "ü" idk, I think the plugin can support them.

xxLeoxx93 commented 4 years ago

Hey, I started domoticz again and waited for 10min until I started deConz, again the last lines look like this:

2020-03-01 19:20:40.535 Status: (ConBee2) Started.
2020-03-01 19:20:41.203 (ConBee2) Domoticz and deCONZ are on same machine
2020-03-01 19:20:41.203 (ConBee2) Debug logging mask set to: PYTHON
2020-03-01 19:20:41.188 Status: (ConBee2) Entering work loop.
2020-03-01 19:20:41.189 Status: (ConBee2) Initialized version 1.0.12, author 'Smanar'

When I remove 'sensors" and 'groups' it works fine. I think domoticz sometimes chrashes before it can display all the messages. Now I tried again with only groups removed and I see the request message and result with all my sensors + data:

2020-03-01 19:28:03.990 (ConBee2) Request Return : {"1":{"config":{"configured":true,"on":true,"sunriseoffset":30,"sunsetoffset":-30},"etag":"5aac21e7b0a668a4a276e30cb0ae6257","manufacturername":"Philips","modelid":"PHDL00","name":"Daylight","state":{"dark":true,"daylight":false,"lastupdated":"2020-03-01T18:15:26","status":220,"sunrise":"2020-03-01T06:05:49","sunset":"2020-03-01T17:06:44"},"swversion":"1.0","type":"Daylight","uniqueid":"00:21:2e:ff:ff:05:42:3a-01"},"10":{"config":{"battery":88,"offset":0,"on":true,"reachable":true},"ep":1,"etag":"de13e7e43a00884837fde319a7adb3ba","manufacturername":"LUMI","modelid":"lumi.weather","name":"Wohnzimmer Oben","state":{"humidity":5479,"lastupdated":"2020-03-01T18:10:07"},"swversion":"20161129","type":"ZHAHumidity","uniqueid":"00:15:8d:00:04:18:3d:5a-01-0405"},"11":{"config":{"battery":88,"on":true,"reachable":true},"ep":1,"etag":"de13e7e43a00884837fde319a7adb3ba","manufacturername":"LUMI","modelid":"lumi.weather","name":"Wohnzimmer Oben","state":{"lastupdated":"2020-03-01T18:10:07","pressure":968},"swversion":"20161129","type":"ZHAPressure","uniqueid":"00:15:8d:00:04:18:3d:5a-01-0403"},"12":{"config":{"battery":100,"on":true,"reachable":true,"temperature":2700},"ep":1,"etag":"c8eb70dd506398e1e3b410eb5017dda9","manufacturername":"LUMI","modelid":"lumi.sensor_smoke","name":"lumi.sensor_smoke","state":{"fire":false,"lastupdated":"2020-02-26T20:59:51","lowbattery":false,"tampered":false},"swversion":"20170314","type":"ZHAFire","uniqueid":"00:15:8d:00:02:79:de:0c-01-0500"},"16":{"config":{"on":true,"reachable":true,"temperature":2700},"ep":2,"etag":"cb141d3d2e49a3ae9c75492a3ff90b00","manufacturername":"LUMI","modelid":"lumi.plug","name":"Zwischenstecker","state":{"lastupdated":"2020-03-01T17:20:45","power":19},"swversion":"09-29-2017","type":"ZHAPower","uniqueid":"00:15:8d:00:02:48:12:93-02-000c"},"17":{"config":{"on":true,"reachable":true,"temperature":2700},"ep":3,"etag":"cb141d3d2e49a3ae9c75492a3ff90b00","manufacturername":"LUMI","modelid":"lumi.plug","name":"Consumption 17","state":{"consumption":null,"lastupdated":"none"},"swversion":"09-29-2017","type":"ZHAConsumption","uniqueid":"00:15:8d:00:02:48:12:93-03-000c"},"18":{"config":{"battery":100,"offset":0,"on":true,"reachable":true},"ep":1,"etag":"f0f8a1305b7bec08c5b5f715fe79f4de","manufacturername":"LUMI","modelid":"lumi.weather","name":"Bad Oben","state":{"lastupdated":"2020-03-01T18:10:22","temperature":1930},"swversion":"20161129","type":"ZHATemperature","uniqueid":"00:15:8d:00:01:72:08:d9-01-0402"},"19":{"config":{"battery":100,"offset":0,"on":true,"reachable":true},"ep":1,"etag":"f0f8a1305b7bec08c5b5f715fe79f4de","manufacturername":"LUMI","modelid":"lumi.weather","name":"Bad Oben","state":{"humidity":5635,"lastupdated":"2020-03-01T18:10:22"},"swversion":"20161129","type":"ZHAHumidity","uniqueid":"00:15:8d:00:01:72:08:d9-01-0405"},"2":{"config":{"battery":100,"duration":122,"on":true,"reachable":true,"temperature":0},"ep":1,"etag":"5aac21e7b0a668a4a276e30cb0ae6257","manufacturername":"LUMI","modelid":"lumi.sensor_motion","name":"Bewegungsmelder","state":{"lastupdated":"2020-03-01T13:49:49","presence":false},"type":"ZHAPresence","uniqueid":"00:15:8d:00:00:f1:9e:d6-01-0406"},"20":{"config":{"battery":100,"on":true,"reachable":true},"ep":1,"etag":"f0f8a1305b7bec08c5b5f715fe79f4de","manufacturername":"LUMI","modelid":"lumi.weather","name":"Bad Oben","state":{"lastupdated":"2020-03-01T18:10:22","pressure":967},"swversion":"20161129","type":"ZHAPressure","uniqueid":"00:15:8d:00:01:72:08:d9-01-0403"},"21":{"config":{"battery":100,"offset":0,"on":true,"reachable":true},"ep":1,"etag":"ccdd26d780edbe84bf669842cb8188ee","manufacturername":"LUMI","modelid":"lumi.sensor_ht","name":"Office","state":{"lastupdated":"2020-03-01T18:14:14","temperature":2148},"swversion":"20160202","type":"ZHATemperature","uniqueid":"00:15:8d:00:01:03:d7:a4-01-0402"},"22":{"config":{"battery":100,"offset":0,"on":true,"reachable":true},"ep":1,"etag":"ccdd26d780edbe84bf669842cb8188ee","manufacturername":"LUMI","modelid":"lumi.sensor_ht","name":"Office","state":{"humidity":4925,"lastupdated":"2020-03-01T18:14:14"},"swversion":"20160202","type":"ZHAHumidity","uniqueid":"00:15:8d:00:01:03:d7:a4-01-0405"},"23":{"config":{"on":true,"reachable":true,"temperature":3000},"ep":2,"etag":"673f4775551223cf05155b7980dd5879","manufacturername":"LUMI","modelid":"lumi.plug","name":"Zwischenstecker (3)","state":{"lastupdated":"2020-03-01T17:35:50","power":5},"swversion":"09-29-2017","type":"ZHAPower","uniqueid":"00:15:8d:00:02:56:c8:5d-02-000c"},"24":{"config":{"on":true,"reachable":true,"temperature":3000},"ep":3,"etag":"673f4775551223cf05155b7980dd5879","manufacturername":"LUMI","modelid":"lumi.plug","name":"Zwischenstecker (3)","state":{"consumption":null,"lastupdated":"none"},"swversion":"09-29-2017","type":"ZHAConsumption","uniqueid":"00:15:8d:00:02:56:c8:5d-03-000c"},"25":{"config":{"battery":100,"offset":0,"on":true,"reachable":true},"ep":1,"etag":"d098ffba9ccc659d184b7488c7989abf","manufacturername":"LUMI","modelid":"lumi.sensor_ht","name":"Schlafzimmer Alt","state":{"lastupdated":"2020-03-01T18:01:47","temperature":1850},"swversion":"20160516","type":"ZHATemperature","uniqueid":"00:15:8d:00:01:29:ac:2b-01-0402"},"26":{"config":{"battery":100,"offset":0,"on":true,"reachable":true},"ep":1,"etag":"d098ffba9ccc659d184b7488c7989abf","manufacturername":"LUMI","modelid":"lumi.sensor_ht","name":"Schlafzimmer Alt","state":{"humidity":6365,"lastupdated":"2020-03-01T18:01:47"},"swversion":"20160516","type":"ZHAHumidity","uniqueid":"00:15:8d:00:01:29:ac:2b-01-0405"},"27":{"config":{"battery":95,"offset":0,"on":true,"reachable":true},"ep":1,"etag":"c49d4d7466375ef453dd44cf2850873f","manufacturername":"LUMI","modelid":"lumi.sensor_ht","name":"Kueche Oben","state":{"lastupdated":"2020-03-01T17:50:03","temperature":2167},"swversion":"20160202","type":"ZHATemperature","uniqueid":"00:15:8d:00:00:f4:36:46-01-0402"},"28":{"config":{"battery":95,"offset":0,"on":true,"reachable":true},"ep":1,"etag":"c49d4d7466375ef453dd44cf2850873f","manufacturername":"LUMI","modelid":"lumi.sensor_ht","name":"Kueche Oben","state":{"hum
2020-03-01 19:28:03.993 (ConBee2) Classic Data : {'1': {'config': {'configured': True, 'on': True, 'sunriseoffset': 30, 'sunsetoffset': -30}, 'etag': '5aac21e7b0a668a4a276e30cb0ae6257', 'manufacturername': 'Philips', 'modelid': 'PHDL00', 'name': 'Daylight', 'state': {'dark': True, 'daylight': False, 'lastupdated': '2020-03-01T18:15:26', 'status': 220, 'sunrise': '2020-03-01T06:05:49', 'sunset': '2020-03-01T17:06:44'}, 'swversion': '1.0', 'type': 'Daylight', 'uniqueid': '00:21:2e:ff:ff:05:42:3a-01'}, '10': {'config': {'battery': 88, 'offset': 0, 'on': True, 'reachable': True}, 'ep': 1, 'etag': 'de13e7e43a00884837fde319a7adb3ba', 'manufacturername': 'LUMI', 'modelid': 'lumi.weather', 'name': 'Wohnzimmer Oben', 'state': {'humidity': 5479, 'lastupdated': '2020-03-01T18:10:07'}, 'swversion': '20161129', 'type': 'ZHAHumidity', 'uniqueid': '00:15:8d:00:04:18:3d:5a-01-0405'}, '11': {'config': {'battery': 88, 'on': True, 'reachable': True}, 'ep': 1, 'etag': 'de13e7e43a00884837fde319a7adb3ba', 'manufacturername': 'LUMI', 'modelid': 'lumi.weather', 'name': 'Wohnzimmer Oben', 'state': {'lastupdated': '2020-03-01T18:10:07', 'pressure': 968}, 'swversion': '20161129', 'type': 'ZHAPressure', 'uniqueid': '00:15:8d:00:04:18:3d:5a-01-0403'}, '12': {'config': {'battery': 100, 'on': True, 'reachable': True, 'temperature': 2700}, 'ep': 1, 'etag': 'c8eb70dd506398e1e3b410eb5017dda9', 'manufacturername': 'LUMI', 'modelid': 'lumi.sensor_smoke', 'name': 'lumi.sensor_smoke', 'state': {'fire': False, 'lastupdated': '2020-02-26T20:59:51', 'lowbattery': False, 'tampered': False}, 'swversion': '20170314', 'type': 'ZHAFire', 'uniqueid': '00:15:8d:00:02:79:de:0c-01-0500'}, '16': {'config': {'on': True, 'reachable': True, 'temperature': 2700}, 'ep': 2, 'etag': 'cb141d3d2e49a3ae9c75492a3ff90b00', 'manufacturername': 'LUMI', 'modelid': 'lumi.plug', 'name': 'Zwischenstecker', 'state': {'lastupdated': '2020-03-01T17:20:45', 'power': 19}, 'swversion': '09-29-2017', 'type': 'ZHAPower', 'uniqueid': '00:15:8d:00:02:48:12:93-02-000c'}, '17': {'config': {'on': True, 'reachable': True, 'temperature': 2700}, 'ep': 3, 'etag': 'cb141d3d2e49a3ae9c75492a3ff90b00', 'manufacturername': 'LUMI', 'modelid': 'lumi.plug', 'name': 'Consumption 17', 'state': {'consumption': None, 'lastupdated': 'none'}, 'swversion': '09-29-2017', 'type': 'ZHAConsumption', 'uniqueid': '00:15:8d:00:02:48:12:93-03-000c'}, '18': {'config': {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}, 'ep': 1, 'etag': 'f0f8a1305b7bec08c5b5f715fe79f4de', 'manufacturername': 'LUMI', 'modelid': 'lumi.weather', 'name': 'Bad Oben', 'state': {'lastupdated': '2020-03-01T18:10:22', 'temperature': 1930}, 'swversion': '20161129', 'type': 'ZHATemperature', 'uniqueid': '00:15:8d:00:01:72:08:d9-01-0402'}, '19': {'config': {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}, 'ep': 1, 'etag': 'f0f8a1305b7bec08c5b5f715fe79f4de', 'manufacturername': 'LUMI', 'modelid': 'lumi.weather', 'name': 'Bad Oben', 'state': {'humidity': 5635, 'lastupdated': '2020-03-01T18:10:22'}, 'swversion': '20161129', 'type': 'ZHAHumidity', 'uniqueid': '00:15:8d:00:01:72:08:d9-01-0405'}, '2': {'config': {'battery': 100, 'duration': 122, 'on': True, 'reachable': True, 'temperature': 0}, 'ep': 1, 'etag': '5aac21e7b0a668a4a276e30cb0ae6257', 'manufacturername': 'LUMI', 'modelid': 'lumi.sensor_motion', 'name': 'Bewegungsmelder', 'state': {'lastupdated': '2020-03-01T13:49:49', 'presence': False}, 'type': 'ZHAPresence', 'uniqueid': '00:15:8d:00:00:f1:9e:d6-01-0406'}, '20': {'config': {'battery': 100, 'on': True, 'reachable': True}, 'ep': 1, 'etag': 'f0f8a1305b7bec08c5b5f715fe79f4de', 'manufacturername': 'LUMI', 'modelid': 'lumi.weather', 'name': 'Bad Oben', 'state': {'lastupdated': '2020-03-01T18:10:22', 'pressure': 967}, 'swversion': '20161129', 'type': 'ZHAPressure', 'uniqueid': '00:15:8d:00:01:72:08:d9-01-0403'}, '21': {'config': {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}, 'ep': 1, 'etag': 'ccdd26d780edbe84bf669842cb8188ee', 'manufacturername': 'LUMI', 'modelid': 'lumi.sensor_ht', 'name': 'Office', 'state': {'lastupdated': '2020-03-01T18:14:14', 'temperature': 2148}, 'swversion': '20160202', 'type': 'ZHATemperature', 'uniqueid': '00:15:8d:00:01:03:d7:a4-01-0402'}, '22': {'config': {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}, 'ep': 1, 'etag': 'ccdd26d780edbe84bf669842cb8188ee', 'manufacturername': 'LUMI', 'modelid': 'lumi.sensor_ht', 'name': 'Office', 'state': {'humidity': 4925, 'lastupdated': '2020-03-01T18:14:14'}, 'swversion': '20160202', 'type': 'ZHAHumidity', 'uniqueid': '00:15:8d:00:01:03:d7:a4-01-0405'}, '23': {'config': {'on': True, 'reachable': True, 'temperature': 3000}, 'ep': 2, 'etag': '673f4775551223cf05155b7980dd5879', 'manufacturername': 'LUMI', 'modelid': 'lumi.plug', 'name': 'Zwischenstecker (3)', 'state': {'lastupdated': '2020-03-01T17:35:50', 'power': 5}, 'swversion': '09-29-2017', 'type': 'ZHAPower', 'uniqueid': '00:15:8d:00:02:56:c8:5d-02-000c'}, '24': {'config': {'on': True, 'reachable': True, 'temperature': 3000}, 'ep': 3, 'etag': '673f4775551223cf05155b7980dd5879', 'manufacturername': 'LUMI', 'modelid': 'lumi.plug', 'name': 'Zwischenstecker (3)', 'state': {'consumption': None, 'lastupdated': 'none'}, 'swversion': '09-29-2017', 'type': 'ZHAConsumption', 'uniqueid': '00:15:8d:00:02:56:c8:5d-03-000c'}, '25': {'config': {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}, 'ep': 1, 'etag': 'd098ffba9ccc659d184b7488c7989abf', 'manufacturername': 'LUMI', 'modelid': 'lumi.sensor_ht', 'name': 'Schlafzimmer Alt', 'state': {'lastupdated': '2020-03-01T18:01:47', 'temperature': 1850}, 'swversion': '20160516', 'type': 'ZHATemperature', 'uniqueid': '00:15:8d:00:01:29:ac:2b-01-0402'}, '26': {'config': {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}, 'ep': 1, 'etag': 'd098ffba9ccc659d184b7488c7989abf', 'manufacturername': 'LUMI', 'modelid': 'lumi.sensor_ht', 'name': 'Schlafzimmer Alt', 'state': {'humidity': 6365, 'lastupdated': '2020-03-01T18:01:47'}, 'swversion': '20160516', 'type': 'ZHAHumidity', 'uniqueid': '00:15:8d:00:01:29:ac:2b-01-0405'}, '27': {'config': {'battery': 95, 'offset': 0, 'on': True, 're
2020-03-01 19:28:03.993 (ConBee2) ### Device > 1 Name:Daylight Type:Daylight Details:{'dark': True, 'daylight': False, 'lastupdated': '2020-03-01T18:15:26', 'status': 220, 'sunrise': '2020-03-01T06:05:49', 'sunset': '2020-03-01T17:06:44'} and {'configured': True, 'on': True, 'sunriseoffset': 30, 'sunsetoffset': -30}
2020-03-01 19:28:03.994 (ConBee2) ### Update device (IGN ConBee2 - Daylight) : {'nValue': 0, 'sValue': 'Off'}
2020-03-01 19:28:03.995 (ConBee2) ### Device > 10 Name:Wohnzimmer Oben Type:ZHAHumidity Details:{'humidity': 5479, 'lastupdated': '2020-03-01T18:10:07'} and {'battery': 88, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:03.995 (ConBee2) ### Update device (Wohnzimmer Oben) : {'nValue': 54, 'sValue': '1', 'BatteryLevel': 88}, IGNORED , no changes !
2020-03-01 19:28:03.995 (ConBee2) ### Device > 11 Name:Wohnzimmer Oben Type:ZHAPressure Details:{'lastupdated': '2020-03-01T18:10:07', 'pressure': 968} and {'battery': 88, 'on': True, 'reachable': True}
2020-03-01 19:28:03.996 (ConBee2) ### Update device (Wohnzimmer Oben Neu) : {'nValue': 0, 'sValue': '968;4', 'BatteryLevel': 88}, IGNORED , no changes !
2020-03-01 19:28:03.996 (ConBee2) ### Device > 12 Name:lumi.sensor_smoke Type:ZHAFire Details:{'fire': False, 'lastupdated': '2020-02-26T20:59:51', 'lowbattery': False, 'tampered': False} and {'battery': 100, 'on': True, 'reachable': True, 'temperature': 2700}
2020-03-01 19:28:03.996 (ConBee2) ### Update device (Smoke Office) : {'nValue': 0, 'sValue': 'Off', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:03.996 (ConBee2) ### Device > 16 Name:Zwischenstecker Type:ZHAPower Details:{'lastupdated': '2020-03-01T17:20:45', 'power': 19} and {'on': True, 'reachable': True, 'temperature': 2700}
2020-03-01 19:28:03.996 (ConBee2) ### Update device (Treppenhaus Power) : {'nValue': 0, 'sValue': '19'}, IGNORED , no changes !
2020-03-01 19:28:03.996 (ConBee2) ### Device > 17 Name:Consumption 17 Type:ZHAConsumption Details:{'consumption': None, 'lastupdated': 'none'} and {'on': True, 'reachable': True, 'temperature': 2700}
2020-03-01 19:28:03.996 (ConBee2) ### Update device (Treppenhaus Consumption) : {'nValue': 0, 'sValue': '0'}, IGNORED , no changes !
2020-03-01 19:28:03.996 (ConBee2) ### Device > 18 Name:Bad Oben Type:ZHATemperature Details:{'lastupdated': '2020-03-01T18:10:22', 'temperature': 1930} and {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:03.997 (ConBee2) ### Update device (Bad Oben) : {'nValue': 0, 'sValue': '19.3', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:03.997 (ConBee2) ### Device > 19 Name:Bad Oben Type:ZHAHumidity Details:{'humidity': 5635, 'lastupdated': '2020-03-01T18:10:22'} and {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:03.997 (ConBee2) ### Update device (Bad Oben) : {'nValue': 56, 'sValue': '1', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:03.997 (ConBee2) ### Device > 2 Name:Bewegungsmelder Type:ZHAPresence Details:{'lastupdated': '2020-03-01T13:49:49', 'presence': False} and {'battery': 100, 'duration': 122, 'on': True, 'reachable': True, 'temperature': 0}
2020-03-01 19:28:03.997 (ConBee2) ### Update device (ConBee2 - Bewegungsmelder) : {'nValue': 0, 'sValue': 'Off', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:03.997 (ConBee2) ### Device > 20 Name:Bad Oben Type:ZHAPressure Details:{'lastupdated': '2020-03-01T18:10:22', 'pressure': 967} and {'battery': 100, 'on': True, 'reachable': True}
2020-03-01 19:28:03.997 (ConBee2) ### Update device (Bad Oben) : {'nValue': 0, 'sValue': '967;4', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:03.998 (ConBee2) ### Device > 21 Name:Office Type:ZHATemperature Details:{'lastupdated': '2020-03-01T18:14:14', 'temperature': 2148} and {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:03.998 (ConBee2) ### Update device (Office) : {'nValue': 0, 'sValue': '21.48', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:03.998 (ConBee2) ### Device > 22 Name:Office Type:ZHAHumidity Details:{'humidity': 4925, 'lastupdated': '2020-03-01T18:14:14'} and {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:03.998 (ConBee2) ### Update device (Office) : {'nValue': 49, 'sValue': '1', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:03.998 (ConBee2) ### Device > 23 Name:Zwischenstecker (3) Type:ZHAPower Details:{'lastupdated': '2020-03-01T17:35:50', 'power': 5} and {'on': True, 'reachable': True, 'temperature': 3000}
2020-03-01 19:28:03.999 (ConBee2) ### Update device (Schlafzimmer Alt Power) : {'nValue': 0, 'sValue': '5'}, IGNORED , no changes !
2020-03-01 19:28:03.999 (ConBee2) ### Device > 24 Name:Zwischenstecker (3) Type:ZHAConsumption Details:{'consumption': None, 'lastupdated': 'none'} and {'on': True, 'reachable': True, 'temperature': 3000}
2020-03-01 19:28:03.999 (ConBee2) ### Update device (Schlafzimmer Alt Consumption) : {'nValue': 0, 'sValue': '0'}, IGNORED , no changes !
2020-03-01 19:28:03.999 (ConBee2) ### Device > 25 Name:Schlafzimmer Alt Type:ZHATemperature Details:{'lastupdated': '2020-03-01T18:01:47', 'temperature': 1850} and {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:03.999 (ConBee2) ### Update device (Schlafzimmer Alt) : {'nValue': 0, 'sValue': '18.5', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:03.999 (ConBee2) ### Device > 26 Name:Schlafzimmer Alt Type:ZHAHumidity Details:{'humidity': 6365, 'lastupdated': '2020-03-01T18:01:47'} and {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:03.940 Status: (ConBee2) Firmware version : 0x264a0700
2020-03-01 19:28:03.940 Status: (ConBee2) Websocketnotifyall : True
2020-03-01 19:28:04.000 (ConBee2) ### Update device (Schlafzimmer Alt) : {'nValue': 63, 'sValue': '1', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:04.000 (ConBee2) ### Device > 27 Name:Kueche Oben Type:ZHATemperature Details:{'lastupdated': '2020-03-01T17:50:03', 'temperature': 2167} and {'battery': 95, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:04.000 (ConBee2) ### Update device (Kueche Oben) : {'nValue': 0, 'sValue': '21.67', 'BatteryLevel': 95}, IGNORED , no changes !
2020-03-01 19:28:04.000 (ConBee2) ### Device > 28 Name:Kueche Oben Type:ZHAHumidity Details:{'humidity': 4887, 'lastupdated': '2020-03-01T17:50:03'} and {'battery': 95, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:04.000 (ConBee2) ### Update device (Kueche Oben) : {'nValue': 48, 'sValue': '1', 'BatteryLevel': 95}, IGNORED , no changes !
2020-03-01 19:28:04.000 (ConBee2) ### Device > 29 Name:Buehne Type:ZHATemperature Details:{'lastupdated': '2020-03-01T18:08:58', 'temperature': 1408} and {'battery': 91, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:04.001 (ConBee2) ### Update device (Buehne) : {'nValue': 0, 'sValue': '14.08', 'BatteryLevel': 91}, IGNORED , no changes !
2020-03-01 19:28:04.001 (ConBee2) ### Device > 30 Name:Buehne Type:ZHAHumidity Details:{'humidity': 5986, 'lastupdated': '2020-03-01T18:08:58'} and {'battery': 91, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:04.001 (ConBee2) ### Update device (Buehne) : {'nValue': 59, 'sValue': '1', 'BatteryLevel': 91}, IGNORED , no changes !
2020-03-01 19:28:04.001 (ConBee2) ### Device > 31 Name:Buehne Type:ZHAPressure Details:{'lastupdated': '2020-03-01T18:08:58', 'pressure': 968} and {'battery': 91, 'on': True, 'reachable': True}
2020-03-01 19:28:04.001 (ConBee2) ### Update device (Buehne) : {'nValue': 0, 'sValue': '968;4', 'BatteryLevel': 91}, IGNORED , no changes !
2020-03-01 19:28:04.001 (ConBee2) ### Device > 32 Name:Zwischenstecker (2) Type:ZHAPower Details:{'lastupdated': '2020-03-01T14:19:50', 'power': 5} and {'on': True, 'reachable': True, 'temperature': 4000}
2020-03-01 19:28:04.002 (ConBee2) ### Update device (Kueche Oben Bar Power) : {'nValue': 0, 'sValue': '5'}, IGNORED , no changes !
2020-03-01 19:28:04.002 (ConBee2) ### Device > 33 Name:Consumption 33 Type:ZHAConsumption Details:{'consumption': None, 'lastupdated': 'none'} and {'on': True, 'reachable': True, 'temperature': 4000}
2020-03-01 19:28:04.002 (ConBee2) ### Update device (Kueche Oben Bar Consumption) : {'nValue': 0, 'sValue': '0'}, IGNORED , no changes !
2020-03-01 19:28:04.002 (ConBee2) ### Device > 34 Name:Zwischenstecker (4) Type:ZHAPower Details:{'lastupdated': 'none', 'power': None} and {'battery': 85, 'on': True, 'reachable': True}
2020-03-01 19:28:04.002 (ConBee2) ### Update device (Kueche Oben Spuele Power) : {'nValue': 0, 'sValue': '0', 'BatteryLevel': 85}, IGNORED , no changes !
2020-03-01 19:28:04.002 (ConBee2) ### Device > 35 Name:Consumption 35 Type:ZHAConsumption Details:{'consumption': None, 'lastupdated': 'none'} and {'battery': 85, 'on': True, 'reachable': True}
2020-03-01 19:28:04.003 (ConBee2) ### Update device (Kueche Oben Spuele Consumption) : {'nValue': 0, 'sValue': '0', 'BatteryLevel': 85}, IGNORED , no changes !
2020-03-01 19:28:04.003 (ConBee2) ### Device > 36 Name:Treppenhaus Type:ZHAHumidity Details:{'humidity': 6832, 'lastupdated': '2020-03-01T18:09:19'} and {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:04.003 (ConBee2) ### Update device (Treppenhaus) : {'nValue': 68, 'sValue': '1', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:04.003 (ConBee2) ### Device > 37 Name:Treppenhaus Type:ZHATemperature Details:{'lastupdated': '2020-03-01T18:09:19', 'temperature': 1569} and {'battery': 100, 'offset': 0, 'on': True, 'reachable': True}
2020-03-01 19:28:04.003 (ConBee2) ### Update device (Treppenhaus) : {'nValue': 0, 'sValue': '15.69', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:04.003 (ConBee2) ### Device > 38 Name:Zwischenstecker (5) Type:ZHAPower Details:{'lastupdated': '2020-03-01T09:29:05', 'power': 4} and {'on': True, 'reachable': True, 'temperature': 3100}
2020-03-01 19:28:04.004 (ConBee2) ### Update device (Office PC Lampe Power) : {'nValue': 0, 'sValue': '4'}, IGNORED , no changes !
2020-03-01 19:28:04.004 (ConBee2) ### Device > 39 Name:Zwischenstecker (5) Type:ZHAConsumption Details:{'consumption': None, 'lastupdated': 'none'} and {'on': True, 'reachable': True, 'temperature': 3100}
2020-03-01 19:28:04.004 (ConBee2) ### Update device (Office PC Lampe Consumption) : {'nValue': 0, 'sValue': '0'}, IGNORED , no changes !
2020-03-01 19:28:04.004 (ConBee2) ### Device > 4 Name:Wassersensor_Spuele_Oben Type:ZHAWater Details:{'lastupdated': '2020-03-01T17:59:24', 'lowbattery': False, 'tampered': False, 'water': False} and {'battery': 100, 'on': True, 'reachable': True, 'temperature': 2500}
2020-03-01 19:28:04.004 (ConBee2) ### Update device (Wassersensor_Spuele_Oben) : {'nValue': 0, 'sValue': 'Off', 'BatteryLevel': 100}, IGNORED , no changes !
2020-03-01 19:28:04.004 (ConBee2) ### Device > 40 Name:Zwischenstecker (6) Type:ZHAPower Details:{'lastupdated': '2020-02-26T17:43:15', 'power': 6} and {'on': True, 'reachable': False, 'temperature': 2800}
2020-03-01 19:28:04.005 (ConBee2) ### Update device (Ersatz - Office Sofa Lampe Power) : {'nValue': 0, 'sValue': '6', 'TimedOut': 1}
2020-03-01 19:28:04.007 (ConBee2) ### Device > 41 Name:Consumption 41 Type:ZHAConsumption Details:{'consumption': None, 'lastupdated': 'none'} and {'on': True, 'reachable': False, 'temperature': 2800}
2020-03-01 19:28:04.007 (ConBee2) ### Update device (Ersatz - Office Sofa Lampe Consumption) : {'nValue': 0, 'sValue': '0', 'TimedOut': 1}

directly after that it crashes:

2020-03-01 19:28:04.007 Error: Domoticz(pid:3765, tid:3768('PluginMgr')) received fatal signal 11 (Segmentation fault)
2020-03-01 19:28:04.007 Error: siginfo address=0xeb5, address=(nil)
Smanar commented 4 years ago

But it crash too, even with groups disabled. Perhaps a websocket notification for a group ?

And if you remove "sensors" and not groups ? The plugin can list your group or crash directly ?

Can you show the groups json contain ? Using htt p://IP:PORT/api/API_KEY/groups/ (here or if the file is too big on pastebin) pls.

xxLeoxx93 commented 4 years ago

{"0":{"action":{"bri":128,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":128,"scene":null,"xy":[0,0]},"devicemembership":[],"etag":"3de5d1471446f9be75182e6892ebc3ba","id":"0","lights":["2","3","6","7","8","9","5","19","20"],"name":"Group 0","scenes":[],"state":{"all_on":false,"any_on":false},"type":"LightGroup"},"1":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":[],"etag":"b413d3ddd31dfe691fb6876f5e146831","id":"1","lights":["1"],"name":"Eingang","scenes":[],"state":{"all_on":true,"any_on":true},"type":"LightGroup"},"11":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":[],"etag":"5aac21e7b0a668a4a276e30cb0ae6257","id":"11","lights":["10"],"name":"Papa Schlafzimmer Neu","scenes":[],"state":{"all_on":false,"any_on":false},"type":"LightGroup"},"12":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":[],"etag":"dba665c1c9f01561fba2a3c91bc8153d","id":"12","lights":[],"name":"Kueche Unten","scenes":[],"state":{"all_on":false,"any_on":false},"type":"LightGroup"},"13":{"action":{"bri":128,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":true,"sat":128,"scene":"1","xy":[0,0]},"devicemembership":[],"etag":"0c49ffa55a45873955f9abe9d21eb1bf","id":"13","lights":["15"],"name":"Esszimmer","scenes":[],"state":{"all_on":true,"any_on":true},"type":"LightGroup"},"2":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":["52"],"etag":"5aac21e7b0a668a4a276e30cb0ae6257","id":"2","lights":[],"name":"TRADFRI on/off switch ","scenes":[],"state":{"all_on":false,"any_on":false},"type":"LightGroup","uniqueid":"cc:cc:cc:ff:fe:4f:30:66"},"3":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":true,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":[],"etag":"5dc40758b68ee8bd25eabdfe97266ce4","id":"3","lights":["2","8","16"],"name":"Office","scenes":[],"state":{"all_on":true,"any_on":true},"type":"LightGroup"},"4":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":[],"etag":"db785de076ba4d51f49ab37ee54bc446","id":"4","lights":["3","9","19","20","4"],"name":"Rest","scenes":[],"state":{"all_on":false,"any_on":true},"type":"LightGroup"},"5":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":[],"etag":"4eb6b29719fd61b94c6570a5a2a26727","id":"5","lights":["6","7","11","13"],"name":"Kueche","scenes":[],"state":{"all_on":true,"any_on":true},"type":"LightGroup"},"6":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":["55"],"etag":"5aac21e7b0a668a4a276e30cb0ae6257","id":"6","lights":[],"name":"TRADFRI on/off switch ","scenes":[],"state":{"all_on":false,"any_on":false},"type":"LightGroup","uniqueid":"cc:cc:cc:ff:fe:36:37:98"},"7":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":[],"etag":"72bc5fb0b22fab057b01bf40fd9a75e9","id":"7","lights":["12","14","17","18","21"],"name":"Papa Wohnbereich","scenes":[],"state":{"all_on":true,"any_on":true},"type":"LightGroup"},"8":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":["56"],"etag":"5aac21e7b0a668a4a276e30cb0ae6257","id":"8","lights":[],"name":"TRADFRI on/off switch ","scenes":[],"state":{"all_on":false,"any_on":false},"type":"LightGroup","uniqueid":"cc:cc:cc:ff:fe:3d:a1:aa"},"9":{"action":{"bri":127,"colormode":"hs","ct":0,"effect":"none","hue":0,"on":false,"sat":127,"scene":null,"xy":[0,0]},"devicemembership":[],"etag":"daedde5254eff1fb16d58d3b2fef3046","id":"9","lights":["5"],"name":"Schlafzimmer","scenes":[],"state":{"all_on":true,"any_on":true},"type":"LightGroup"}} Thats the output. If I remove sensors and leave groups in its working, however I see this in the log:

2020-03-01 19:57:28.207 Error: (ConBee2) Websocket error, unknow device > 47 (sensors) Asking for information
2020-03-01 19:57:28.219 Error: (ConBee2) Websocket error, unknow device > 48 (sensors) Asking for information
2020-03-01 19:57:28.232 Error: (ConBee2) Websocket error, unknow device > 49 (sensors) Asking for information
2020-03-01 19:57:28.295 Error: (ConBee2) Websocket error, unknow device > 34 (sensors) Asking for information
2020-03-01 19:57:28.303 Error: (ConBee2) Websocket error, unknow device > 35 (sensors) Asking for information
2020-03-01 19:57:28.309 Error: (ConBee2) Websocket error, unknow device > 64 (sensors) Asking for information
2020-03-01 19:57:28.321 Error: (ConBee2) Websocket error, unknow device > 46 (sensors) Asking for information
2020-03-01 19:57:28.334 Error: (ConBee2) Websocket error, unknow device > 45 (sensors) Asking for information

A lot more of these appear now in the log. I guess this is because of teh removed sensors right?

Smanar commented 4 years ago

Yep, it's because the plugin detect device, and they are not initialised (we have removed the "sensor" part) And normaly, It will ask for information and and them itself, so one by one, the plugin will add missing devices.

But if we disable sensor, you haven't crash ?

So it mean the problem is from sensor (I guess) So same than previous can you give me the sensor list (from pastebin I think, the file will be huge) with this url htt p://IP:PORT/api/API_KEY/sensors

I will use it as it on my version, to see if I can reproduce the bug You have more than 41 device ? (was the last one before the crash on your last try)

Edit: I have my answer, I m seeing a device id 45/64/49/47/48 on your comment. So perhaps it's the device 42 the guilty ?

xxLeoxx93 commented 4 years ago

With sensors dissabled I shouldn't recieve any temp/humid updates right? Because even with dissabled sensors I get temp/humidty updates!? I've already deleted the device I added this morning so it shouldn't be in there I hope.

Sensors: https://pastebin.com/PkKcM493

Smanar commented 4 years ago

The JSON is valid ...

And yep, even with sensor disabled the plugin can work. When device send information trought websocket, you will have this message

2020-03-01 19:57:28.207 Error: (ConBee2) Websocket error, unknow device > 47 (sensors) XXXX

And the plugin ask for information and insert the sensor in domoticz.

Using this way you can add all your device one by one, but I think there is one that domoticz doesn't like.

I need to use your JSON in my domoticz version to test, hoping for crash too. But my production network is busy ATM, I will make test tomorrow sorry.

xxLeoxx93 commented 4 years ago

No hurry :) which json file do you need from me?

Smanar commented 4 years ago

I have used the JSON you give to me previously this one wit sensors. But It have worked without problem (on a windows machine)

I m realy sorry but I can't locate the bug precisely.

I have another thing to try > https://github.com/Smanar/Domoticz-deCONZ/commit/eb60639787e37e142545c692745ff300acd37f58#diff-66c71ea3faaa52c277917c951aa67921

With this code the plugin will ignore all sensors > 40 (on your last log, the last one was 41)

It wil not break your system, you just have less sensor working, and I hop with no crash. If it works try to increase the value by 5

if key > 45:

I think you have understand what I m trying to do, with this method we can locate the device that cause problem.

But it's realy strange as bug, the json is correct and have worked without probleme on my machine.

xxLeoxx93 commented 4 years ago

Hey, first of all: Thanks for your great support with this issue!

I adjusted the code on my machine and tried with > 1, > 40, >50, >500 --> It's always work in terms of Domoticz isn't crashing, but I see this message in the log:

2020-03-02 17:25:28.335 Error: (ConBee2) 'onHeartbeat' failed 'TypeError':''>' not supported between instances of 'str' and 'int''.
2020-03-02 17:25:28.335 Error: (ConBee2) ----> Line 891 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat
2020-03-02 17:25:28.335 Error: (ConBee2) ----> Line 371 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat
2020-03-02 17:25:28.335 Error: (ConBee2) ----> Line 428 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit
2020-03-02 17:25:28.335 Error: (ConBee2) ----> Line 787 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand
2020-03-02 17:25:28.335 Error: (ConBee2) ----> Line 828 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer
2020-03-02 17:25:28.336 Error: (ConBee2) ----> Line 571 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion
2020-03-02 17:25:28.336 Error: (ConBee2) ----> Line 442 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function InitDomoticzDB

-> Is that expected? if I comment the two new lines out it chrashes again. If I'm correct it's complaining that the key isn't a number? So I loged the key into Domoticz --> It's alsways 1. So I changed it to if int(key) > 40

xxLeoxx93 commented 4 years ago

Update: Tested now with my updated code: 40 works, 41 crashes. Looking at device 41, it's indeed a strange one: It's a smart plug that reports a temprature. That causes probably the wrong behaviour. Should I delete it with "curl -X DELETE http://IP:PORT/api/KEY/sensors/ID" or do you want me to do further testing?

Smanar commented 4 years ago

But it still strange for me. I don't see something in the code that can crash domoticz, even it have temperature, it's not a problem. In worse situation you will have a python error, not a crash .... And it have worked on my machine.

You don't use this device on a lua script or other thing inside domoticz that use this device ?

And if you change the code in

if key == 41:

I think it will crash too but now with device 42.

xxLeoxx93 commented 4 years ago

if key == 41: --> Still works without a crash!

Smanar commented 4 years ago

Seriously ? WTF ?

xxLeoxx93 commented 4 years ago

Yep. I now checked again with the two lines commented out -> Crash. With ==41 --> No crash.

Smanar commented 4 years ago

A last try https://github.com/Smanar/Domoticz-deCONZ/commit/22980ec3aee8fd0e944470fd9970069e727e9da0#diff-66c71ea3faaa52c277917c951aa67921

As I don't see anything bad in the JSON, this code will change the value, perhaps we can find the bad value using this way

You can make a try with the code like on the link, you will have an error message "Unknow type" So you can remove the line Type = 'XXXX' And in last try remove the # on the line 446, but this one will create a device on your setting, you will need to delete it (you will have the information every time you will launch the plugin, you can't forget it)

xxLeoxx93 commented 4 years ago

Hey, should it be if key == 41? When I try it with if key == 41 it crashes. When I also uncomment the IEEE part it's showing me:

2020-03-02 18:51:07.385 Error: (ConBee2) Unknow device type XXXX
2020-03-02 18:51:07.385 Error: (ConBee2) Can't Update Unit > 41 (sensors)
Smanar commented 4 years ago

And without crash if you use the fake IEEE ?

xxLeoxx93 commented 4 years ago

Yes, then it works .

Smanar commented 4 years ago

"uniqueid":"00:15:8d:00:02:4a:7d:ff-03-000c"

???

Seriously, WTF bug !

And If you remove the sensor, and re-add it, I think you will the bug again, because the uniqueid will be the same.

I think you have a bad entry in your DZ database for this device, you know a little SQL ?

Or easier, the device is already created in DZ ? so try to remove it, hoping for DZ remove the bad entry too And restart the plugin, it will re-create the entry.

Else I hope you have a small device database .....

xxLeoxx93 commented 4 years ago

I think I've removed it already in Domoticz - can I see somehow which device it is? Should I also remove it from Phoscon with ""curl -X DELETE http://IP:PORT/api/KEY/sensors/ID"? I backup my whole Domoticz Folder every night so I've enough backups + I know SQL and could remove the device directly there. But the question to me still is: How can I see in Domoticz which device is the Nr 41 in Phoscon?

Smanar commented 4 years ago

You have removed it just now ? Because

2020-03-01 19:28:04.007 (ConBee2) ### Device > 41 Name:Consumption 41 Type:ZHAConsumption Details:{'consumption': None, 'lastupdated': 'none'} and {'on': True, 'reachable': False, 'temperature': 2800}
2020-03-01 19:28:04.007 (ConBee2) ### Update device (Ersatz - Office Sofa Lampe Consumption) : {'nValue': 0, 'sValue': '0', 'TimedOut': 1}

It mean the device is already in database, else you will have "create device X" or "IGNORED , no changes"

I think it was previously reachable, and not ATM , so the plugin set the timeout to 1.

I don't think it's usefull to remove it from deconz, because you need this device, and if you remove it and re-include it, you will have exectly the same JSON with same uniqueid. But you can try, it's not a problem.

If domoticz crash just after the device memorisation, you will see the device id in device panel, to find it use the name and the uniqueid. (it's called idx on domoticz, ID is for the plugin), and you can sort the table.

Else I m looking ATM with SQLiteDatabaseBrowserPortable, and devices are in "devicestatus" table. It s the same table than the "device" panel.

Requete SQL to test

SELECT * FROM DeviceStatus WHERE DeviceID LIKE '00:15:8d:00:02:4a:7d:ff%';

You will find the on/off device and the comsumption device, it's the consumption the broken one.

I don't think the bug can come from another table, it seem domoticz crash just after the update

2020-03-01 19:28:04.007 (ConBee2) ### Device > 41 Name:Consumption 41 Type:ZHAConsumption Details:{'consumption': None, 'lastupdated': 'none'} and {'on': True, 'reachable': False, 'temperature': 2800}
2020-03-01 19:28:04.007 (ConBee2) ### Update device (Ersatz - Office Sofa Lampe Consumption) : {'nValue': 0, 'sValue': '0', 'TimedOut': 1}
>CRASH
xxLeoxx93 commented 4 years ago

"uniqueid":"00:15:8d:00:02:4a:7d:ff-03-000c"

???

Why is that ID so strage to you? I deleted the device in Phoscon and Domoticz -> Now it works perfectly again. But If I understood you right you think once I pair it again it will cause this issue again? Thanks again!

Smanar commented 4 years ago

Yep, it's my worry. This ID is not strange at all, this is no reason for a crash. And python script rarely crash domoticz.

I realy think there is a "problem" when domoticz have created this device in the database, perhpas you have solved it with removing the device from DZ, but I m not sure.

xxLeoxx93 commented 4 years ago

Hello @Smanar , The issue reappeared today and I think I found the reason. It's again a sensor type "ZHAConsumption" that is causing the issue (without adding a new device). The hardware is the xiaomi zigbee smart plug and I've seen that the power (watt) and consumption (kWh) is reported seperatly. However the consumption is on all my devices empty. If I remember correctly the smart plug only sents the information for every full used kWh. In the past with the xiaomi gateway the power and consumption was reported as one device and I was able to switch to a "computed" consumption as a workaround. With deCONZ i wasn't able to do that but it's not that important to me. The thing is I think the plugin is crashing when the smart plug is reporting the first fully used kWh. That would be the only reason I can think of since it worked fine for weeks.

Smanar commented 4 years ago

So the problem would not coming from the sensor entry database but from the stored values for this device ?

But how is the JSON of the device ? I have make a search on deconz and this device haven't power consumption (or not working in deconz) So there is nothing in the json, and the device is never updated.

xxLeoxx93 commented 4 years ago

Hello,

this is what I see in the json for the device: "17":{"config":{"on":true,"reachable":true,"temperature":2400},"ep":3,"etag":"3e0c2f3fd3e063c5526d41283f33ee93","lastseen":"2020-04-27T14:34:12.853","manufacturername":"LUMI","modelid":"lumi.plug","name":"Consumption 17","state":{"consumption":69711,"lastupdated":"2020-04-27T14:34:12.853"},"swversion":"09-29-2017","type":"ZHAConsumption","uniqueid":"00:15:8d:00:02:48:12:93-03-000c"} It's just strange that it's always the same device type that is causeing the issue.

Smanar commented 4 years ago

And what you have done, to repair your installation this time ? Deleting the device again ?

Ok, so you have consumption, and only consumption, so yes if you have power too, it will be another widget. But the value is "normal". Can it be a "too big logging table" ? if the device send too much values ?

The thing is I think the plugin is crashing when the smart plug is reporting the first fully used kWh. That would be the only reason I can think of since it worked fine for weeks.

What are you calling "first fully used kWh", your device can stay weeks without using kw/h ?

xxLeoxx93 commented 4 years ago

What are you calling "first fully used kWh", your device can stay weeks without using kw/h ?

yes, I think i've read this somewhere before that the plug only transmits fully used kw/hs. ALL my consumption values are 0 kw/h. That why I thought this could be the issue.

But the value is "normal". Can it be a "too big logging table" ? if the device send too much values ?

All my Consumption devices are empty in Domoticz, so I don't think so.

And what you have done, to repair your installation this time ? Deleting the device again ?

I blocked the ID 17 in the code like we discussed earlier. It's not yet deleted.

Smanar commented 4 years ago

I realy don't understand.

So you have 0 , 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , 69711 I don't understand why it crash domoticz ....

But if you have other plug identical, all with 0 at consumption but without crash it can be something to explore but I don't see what can be problematic.

Do you know a little python ? If you have some time, I will be happy if you can move the "hack". For exemple ATM you have

            if key == 17:
                return

in the fonction InitDomoticzDB if I m right ?

Can you try to put it for exemple in def UpdateDevice(_id,_type,kwarg) (and removing the previous one) with

            if _id == 17:
                return

Like this, the device will be used, but never updated, so it never receive consumption information

But theses modifications can crash again your configuration.

xxLeoxx93 commented 4 years ago

Hello @Smanar

It all looks quiet weired to me, but I try to understand whats going on :) I just updated the logging settings of the addin and spottet this error, maybe it has something to do with it:

2020-04-30 17:00:58.791 Error: (ConBee2) 'onHeartbeat' failed 'ValueError':'invalid literal for int() with base 10: '1116400.0''.
2020-04-30 17:00:58.791 Error: (ConBee2) ----> Line 896 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat
2020-04-30 17:00:58.791 Error: (ConBee2) ----> Line 371 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat
2020-04-30 17:00:58.791 Error: (ConBee2) ----> Line 428 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit
2020-04-30 17:00:58.791 Error: (ConBee2) ----> Line 792 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand
2020-04-30 17:00:58.791 Error: (ConBee2) ----> Line 833 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer
2020-04-30 17:00:58.791 Error: (ConBee2) ----> Line 576 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion
2020-04-30 17:00:58.791 Error: (ConBee2) ----> Line 464 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function InitDomoticzDB
2020-04-30 17:00:58.791 Error: (ConBee2) ----> Line 299 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/fonctions.py', function ProcessAllState
2020-04-30 17:00:58.791 Error: (ConBee2) ----> Line 496 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/fonctions.py', function ReturnUpdateValue

I'll try your adjusted code today and report back the results. All in all the Smart Plugs seem to confuse deCONZ in general. I tried to add another plug and deconz crashed on me completly. So maybe the issue is coming from deCONZ.

xxLeoxx93 commented 4 years ago

Update: like I said before all my consumption values are empty (except one now that is displaying some fake/unrealistic value):

image

However when I look into the device tab it seems that they have a value, but the value is not processed correctly (Maybe because of the space after the , ?):

image

Smanar commented 4 years ago

For the bug, you can replace

kwh = round( int(val) * 1 ,3)

by

kwh = round( float(val) * 1 ,3)

But you will have 1116400.0 Kw/h ^^, I think you have some consumption problem. IDK what is this value, but I don't think it's something usable.

xxLeoxx93 commented 4 years ago

For the bug, you can replace

kwh = round( int(val) * 1 ,3)

by

kwh = round( float(val) * 1 ,3)

But you will have 1116400.0 Kw/h ^^, I think you have some consumption problem. IDK what is this value, but I don't think it's something usable.

Yeah, the consumption is unusable for me unfortunalty. Can I somehow remove all consumption devices so that they can't cause any more issues?

Smanar commented 4 years ago

Yep you can remove all consumption device without problem, just with command line.

I will give the command in some hours, for the moment I m searching why you have value on device tab but not on device widget.

Smanar commented 4 years ago

Ok so device with energy AND power is not possible on same widget on domoticz Instead of using the value, domoticz make addition with the previous one, and after some time the value can be big enought to crash domoticz (logically the code have error handling to prevent that, but can be an explanation to the mystery, and a good one for "astronomic" value)

So I have modified the code to create a new sensor for consumption. The new code is on the plugin beta https://github.com/Smanar/Domoticz-deCONZ/tree/beta

You can delete all your consumption devices in domoticz and restart the plugin, consumption widget will be re-created with the good one. And if you have value on device tab, you will have value on widget.

Else you can delete device from deconz, but take care, you can delete bad one. DELETE http://IP:PORT/api/KEY/sensors/ID

xxLeoxx93 commented 4 years ago

Ok so device with energy AND power is not possible on same widget on domoticz

What do you mean by that? A combination should be possible I think. Thats also how the gatway addin was showing it. Like so: image --> Current power draw and consumption in one widget.

xxLeoxx93 commented 4 years ago

Can you try to put it for exemple in def UpdateDevice(_id,_type,kwarg) (and removing the previous one)

--> Tried it: It crashes domoticz.

Smanar commented 4 years ago

Lol nice I have posted the question in domoticz and still no answer https://www.domoticz.com/forum/viewtopic.php?f=28&t=32453

I will make a try with this widget. But ATM, it's better using the beta, deleting your widget (in domoticz only) and restart the plugin, you will loose your logs, but as values as bad, it's not a big problem.

You will have new widget, with only consumption but with correct value from the sensor. And all will work.

Edit: Same problem, this widget is a counter, and it's not just power/energy wwidget :(

Electricity P1 smart meter

/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=USAGE1;USAGE2;RETURN1;RETURN2;CONS;PROD

IDX = id of your device (This number can be found in the devices tab in the column "IDX")
USAGE1= energy usage meter tariff 1, This is an incrementing counter
USAGE2= energy usage meter tariff 2, This is an incrementing counter
RETURN1= energy return meter tariff 1, This is an incrementing counter
RETURN2= energy return meter tariff 2, This is an incrementing counter
CONS= actual usage power (Watt)
PROD= actual return power (Watt)
xxLeoxx93 commented 4 years ago

I will make a try with this widget. But ATM, it's better using the beta, deleting your widget (in domoticz only) and restart the plugin, you will loose your logs, but as values as bad, it's not a big problem.

Only the Consumption (kw/h) or also the power devices (watt)?

Doesn't it work if you crate the widget for kw/h and feed it with the watt values? By that you could use at least the calculated kw/h usage.

Smanar commented 4 years ago

You just need to delete the kw/h device.

We are trying to make a script https://github.com/Smanar/Domoticz-deCONZ/issues/52 But I m searching the widget ATM.

xxLeoxx93 commented 4 years ago

Beta branch worked! Now Domoticz doens't crash anymore and the Consumption-devices show values. Do you know if the reported values are the total of what the Plug recorded over it's lifespan?

Smanar commented 4 years ago

It's exactly the value send by the device itself without calcul. So it depend device, some of them reset when you unplug them (or have a power off), other need an action.

Edit: I have updated the script to mix device, But hard to test, I haven't this kind of devices, so I can make mistake with total energy, today energy, counter, ect .....

xxLeoxx93 commented 4 years ago

Should I update the beta branch again and delete the power/consumption device?