Open chris24walsh opened 1 year ago
@teixeluis, excellent - that's the only DP it detected upon first scan. There are a couple of issues here:
Ok @alexualbu understood.
So I guess will need to wait longer for more events, since I am not physically close to the sub-device to trigger it (could remote open it but don't want to risk leaving it stuck or unlocked).
For this type of events/data from the DP's, are these coming directly from the sub-device -> BT gateway -> Home Assistant, or the gateway first sends these to the Tuya cloud and the information is collected from there?
@alexualbu apart from the battery state, it appears that no other DPs are readable by localtuya (even though the other DPs exist as I have listed above). I have interacted directly with the device, typing the pin, opening the lock, but still no other DPs show up when trying to add new entities via the method you mentioned.
Do you have any suggestion for debugging? As I have shared previously, in comparison tinytuya dumps the status including not just the battery state, but some other of these parameters.
The problem
When attempting to add a Tuya Bluetooth Gateway via the config flow, it gives me an error:
An unknown error occurred. See log for details.
Checking the logs gives this more detailed error message:
Environment
Steps to reproduce
An unknown error occurred. See log for details.
Configuration
configuration.yaml
orconfig_flow
DP dump
INFO:localtuya:Detecting list of available DPS of device bf12b9e35267857daeyjrf [192.168.2.134], protocol 3.3. DEBUG:localtuya.pytuya:[bf1...jrf] Sending command 10 (device type: type_0a) DEBUG:localtuya.pytuya:[bf1...jrf] Sending payload: b'{"gwId":"bf12b9e35267857daeyjrf","devId":"bf12b9e35267857daeyjrf","uid":"bf12b9e35267857daeyjrf","t":"1673454033"}' DEBUG:localtuya.pytuya:[bf1...jrf] Command 10 waiting for sequence number 1 DEBUG:localtuya.pytuya:[bf1...jrf] Connection lost: [Errno 54] Connection reset by peer ERROR:localtuya.pytuya:[bf1...jrf] Failed to get status: Traceback (most recent call last): File "/Users/chris/.pyenv/versions/3.9.6/lib/python3.9/asyncio/locks.py", line 413, in acquire await fut asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/chris/.pyenv/versions/3.9.6/lib/python3.9/asyncio/tasks.py", line 492, in wait_for fut.result() asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/Users/chris/dev/personal/hass/local-tuya/tuyadebug/localtuya/pytuya/init.py", line 849, in detect_available_dps data = await self.status() File "/Users/chris/dev/personal/hass/local-tuya/tuyadebug/localtuya/pytuya/init.py", line 781, in status status = await self.exchange(DP_QUERY) File "/Users/chris/dev/personal/hass/local-tuya/tuyadebug/localtuya/pytuya/init.py", line 755, in exchange msg = await self.dispatcher.wait_for(seqno, payload.cmd) File "/Users/chris/dev/personal/hass/local-tuya/tuyadebug/localtuya/pytuya/init.py", line 446, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/Users/chris/.pyenv/versions/3.9.6/lib/python3.9/asyncio/tasks.py", line 494, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError
Provide Home Assistant taceback/logs
Additional information
Adding this device via the configuration.yaml 'works', but the adding the subdevices doesn't seem to work. I believe this issue may be due to the only sub-devices being bluetooth smart locks, as I understand that a lock entity is not yet defined for localtuya. Can you confirm this, or explain what else I can do here?