Tuya BLE integration, includes fingerbot

can you please add support for this Tuya smart lock ?
“model”: “AT1”,
“name”: “Smart lock”,
“product_id”: “rlyxv7pe”,
“product_name”: “A1 PRO MAX”

Hi Alex. What configurations did you put in esp home regarding your bluetooth soil sensor? Didnyou configured the service_uuid and characteristic_uuid? My esp32 board can reach the soil sensor but i can’t get the values of temperature and humidity. Thanks

For anyone interested I managed to get the Fingerbot working over an ESP32 BLE-proxy. Code here: GitHub - garnser/ha_tuya_ble

Does this work with the Tuya Bluetooth gateway or with the ESP proxy?

@garnser I have an ESP32 BLE-proxy configured with HA and a generic Tuya BLE lock.
Do you mind sharing the procedure to integrate the generic Tuya BLE lock into HA?

TIA

I have an inkbird wireless meat thermometer. It supports both wifi and Bluetooth. I was not successful getting it to work with local tuya. While it can see the device the issue is some values aren’t readable, like the temperature probe temps.

Is there any chance this device could work with Tuya BLE or would I be wasting my time?

i am stuck on this as well. any update ?

I have used this integration or the one from GitHub - markusg1234/ha_tuya_ble: Home Assistant support for Tuya BLE devices and I face the same problem with both.

I have the cubetouch integrated but they appear unavailable. I can used them using the tuya integration but I cannot make them work with the Tuya ble integration. I have the esp32 ble proxy and I have three other xiaomi mi door sensors working perfectly.

I have some errors in my HA logs.

etup timed out for bootstrap waiting on {<Task pending name='Task-322' coro=<TuyaBLEDevice.update() running at /config/custom_components/tuya_ble/tuya_ble/tuya_ble.py:294> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[set.remove()]>, <Task pending name='Task-321' coro=<TuyaBLEDevice.update() running at /config/custom_components/tuya_ble/tuya_ble/tuya_ble.py:294> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[set.remove()]>} - moving forward
    DC: device not found, not in range, or poor RSSI: -100
    DC: device not found, not in range, or poor RSSI: -76
    DC: device not found, not in range, or poor RSSI: -97
    DC: device not found, not in range, or poor RSSI: -98
    DC: device not found, not in range, or poor RSSI: -103

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aioesphomeapi/client.py", line 586, in bluetooth_device_connect
    await connect_future
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/bleak_esphome/backend/client.py", line 77, in _async_wrap_bluetooth_operation
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/bleak_esphome/backend/client.py", line 297, in connect
    await self._client.bluetooth_device_connect(
    ...<6 lines>...
    )

I go to log and find this error! Why could that be? I don’t have Tuya Ble installed yet.

Registrador: homeassistant.components.websocket_api.http.connection
Fuente: components/websocket_api/commands.py:537
integración: Home Assistant WebSocket API ([documentación](https://www.home-assistant.io/integrations/websocket_api), [problemas](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
Ocurrió por primera vez: 21:59:26 (1 ocurrencias)
Última vez registrado: 21:59:26

[547621623056] Error handling message: Unknown error (unknown_error) Martin from 192.168.1.236 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36)

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 537, in handle_manifest_list raise int_or_exc homeassistant.loader.IntegrationNotFound: Integration 'tuya_ble' not found.

I can’t add this integration. It’s say that wrong user or password. Please help

@garnser: Your adapted & improved Tuya BLE is incredibly fantastic, thanks ever so much!

Since there are no issues enabled on your GitHub (please do), I would kindly ask you to add a new Fingerbot Plus device, under the "kg" type, with id 6jcvqwh0. I bought these from botland. These use a CR2 battery and have BLE (not Zigbee). I use them via the standard ESPHome Bluetooth Proxy. In the Tuya dev console, they’re shown as “手指机器人Plus(CR2, 蓝牙)”.

I had to manually patch 9 files I think, to add the id, and it works nicely. Hooray!There seem to be some undefined strings though, all shown as [%key:component::….

Would just love if you could add these (ids & strings). Here are some screenshots so you can see what I mean:



Thanks again, and hope to hear from you!

P.S.: Disregard the extra battery entries, they’re from the Battery Notes integration, so I can keep the Fingerbots in my battery inventory (and dashboard).

Thanks, this worked great for my finger bot!

I’ve forked the Tuya BLE integration and added support for the Tuya BT smart lock (model: MQC2HEVY) — the one I bought from AliExpress:
https://www.aliexpress.com/item/1005006039862774.html


Just leaving this here in case someone else finds it useful. Feel free to check it out or reach out if you have questions!

1 Like

thanks @Eugene-Musika can see from your fork you added quite a bit of changes to get it to work.

do you think you can share on a high level what needs to be done to get a new device type added?

i bought a slightly different tuya ble lock from aliexpress. I am guessing most of it is identical to the lock you have as i just need lock and unlock feature.

i can see there is a product id that needs to be added “zmachryv”
how do i find the product id of the ble lock i have?

so i found my lock’s product id which is d0a7gmaa and i added to the files where you added product id MQC2HEVY. is there anything else i need to do? i can see my lock now but the lock/unlock buttons don’t do anything and the status all show unknown. I am using a esphome ble proxy to connect to the lock.

First, let’s check if your lock has the same set of dp_id’s. You can do this on Tuya Smart Developer Center => IoT Core => Device Control => Query Properties. If they’re different, you might need to change them.

Next, check if your lock is connected to your phone or hub. If it is, try disabling the Bluetooth on your phone and the Bluetooth on your hub.

I had a similar problem, and it was super confusing when it was solved by accident when I left my lock closer to a Bluetooth adapter. But mine was connected directly to an Odroid board with HA on it.

Also, your lock might not unlock with the current configuration because it expects to receive a specific value that can be different from mine. I used this data from Tuya IoT:

{
  «code»: «bluetooth_unlock»,
  «custom_name»: «»,
  «dp_id»: 6,
  «time»: 1747915289308,
  «type»: «raw»,
  «value»: «AQE=«
},

and the «AQE=« value
Your’s may be different.

Did you get this resolved?

I’m able to add support for my lock by adding the product and category id for my lock. For quick testing I directly replaced the original category and product id in @Eugene-Musika codebase.

However, I see the following issues. I don’t think that all updates from the lock immediately are transmitted to my home assistant, for example when I tried unlocking by touch, it didn’t reflect immediately in home assistant. However it did appear later. I’m not sure if this is lost notification due to distance or a bug in the code. I don’t think it should be lost notifications because I reliably able to discover the lock at the initial setup of this integration so do not think there should be any lost ble messages but not sure.

Secondly the integration makes the home assistant timeout during the startup, seems it keeps waiting for lock updates to initialize the initial state of the lock at startup.


It could also be a Bluetooth connection issue or the lock itself sending information with a delay. To troubleshoot, try enabling the signal level sensor in the Diagnostic section. If the reading is less than -80 dBm, you should try to place the Bluetooth receiver closer to the lock. My reading is -71 dBm and data updates less then in a second after any action, although I use an ESP32 Bluetooth proxy, and it occasionally receives signals from devices with -100 dBm signal strength.

Oh, and if you also using ble proxy based on esphome then check if you have next in your config:

bluetooth_proxy:
  active: true

The issue might be that in passive mode, it actually updates data with a delay.
I used the ble proxy installer provided by esphome, so I’m not entirely sure how it works internally.

It was indeed bluetooth range issue. I had a ESP32-S3 Box and I created a bluetooth proxy and it is working fine now.

1 Like