Homey Community Forum

Connecting to bluetooth lock using code - TUYA


I’m trying to implement the Tuya API in my app. I’ve tried to question the docs, but can’t find an efficient way to do it.

So here’s my problem. If I wanted send signals from my personal app to the bluetooth lock, which steps should I take?

I’ve tried using the code described in the Tuya docs, but it doesn’t seem up to date.


The Tuya API (I assume this one) only works for Tuya devices that use the Tuya cloud services, which Bluetooth devices won’t be using (at least not directly, possibly through a separate gateway). So you’re going to have to find out if your device can actually be controlled using Tuya API at all. I have my doubts.

You probably have to implement an app that “talks” over Bluetooth with the device directly.

Thanks for the response!

I assumed I could use the API because I was able to connect the lock with the cloud service. I did try to do it solely using Bluetooth, but didn’t manage to make it work. Do you have experience with this?
(I tried this one: Fast Integration with Smart Life App SDK for Android-IoT App SDK-Tuya Developer)

That sounds like the lock has both WiFi and Bluetooth support on board. If that’s the case (and it doesn’t work with a direct BLE connection between your phone and the lock), you might be able to use the Tuya API anyway.

I would suggest starting with a simple Node.js script to run on your local computer to see if you can control the lock, and only then move to a full Homey app.

I have no experience with the Tuya API so can’t help there.