jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
879 stars 159 forks source link

Can one connect to the fingerbot directly using Bluetooth without a hub? #350

Open falhumai96 opened 1 year ago

falhumai96 commented 1 year ago

I am planning to buy a Fingerbot, but I would like to know if this API allows for a local Bluetooth communication with the device (say, from a raspberry pi).

Thanks.

jasonacox commented 1 year ago

Hi @falhumai96 - tinytuya uses TCP/IP via WiFi or LAN communication, not bluetooth directly.

falhumai96 commented 1 year ago

I see, so it seems it requires a Hub to function properly.

jasonacox commented 1 year ago

Yes, I suspect that is the case. I have tested using a hub to manage simple bluetooth devices via tinytuya. I don't know about the fingerbot, but would love to know if that works as well.

uzlonewolf commented 1 year ago

Although TinyTuya currently does not support it, I don't see why it couldn't be added. It would take some R&D time to reverse engineer the BLE endpoints, but it should be possible. Unfortunately I'm out of town and didn't bring a hub or fingerbot with me so I won't be able to look into it until later next month.

uzlonewolf commented 1 year ago

Well, I looked into this, and it's not looking too good. It turns out BT devices use an entirely different protocol and as such I feel it's going to be out of scope for the TinyTuya project. I was hoping it was going to be the same protocol as the LAN just wrapped in GATT messages, however that is not the case and pretty much none of the existing code can be used in implementing it. There is already a hubless Fingerbot demo program at https://github.com/redphx/poc-tuya-ble-fingerbot however.

jasonacox commented 1 year ago

Bummer. Thanks for exploring this @uzlonewolf !