Smanar / Domoticz-deCONZ

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

deCONZ plugin: Call to function 'onMessage' failed #164

Closed LeBeny closed 4 months ago

LeBeny commented 4 months ago

Hi Smanar,

Since some days, I have errors due to a vibration sensor. But I don't understant the reason and which of them ?

I've done a "git pull" to have the last release. I'm working on domoticz 2024.2.

Log : _

2024-02-17 13:01:06.846 Error: deCONZ plugin: Call to function 'onMessage' failed, exception details: 2024-02-17 13:01:06.847 Error: deCONZ plugin: Traceback (most recent call last): 2024-02-17 13:01:06.847 Error: deCONZ plugin: File "/opt/domoticz/userdata/plugins/Domoticz-deCONZ/plugin.py", line 1227, in onMessage 2024-02-17 13:01:06.847 Error: deCONZ plugin: _plugin.onMessage(Connection, Data) 2024-02-17 13:01:06.847 Error: deCONZ plugin: File "/opt/domoticz/userdata/plugins/Domoticz-deCONZ/plugin.py", line 269, in onMessage 2024-02-17 13:01:06.847 Error: deCONZ plugin: self.WebSocketConnexion(js) 2024-02-17 13:01:06.847 Error: deCONZ plugin: File "/opt/domoticz/userdata/plugins/Domoticz-deCONZ/plugin.py", line 1069, in WebSocketConnexion 2024-02-17 13:01:06.847 Error: deCONZ plugin: kwarg.update(VibrationSensorConvertion( state['vibration'] , state.get('tiltangle',None), state.ge t('orientation',None)) ) 2024-02-17 13:01:06.847 Error: deCONZ plugin: File "/opt/domoticz/userdata/plugins/Domoticz-deCONZ/fonctions.py", line 1023, in VibrationSensorConvertion 2024-02-17 13:01:06.847 Error: deCONZ plugin: kwarg['orientation'] = [ str(val_a), int (val_t) ] 2024-02-17 13:01:06.847 Error: deCONZ plugin: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

_ If you can explain me. Thanks a lot

Benoit

Smanar commented 4 months ago

Hello what is your device ? If I m right he have state/vibration, state/orientation but not state/tiltangle ? You can see that in domoticz/custom/deconz or Phoscon/help/API INformation/sensor.

LeBeny commented 4 months ago

vibration

Thanks for your help Smanar ! I have many aqara sensor. One is different, I don't now why.

see on phoscon :

{ "config": { "battery": 100, "duration": 65, "on": true, "reachable": true, "sensitivity": -8, "sensitivitymax": 2, "temperature": 2600 }, "ep": 1, "etag": "241c373ed0ac1b2e46c84b5985520189", "lastannounced": null, "lastseen": "2024-02-17T16:26Z", "manufacturername": "LUMI", "modelid": "lumi.vibration.aq1", "name": "Vibration Chambre Devant", "state": { "lastupdated": "2024-02-17T16:26:25.934", "orientation": [ -1, 79, 11 ], "tiltangle": 6, "vibration": false, "vibrationstrength": 4 }, "swversion": "0.0.0_0008", "type": "ZHAVibration", "uniqueid": "00:15:8d:00:05:cf:c5:c3-01-0101" }

The aqara a little different :

{ "config": { "battery": 35, "on": true, "pending": [], "reachable": true, "sensitivity": 11, "sensitivitymax": 21, "temperature": 2300 }, "ep": 1, "etag": "848f30f129e3d35d479c2e210f3d1126", "lastannounced": "2023-12-28T04:10:25Z", "lastseen": "2024-02-17T16:29Z", "manufacturername": "dresden elektronik", "modelid": "lumi.vibration.aq1", "name": "lumi.vibration.aq1 (2)", "state": { "lastupdated": "2024-02-17T16:29:19.507", "orientation": [ 78, -2, 12 ], "tiltangle": 11, "vibration": false, "vibrationstrength": 16 }, "swversion": "20180130", "type": "ZHAVibration", "uniqueid": "00:15:8d:00:02:ad:c2:c6-01-0101" }

Smanar commented 4 months ago

It's because all of them are using DDF, except the 00:15:8d:00:02:ad:c2:c6, but why ? You have re-included them recently ? And "manufacturername": "dresden elektronik", lol, I think this one can be re-included to update values.

And all seem to have orientation/tiltangle/vibration.

It's the guilty ? It's visible on deconz logs if you enable "debug info only" on plugin setting on bottom.

Have updated the code for you will not have the issue on the beta branch

git pull
git checkout beta
git pull

But I m still curious to understand what is missing on the guilty device. It's like he make return with orientation but not tiltangle ...

LeBeny commented 4 months ago

Hi,

I have re-install all one month ago with docker-installation (portainer) I re-include the vibration sensor, but it's still different :

{ "config": { "battery": 1, "duration": 65, "on": true, "pending": [], "reachable": true, "sensitivity": 2, "sensitivitymax": 2, "temperature": 3200 }, "ep": 1, "etag": "0d81aea6f33b533a02d2f1af009e2e66", "lastannounced": null, "lastseen": "2024-02-17T18:01Z", "manufacturername": "LUMI", "modelid": "lumi.vibration.aq1", "name": "Vibration Porte d'entrée", "state": { "lastupdated": "2024-02-17T18:02:44.132", "orientation": [ 73, -2, 17 ], "tiltangle": 13, "vibration": false, "vibrationstrength": null }, "type": "ZHAVibration", "uniqueid": "00:15:8d:00:02:ad:c2:c6-01-0101" }

Humm, it seems that i'm already in beta version ? First git pull :

pi@Domoticz:~/domoticz/userdata/plugins/Domoticz-deCONZ $ sudo git pull remote: Enumerating objects: 6, done. remote: Counting objects: 100% (6/6), done. remote: Compressing objects: 100% (6/6), done. remote: Total 6 (delta 1), reused 0 (delta 0), pack-reused 0 Dépaquetage des objets: 100% (6/6), 24.16 Kio | 798.00 Kio/s, fait. Depuis https://github.com/Smanar/Domoticz-deCONZ f3d2b17..cdc4b6f beta -> origin/beta Déjà à jour.

"Debug info only" is already enabled, I don't have other information in error message :

2024-02-17 18:58:21.134 Error: deCONZ plugin: Call to function 'onMessage' failed, exception details: 2024-02-17 18:58:21.138 Error: deCONZ plugin: Traceback (most recent call last): 2024-02-17 18:58:21.139 Error: deCONZ plugin: File "/opt/domoticz/userdata/plugins/Domoticz-deCONZ/plugin.py", line 1227, in onMessage 2024-02-17 18:58:21.139 Error: deCONZ plugin: _plugin.onMessage(Connection, Data) 2024-02-17 18:58:21.139 Error: deCONZ plugin: File "/opt/domoticz/userdata/plugins/Domoticz-deCONZ/plugin.py", line 269, in onMessage 2024-02-17 18:58:21.139 Error: deCONZ plugin: self.WebSocketConnexion(js) 2024-02-17 18:58:21.139 Error: deCONZ plugin: File "/opt/domoticz/userdata/plugins/Domoticz-deCONZ/plugin.py", line 1069, in WebSocketConnexion 2024-02-17 18:58:21.139 Error: deCONZ plugin: kwarg.update(VibrationSensorConvertion( state['vibration'] , state.get('tiltangle',None), state.get('orientation',None)) ) 2024-02-17 18:58:21.139 Error: deCONZ plugin: File "/opt/domoticz/userdata/plugins/Domoticz-deCONZ/fonctions.py", line 1023, in VibrationSensorConvertion 2024-02-17 18:58:21.139 Error: deCONZ plugin: kwarg['orientation'] = [ str(val_a), int (val_t) ] 2024-02-17 18:58:21.139 Error: deCONZ plugin: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Smanar commented 4 months ago

You are missing the "swversion", but it's better ATM ^^, the value can come later.

And yes, you haver the good version of file

https://github.com/Smanar/Domoticz-deCONZ/commit/f3d2b17acb28e9e690401bc5eef978a06e898364..https://github.com/Smanar/Domoticz-deCONZ/commit/cdc4b6f7ae21edce0a5392474f06ab4d553e8ea8 beta -> origin/beta

Have you restarted the plugin ? Domoticz/hardware/deconz/update ?

With "Debug info only" enabled we can see websocket request normally no ? (from deconz). Perhaps a conflict with the "log level" native on last domoticz version.

LeBeny commented 4 months ago

Yes, I have restarted the plugin. I've missed to select info in the plugin. Lot of information, how can i copy just a part ?

I've knocked each vibration sensor, no error occured.

But, I've received error message by mail, each 5 minutes between 20h55 and 21h30 And others.

LeBeny commented 4 months ago

Hi Smanar. Since 21h30 yesterday, no error again. I hope it's ok.

The vibration sensor guilty, seems have his swversion now :

{ "config": { "battery": 100, "duration": 65, "on": true, "pending": [], "reachable": true, "sensitivity": -8, "sensitivitymax": 2, "temperature": 1900 }, "ep": 1, "etag": "858043b6bcfd076dea59b92bd1404221", "lastannounced": null, "lastseen": "2024-02-18T08:04Z", "manufacturername": "LUMI", "modelid": "lumi.vibration.aq1", "name": "Vibration Porte d'entrée", "state": { "lastupdated": "2024-02-18T08:04:56.807", "orientation": [ 74, -2, 16 ], "tiltangle": 8, "vibration": false, "vibrationstrength": 26 }, "swversion": "0.0.0_0008", "type": "ZHAVibration", "uniqueid": "00:15:8d:00:02:ad:c2:c6-01-0101" }

maybe I must do a "git checkout beta" or not ?

Thanks

Smanar commented 4 months ago

maybe I must do a "git checkout beta" or not ?

No, it's fine you have last version. You can return on master on next update, but for the moment you can let as it. The issue can come from the deconz websocket, it miss probably tiltangle.

Lot of information, how can i copy just a part ?

You can copy/paste from domoticz logging page ? I just need the websocket return just before the error. But If the error happen only at 20h30, when you will be back logs will have been overwrited.

Don't worry, if you have no more problem, I will be fine with this patch too.

LeBeny commented 4 months ago

Thanks a lot Smanar