Tuya BLE integration, includes fingerbot

Hello,
Thanks for the integration, I installed it with Fingerbot 4 days ago and it worked fine for a couple of days. It has stopped working for 2 days and remains in the “Initializing” state.
Is it possible that from Tuya IoT they have restricted it?
image

Greetings.

Hey, I’ve successfully integrated one Fingerbot with this addon, fantastic!

I want to add another one though, which has a door inbetween it and the location of the other one.
The bluetooth connection to it works to a certain extent, but not consistently.

I’m using the AX200 Bluetooth with the 2x2 antenna from my server’s motherboard (ASUS Crosshair VIII Hero Wifi).

Do you have any suggestions on how to improve the range? Different dongle, different antenna, or a repeater? (I’m not savvy enough to use an ESP32)

Thanks!

Edit: I’ll try a better antenna. ESP32 is ordered as well, though. :wink:

Hello @PlusPlus-ua

Thank you for your work.
I’ve my fingerbot wotking!

Is possible to integrate on this a BLe tuya rbg light that I’ve?

image

Hi,

No, Tuya can’t restrict local communication. If your fingerbot is bound to Tuya BT gateway, it might connect to it and then refuse connection attempts from other sources.

Hi,

Yes, it’s possible.

It may take more time than adding new fingerbot because new type of entity (light) should be added.
Could you please open an issue on the GitHub project?

1 Like

Hi, thank you,

I can only suggest ESP32 based BLE proxy.

I will do it.

Thank you.

Thanks for your answer, I don’t have a gw ble, I just wanted to use the raspberry pi as a gw ble. I have read that it could be due to coverage problems, I will try to bring the device closer to see if it is solved. I will post the results in the forum.

1 Like

Hi! Firstly I want to say thank you very much for the amazing work you do with this integration…

I have managed successfully to connect and control Fingerbot Adaprox via HA using ESP BT proxy.

However i am facing a problem that after some hours it stops listening to HA. I toggle the switch in HA and after few seconds it toggles back but nothing happens with the Fingerbot. I tried to reload and integration and also the BT proxy following restart of HA and it doesn’t help. The only thing that helps is when i physically press the Fingerbot and then reload the integration and restart HA. In such scenario it stays working. So it seems that i need manually/physically activate/wake it up and reload for it to work.
Anyone else facing this issue ? Any ideas for a fix or a workaround?

Hello @PlusPlus-ua, do you know if it would be possible to receive an update in HA if someone manually push on FIngerbot Plus? I’m curious if this data could be fetched and keep in HA logs.

Hi, @donparlor, good question. Pushing the button, it’s change of boolean datapoint from true to false or vice versa. I’ll check possibility to implement some event for it.

1 Like

Hi @igalg2022, could you please collect the logs of tuya-ble integration before connection lost and pass it to me. A better way is to open an issue on GitHub.

That would be awesome! To put some context into this request, I have an HVAC that has 4 states that you can change but you must go through these states by pressing the button each time (Recirculation, Min, Max, Off). I created an automation that automatically calculate how many clicks are necessary based on which state the HVAC is. So based on an helper with 4 states, when a different states is entered the fingerbot will press the required number of times to go into that state. But the problem is if someone manually press the fingerbot… The sync between HA and the HVAC will be lost… This is why fetching that data when the fingerbot is manually pressed would make it possible.

Thanks @PlusPlus-ua!

PS: Do you want me to create a PR?

I’ve set up an ESPHome Bluetooth Proxy and it is able to locate my lock but it doesn’t show any working entities. (https://www.amazon.com/dp/B09ZTZJ571?psc=1&ref=ppx_yo2ov_dt_b_product_details). However, in IOT Platform, it constantly shows up as offline. Do I need to remove it from the app and rediscover?

Hi, this device is not supported yet. Open, please, an issue on GitHub.

Hello Alex! Thank you for the great integration.

I do have a ble tuya smart lock and i have installed the integration and my lock was discovered immediately, i unbinded it from the gateway, all details of tuya ids was filled automatically, but it doesn’t go through entire process and logs shows the below:

Looking for your kind support

Update:

I was trying several way to run the device on HA, and now i an getting the following error

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: 11:15:41 PM (1 occurrences)
Last logged: 11:15:41 PM

DC:23:4D:3C:87:97: Device unexpectedly disconnected; RSSI: None

And after restarting HA i got the following:

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/tuya_ble/tuya_ble/tuya_ble.py:625
Integration: Tuya BLE
First occurred: 11:20:00 PM (1 occurrences)
Last logged: 11:20:00 PM

Error setting up entry Lock 3C8797 for tuya_ble
Traceback (most recent call last):
File “/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py”, line 622, in _ensure_connected
await self._client.start_notify(
File “/usr/local/lib/python3.10/site-packages/bleak/init.py”, line 705, in start_notify
raise BleakError(f"Characteristic {char_specifier} not found!")
bleak.exc.BleakError: Characteristic 00002b10-0000-1000-8000-00805f9b34fb not found!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 387, 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 843, in _send_packet
await self._ensure_connected()
File “/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py”, line 625, in _ensure_connected
except [BLEAK_EXCEPTIONS, BleakNotFoundError]:
TypeError: catching classes that do not inherit from BaseException is not allowed

Hope to find a solution

Update #3:

For some reason, after deleting MQTT & TTLOCK integrations, my lock was successfully integrated with HA, but no entities are showing and no control of locking/unlocking as prr image below:

Update #4

[bfd…8aq] Failed to connect to 192.168.86.33: [Errno 111] Connect call failed (‘192.168.86.33’, 6668)

12:54:40 PM – (WARNING) LocalTuya (custom integration) - message first occurred at 6:32:44 AM and shows up 370 times

[bfd…rjv] Disconnected - waiting for discovery broadcast

12:54:37 PM – (WARNING) LocalTuya (custom integration) - message first occurred at 6:32:44 AM and shows up 383 times

[bfd…rjv] Initial state update failed, giving up: DecodeError(‘could not decrypt data: wrong local_key? (exception %s)’, JSONDecodeError(‘Expecting value: line 1 column 1 (char 0)’))

12:54:37 PM – (ERROR) LocalTuya (custom integration) - message first occurred at 6:32:44 AM and shows up 383 times

Ping fails, no response from peer

7:35:53 AM – (ERROR) runner.py

Fetched https://alexa-api.nabucasa.com/access_token (400)

7:35:10 AM – (WARNING) components/cloud/alexa_config.py - message first occurred at 6:32:30 AM and shows up 2 times

Setup timed out for stage 2 - moving forward

6:37:36 AM – (WARNING) bootstrap.py

Error setting up entry Lock 3C8797 for tuya_ble

6:37:36 AM – (ERROR) Tuya BLE (custom integration)

Waiting on integrations to complete setup: tuya_ble

6:37:28 AM – (WARNING) bootstrap.py - message first occurred at 6:33:28 AM and shows up 5 times

DC:23:4D:3C:87:97: Device unexpectedly disconnected; RSSI: None

6:37:17 AM – (WARNING) Tuya BLE (custom integration) - message first occurred at 6:33:07 AM and shows up 4 times

DC:23:4D:3C:87:97: timeout receiving response, RSSI: None

6:34:16 AM – (ERROR) Tuya BLE (custom integration) - message first occurred at 6:34:16 AM and shows up 2 times

Zigbee channel 15 utilization is 98.22%!

6:32:51 AM – (WARNING) components/zha/core/gateway.py - message first occurred at 6:32:51 AM and shows up 2 times

Config entry ‘Mono5 0x18409d6e’ for yeelight integration not ready yet: Failed to read from the socket at 192.168.86.250:55443: [Errno 113] Connect call failed (‘192.168.86.250’, 55443).; Retrying in background

6:32:45 AM – (WARNING) config_entries.py - message first occurred at 6:32:44 AM and shows up 2 times

Hi, I’ve added event in new version, check it out please.

Hello @PlusPlus-ua Alex! I updated the Tuya BLE HACS Component, but when I go into the FingerBot the log doesn’t show any update when I manually click on the FingertBot.

Is the update supposed to appear in the logs??

Thanks for working on this update!!