leeyuentuen / localtuya

local handling for Tuya devices
GNU General Public License v3.0
72 stars 17 forks source link

Add sub-device failed #69

Closed xl5510 closed 1 year ago

xl5510 commented 1 year ago

I've added a tuya zigbee gateway,and the "local key" is obtained using the tuya IoT Platform.When I want to add a sub-device,the integration report "Failed to authenticate with device. Verify that device id and local key are correct." and the following events are logged for the “Core Log”:

2023-06-18 09:08:22.553 ERROR (MainThread) [custom_components.localtuya.pytuya] [6c7...hjc] Failed to get status for cid 6c5323498...n5g: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "/config/custom_components/localtuya/pytuya/init.py", line 684, in detect_available_dps status = await self.status(cid) ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/pytuya/init.py", line 598, in status status = await self.exchange(ACTION_STATUS, cid=cid) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/pytuya/init.py", line 576, in exchange payload = self._decode_payload(msg.payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/pytuya/init.py", line 788, in _decode_payload return json.loads(payload) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

How can I fix this? PS: Home Assistant 2023.6.2 Supervisor 2023.06.2 Operating System 10.2 LocalTuya integration 3.6.7 &3.7