Xenomes / Domoticz-TinyTUYA-Local-Plugin

MIT License
3 stars 2 forks source link

Errors when switching devices. - Similar to issue "Plugin working only few minutes" #3

Closed wvries closed 2 months ago

wvries commented 6 months ago

Hi,

I have installed the offline version in my development environment (to help you testing :-) ) and sometimes it does work, I encounter the following issue when switching a device (is the same on all other switch devices):

2024-05-16 16:09:17.552 Status: User: xxxxxxx (IP: xxx.xxx.xxx.xxx) initiated a switch command (17/Wall lights 1 (switch_1)/On) 2024-05-16 16:09:17.906 Error: TinyTuya(local): Call to function 'onCommand' failed, exception details: 2024-05-16 16:09:17.906 Error: TinyTuya(local): Traceback (most recent call last): 2024-05-16 16:09:17.906 Error: TinyTuya(local): File "/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Local-Plugin/plugin.py", line 142, in onCommand 2024-05-16 16:09:17.906 Error: TinyTuya(local): _plugin.onCommand(DeviceID, Unit, Command, Level, Color) 2024-05-16 16:09:17.906 Error: TinyTuya(local): File "/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Local-Plugin/plugin.py", line 101, in onCommand 2024-05-16 16:09:17.906 Error: TinyTuya(local): SendCommand(DeviceID, Unit, True if Command not in ['Off', 'Closed', False] else False, category) 2024-05-16 16:09:17.906 Error: TinyTuya(local): File "/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Local-Plugin/plugin.py", line 525, in SendCommand 2024-05-16 16:09:17.906 Error: TinyTuya(local): tuya = tinytuya.Device(dev_id=str(ID), address=str(getConfigItem(ID, 'ip')), local_key=str(getConfigItem(ID, 'key')), version=str(getConfigItem(ID, 'version')), connection_timeout=1, connection_retry_limit=1) 2024-05-16 16:09:17.906 Error: TinyTuya(local): File "/usr/local/lib/python3.9/dist-packages/tinytuya/core.py", line 946, in init 2024-05-16 16:09:17.906 Error: TinyTuya(local): self.set_version(float(version)) 2024-05-16 16:09:17.906 Error: TinyTuya(local): ValueError: could not convert string to float: '{}'

Plugin TinyTUYA Plugin Local Controlversion Alpha 0.3

Let me know if you need any more info.

Xenomes commented 6 months ago

Hi Wilbert, Thanks test testing! I had the plugin running with my devices without issue, good you found a issue 😅 Can you share the snapshot.json part of this device.

wvries commented 6 months ago

The issue is for all devices, so below find the snapshot for all devices.

{ "timestamp": 1715772474.0517006, "devices": [ { "id": "363037002cf4324c4388", "ip": "192.168.1.143", "active": 2, "ability": 0, "mode": 0, "encrypt": true, "productKey": "key5nck4tavy43jp", "name": "bedroom", "key": "", "mac": "2c:f4:32:4c:43:88", "token": "", "wf_cfg": "", "dev_type": "default", "err": "", "type": "default", "dps": { "devId": "363037002cf4324c4388", "dps": { "1": false, "9": 0 } }, "origin": "broadcast", "ver": "3.3" }, { "id": "bfca7b0908fc2e217eztow", "ip": "192.168.1.138", "active": 2, "encrypt": true, "productKey": "key5ckdnys3pqgec", "token": true, "wf_cfg": true, "name": "Smart Switch", "key": "", "mac": "c4:82:e1:b3:58:98", "ability": 0, "dev_type": "default", "err": "", "type": "default", "dps": { "dps": { "1": false, "2": false, "3": false, "7": 0, "8": 0, "9": 0, "14": "off", "17": "", "18": "", "19": "" } }, "origin": "broadcast", "ver": "3.4" }, { "id": "36303700cc50e3e6b4e7", "ip": "192.168.1.142", "active": 2, "ability": 0, "mode": 0, "encrypt": true, "productKey": "key5nck4tavy43jp", "name": "office", "key": "", "mac": "cc:50:e3:e6:b4:e7", "token": "", "wf_cfg": "", "dev_type": "default", "err": "", "type": "default", "dps": { "devId": "36303700cc50e3e6b4e7", "dps": { "1": false, "9": 0 } }, "origin": "broadcast", "ver": "3.3" }, { "id": "32124004ecfabc205204", "ip": "192.168.1.144", "active": 2, "ability": 0, "mode": 0, "encrypt": true, "productKey": "DYgId0sz6zWlmmYu", "name": "Siren", "key": "", "mac": "ec:fa:bc:20:52:04", "token": "", "wf_cfg": "", "dev_type": "default", "err": "", "type": "default", "dps": { "devId": "32124004ecfabc205204", "dps": { "101": "4", "102": "3", "103": 15 } }, "origin": "broadcast", "ver": "3.1" }, { "id": "bf9250a724f45d4672bdag", "ip": "192.168.1.129", "active": 2, "encrypt": true, "productKey": "keyjnuy4s3kre7m7", "token": true, "wf_cfg": true, "name": "Wall lights 1", "key": "", "mac": "a8:80:55:66:74:fe", "ability": 0, "dev_type": "default", "err": "", "type": "default", "dps": { "dps": { "1": false, "9": 0, "38": "off", "42": "", "43": "", "44": "AAAC", "47": "flip" } }, "origin": "broadcast", "ver": "3.4" }, { "id": "bf2e30944c01138d44lndd", "ip": "192.168.1.130", "active": 2, "encrypt": true, "productKey": "keyjnuy4s3kre7m7", "token": true, "wf_cfg": true, "name": "Street lights", "key": "", "mac": "a8:80:55:2f:e9:98", "ability": 0, "dev_type": "default", "err": "", "type": "default", "dps": { "dps": { "1": false, "9": 0, "38": "memory", "42": "", "43": "", "44": "AAAC" } }, "origin": "broadcast", "ver": "3.4" } ] }

Xenomes commented 2 months ago

Can you test the new push, a lot of thing changed.