Thanks for Looking into it,
looks like that those RAW datapoints are for Creating Password or unlocking via password, which i dont think needs to be integrated home assistant anyway (or it would be hard to do so, like you said need to be send to cloud and go back to lock again and that would not make sense because all this effort is to try to control the lock locally!)
i think having these entities integrated would be more than enough:
(Control, Alarm, Battery Monitor and maybe Beep Volume)
[wrap=“columns”]
Code |
Type |
Values |
alarm_lock |
Enum |
{ |
|
|
range: [ |
|
|
wrong_finger, |
|
|
wrong_password, |
|
|
low_battery |
|
|
] |
|
|
} |
|
|
|
lock_motor_state |
Boolean |
{true,false} |
|
|
|
residual_electricity |
Integer |
{ |
|
|
min: -1, |
|
|
max: 100, |
|
|
scale: 0, |
|
|
step: 1 |
|
|
} |
|
|
|
beep_volume |
Enum |
{ |
|
|
range: [ |
|
|
mute, |
|
|
low, |
|
|
normal, |
|
|
high |
|
|
] |
|
|
} |
|
|
|
[/wrap=“columns”]
DP Id’s:
Lock Alarm : 21
Lock Motor State : 47
Remaining Battery (residual_electricity) : 8
Lock Navigation Volume: 31
And about the Bluetooth version im not sure, i tried searching in the smart life app and Tuya IoT platform device section and API Explorer, unfortunetly i didnt have any luck finding the hardware’s bluetooth version, is there a way to check bluetooth version when my android phone is connected to the lock via bluetooth??
also im gonna dump some logs here hope you don’t mind, it might help developing a solution:
This error originated from a custom integration.
Logger: aiohttp.server
Source: custom_components/tuya_ble/config_flow.py:175
Integration: Tuya BLE
First occurred: April 28, 2023 at 6:19:04 PM (10 occurrences)
Last logged: April 28, 2023 at 7:11:52 PM
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 241, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/tuya_ble/config_flow.py", line 175, in async_step_login
entry: TuyaBLEData = self.hass.data[DOMAIN][
KeyError: 'tuya_ble'
This error originated from a custom integration.
Logger: homeassistant.config_entries
Source: custom_components/tuya_ble/tuya_ble/tuya_ble.py:591
Integration: Tuya BLE
First occurred: April 28, 2023 at 7:40:52 PM (1 occurrences)
Last logged: April 28, 2023 at 7:40:52 PM
Error setting up entry Smart Lock F2F0F6 for tuya_ble
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 344, in establish_connection
await client.connect(
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 253, in connect
wrapped_backend = self._async_get_best_available_backend_and_device(manager)
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 352, in _async_get_best_available_backend_and_device
raise BleakError(
bleak.exc.BleakError: No backend with an available connection slot that can reach address DC:23:4E:F2:F0:F6 was found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/tuya_ble/__init__.py", line 44, in async_setup_entry
await device.initialize()
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 272, in initialize
await self.update()
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 312, in update
await self._send_packet(TuyaBLECode.FUN_SENDER_DEVICE_STATUS, bytes())
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 869, in _send_packet
await self._ensure_connected()
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 591, in _ensure_connected
client = await establish_connection(
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 420, in establish_connection
await wait_for_disconnect(device, backoff_time)
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/bluez.py", line 286, in wait_for_disconnect
await asyncio.sleep(min_wait_time)
File "/usr/local/lib/python3.10/asyncio/tasks.py", line 605, in sleep
return await future
asyncio.exceptions.CancelledError
This error originated from a custom integration.
Logger: custom_components.tuya_ble.tuya_ble.tuya_ble
Source: custom_components/tuya_ble/tuya_ble/tuya_ble.py:272
Integration: Tuya BLE
First occurred: April 28, 2023 at 7:45:20 PM (2 occurrences)
Last logged: April 28, 2023 at 7:45:20 PM
DC:23:4E:F2:F0:F6: timeout receiving response, RSSI: None
DC:23:4E:F2:F0:F6: Sending device info request failed
This error originated from a custom integration.
Logger: custom_components.tuya_ble.tuya_ble.tuya_ble
Source: custom_components/tuya_ble/tuya_ble/tuya_ble.py:591
Integration: Tuya BLE
First occurred: April 28, 2023 at 6:47:30 PM (30 occurrences)
Last logged: April 28, 2023 at 7:49:43 PM
DC:23:4E:F2:F0:F6: device not found, not in range, or poor RSSI: None
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 204, in connect
reply = await self._bus.call(
File "/usr/local/lib/python3.10/site-packages/dbus_fast/aio/message_bus.py", line 371, in call
await future
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 344, in establish_connection
await client.connect(
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 269, in connect
connected = await super().connect(**kwargs)
File "/usr/local/lib/python3.10/site-packages/bleak/__init__.py", line 531, in connect
return await self._backend.connect(**kwargs)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 141, in connect
async with async_timeout(timeout):
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 129, in __aexit__
self._do_exit(exc_type)
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 591, in _ensure_connected
client = await establish_connection(
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 361, in establish_connection
_raise_if_needed(name, device.address, exc)
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 310, in _raise_if_needed
raise BleakNotFoundError(msg) from exc
bleak_retry_connector.BleakNotFoundError: DC:23:4E:F2:F0:F6 - DC:23:4E:F2:F0:F6: Failed to connect:
This error originated from a custom integration.
Logger: custom_components.tuya_ble.tuya_ble.tuya_ble
Source: custom_components/tuya_ble/tuya_ble/tuya_ble.py:525
Integration: Tuya BLE
First occurred: April 28, 2023 at 6:59:58 PM (8 occurrences)
Last logged: April 28, 2023 at 7:50:23 PM
DC:23:4E:F2:F0:F6: Device unexpectedly disconnected; RSSI: None
This error originated from a custom integration.
Logger: homeassistant.config_entries
Source: custom_components/tuya_ble/tuya_ble/tuya_ble.py:623
Integration: Tuya BLE
First occurred: April 28, 2023 at 7:08:02 PM (3 occurrences)
Last logged: April 28, 2023 at 7:50:23 PM
Error setting up entry Smart Lock F2F0F6 for tuya_ble
Traceback (most recent call last):
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 620, in _ensure_connected
await self._client.start_notify(
File "/usr/local/lib/python3.10/site-packages/bleak/__init__.py", line 717, in start_notify
await self._backend.start_notify(characteristic, wrapped_callback, **kwargs)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 943, in start_notify
assert_reply(reply)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply
raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Unlikely Error)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/tuya_ble/__init__.py", line 44, in async_setup_entry
await device.initialize()
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 272, in initialize
await self.update()
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 312, in update
await self._send_packet(TuyaBLECode.FUN_SENDER_DEVICE_STATUS, bytes())
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 869, in _send_packet
await self._ensure_connected()
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 623, in _ensure_connected
except [BLEAK_EXCEPTIONS, BleakNotFoundError]:
TypeError: catching classes that do not inherit from BaseException is not allowed
these are the some errors and warning logged to HA since last night that i tried to add the lock,
at the moment i can see the lock in devices section but it says" Failed to set up
[Check the logs]"
Thanks Heaps!