GithubHelp home page GithubHelp logo

Comments (9)

SanMiggel avatar SanMiggel commented on July 24, 2024 2

Hey, I have the same device and manged to get it working. Was quite easy, thanks to the great code base.

Here is the PR
#40

cheers

from ha_tuya_ble.

fuechti avatar fuechti commented on July 24, 2024 1

HA discover the device with tuya integration, but there are no entities available

from ha_tuya_ble.

PlusPlus-ua avatar PlusPlus-ua commented on July 24, 2024

Hi, does integration discover the device? If no, most of all, the device is not BLE but Bluetooth Mesh.

from ha_tuya_ble.

fuechti avatar fuechti commented on July 24, 2024

I am not sure. Still waiting for the device. Should be here tomorrow.

No information so far if BLE or BLE mesh

from ha_tuya_ble.

PlusPlus-ua avatar PlusPlus-ua commented on July 24, 2024

Great, it could be integrated. Next step is to define mapping from Tuya datapoints to HA entities.

Next information is needed:

  1. category, product_id, product_name. These values could be found in /config/.storage/core.config_entries file or in output of https://github.com/redphx/tuya-local-key-extractor
  2. Names and descriptions of datapoints. It could be obtained on "Device Debugging" page of your "Tuya Cloud Project". Please provide it in format like this: work_mode | Enum | {"range": ["white","colour","scene","music"]}
  3. IDs of all datapoints. Here is an instruction how to obtain it https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html . Retrive please IDs of all datapoints, even if it is not listed in previous item of the list.
  4. Part of log produced by your device, like this:
2023-05-11 20:09:28.568 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:AC:71:AE: Received datapoint update, id: 2, type: DT_BOOL: value: True
2023-05-11 20:09:28.568 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:AC:71:AE: Received datapoint update, id: 8, type: DT_ENUM: value: 0
2023-05-11 20:09:28.568 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:AC:71:AE: Received datapoint update, id: 9, type: DT_VALUE: value: 75
2023-05-11 20:09:28.568 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:AC:71:AE: Received datapoint update, id: 10, type: DT_VALUE: value: 0
2023-05-11 20:09:28.568 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:AC:71:AE: Received datapoint update, id: 11, type: DT_ENUM: value: 1
2023-05-11 20:09:28.568 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:AC:71:AE: Received datapoint update, id: 15, type: DT_VALUE: value: 0
2023-05-11 20:09:28.568 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:AC:71:AE: Received datapoint update, id: 12, type: DT_VALUE: value: 70
2023-05-11 20:09:28.568 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:AC:71:AE: Received datapoint update, id: 101, type: DT_BOOL: value: False
2023-05-11 20:09:28.568 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:AC:71:AE: Received datapoint update, id: 17, type: DT_BOOL: value: True

It's a way to obtain information about datapoints types

Sorry for so many items :)

from ha_tuya_ble.

SanMiggel avatar SanMiggel commented on July 24, 2024

@PlusPlus-ua Actually, there is one issue remaining. I have two of those device. First one works like a charm, but I keep failing connecting my second device. Somehow, no BT connection can be established even though the device is right next to the RPi running HA. These are the logs I typically get:

2023-07-01 09:19:32.518 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Connected; RSSI: None
2023-07-01 09:19:32.520 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Connecting; RSSI: None
2023-07-01 09:19:32.526 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Connected; RSSI: None
2023-07-01 09:19:32.893 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending device info request
2023-07-01 09:19:32.893 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending packet: #1 FUN_SENDER_DEVICE_INFO
2023-07-01 09:19:32.898 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending device info request
2023-07-01 09:19:32.899 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending packet: #1 FUN_SENDER_DEVICE_INFO
2023-07-01 09:20:02.556 WARNING (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Device unexpectedly disconnected; RSSI: None
2023-07-01 09:20:02.561 WARNING (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Device unexpectedly disconnected; RSSI: None
2023-07-01 09:20:16.389 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:2B:82: Packet received: 00313005841d36b3eb97230eb2b23e92dbdfce64
2023-07-01 09:20:16.390 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:2B:82: Packet received: 016e8e21202f8475073a668560fc1da14cc54a9f
2023-07-01 09:20:16.394 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:2B:82: Packet received: 0257c59d31d41e9065722d34c85c
2023-07-01 09:20:16.395 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:2B:82: Received: #193 FUN_RECEIVE_DP
2023-07-01 09:20:16.396 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:2B:82: Received datapoint update, id: 11, type: DT_VALUE: value: 90
2023-07-01 09:20:16.396 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-07-01 09:20:16.399 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:2B:82: Sending packet: #193 FUN_RECEIVE_DP in response to #193
2023-07-01 09:20:32.914 ERROR (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: timeout receiving response, RSSI: None
2023-07-01 09:20:32.918 ERROR (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending device info request failed
2023-07-01 09:20:32.923 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Connecting; RSSI: None
2023-07-01 09:20:32.926 ERROR (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: timeout receiving response, RSSI: None
2023-07-01 09:20:32.930 ERROR (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending device info request failed
2023-07-01 09:20:41.031 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Connected; RSSI: None
2023-07-01 09:20:41.034 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Connecting; RSSI: None
2023-07-01 09:20:41.042 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Connected; RSSI: None
2023-07-01 09:20:41.444 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending device info request
2023-07-01 09:20:41.444 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending packet: #2 FUN_SENDER_DEVICE_INFO
2023-07-01 09:20:41.448 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending device info request
2023-07-01 09:20:41.449 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Sending packet: #2 FUN_SENDER_DEVICE_INFO
2023-07-01 09:21:11.069 WARNING (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Device unexpectedly disconnected; RSSI: None
2023-07-01 09:21:11.074 WARNING (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4D:D1:54:AE: Device unexpectedly disconnected; RSSI: None

... 54:AE is the problematic device

Do you have any idea? Strange thing it keeps trying to connect even though in the UI I aborted and dont see the faulty device anywhere.

Cheers,
SanMiggel

from ha_tuya_ble.

PlusPlus-ua avatar PlusPlus-ua commented on July 24, 2024

Hi @SanMiggel

Thank you for PR!

I have same problem last week with one of my Fingerbot which I've used for debug for months. Can you connect your problem device directly to the mobile app?

from ha_tuya_ble.

SanMiggel avatar SanMiggel commented on July 24, 2024

Yes, connection with the mobile app worked fine. Controlling the device via the app was working with no issues. That's what is confusing me...

from ha_tuya_ble.

PlusPlus-ua avatar PlusPlus-ua commented on July 24, 2024

I've resolved the problem with my Fingerbot by removing and then re-adding it to Tuya IoT Cloud. I have no explanation what was the cause of such behavior.

from ha_tuya_ble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.