Tuya/Smart Life Door Locks

Not sure if it is of any help but I have been playing around with this a little. I have the following:

Tuya Wifi+Pin - Basically a keypad/rfid reader

The Tuya IoT platform lists it as an “mk” device.

I have been able to unlock it remotely with two API calls from the Tuya IoT website.

First, I make an API call to “Get Temporary Key”:

curl --request POST “https://openapi.tuyaus.com/v1.0/devices/eb8bfxxxxxxxxxxxxxxsx/door-lock/password-ticket” --header “sign_method: HMAC-SHA256” --header “client_id: ftaqjxxxxxxxxxxxxxxx” --header “t: 1677685183193” --header “mode: cors” --header “Content-Type: application/json” --header “sign: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” --header “access_token: xxxxxxxxxxxxxxxxxx”

That will return a “ticket_id” along with some other info, then I make a “Password-Free Unlocking” call:

curl --request POST “https://openapi.tuyaus.com/v1.0/devices/eb8bfxxxxxxxxxxxxxx/door-lock/password-free/open-door” --header “sign_method: HMAC-SHA256” --header “client_id: ftaxxxxxxxxxxxxxxxxxx” --header “t: 1677685751682” --header “mode: cors” --header “Content-Type: application/json” --header “sign: 9xxxxxxxxxxxxxxxxxxxxxxxxxxxx09” --header “access_token: aafb7xxxxxxxxxxxxxxxxxxxx8f” --data “{“ticket_id”:“4Nam6LUO”}”

So maybe someone smarter than me can figure out how to roll this into Home Assistant???

5 Likes

How do you get a valid sign? I tried here, but the sign gets invalidated after the first command.

Would love if someone could get these smart locks working with Tuya. I have a tuya deadbolt lock (similar to the image above) that uses a gateway and ble.

I am able to get info from the lock using IoT, but have no way to figure how to work that with HA (I am a newbie at this). Has anyone had any luck with this?

Hi, there is new custom integration for Tuya Bluetooth (Thanks to @PlusPlus-ua and all his efforts to get smart locks included in this integration )
if anyone has one of tuya ble smart lock please try this with yours and share your results, my HA is installed on an old laptop i dont trust the bluetooth range, i would like to see the result for others, Thanks!
check it out at link below:

3 Likes

Hi, do i still need the tuya bt hub?
Or does it work with bt proxy

It supposed to work with bt proxy and you need to makesure you unbind the device from your bt gateway if you have one, so it can discover your smart lock.

btw i have an open issue on this custom integration’s github page, please share your results there if possible, thanks

I have created ticket for that

@seanmoro your method requires paid subscription to Smart Lock Open APIs-Cloud Services API Reference-Tuya Developer ?

@fberbert :
Get Temporary Key:
https://eu.iot.tuya.com/cloud/explorer?id=p1683230055249f8ftrp&groupId=group-561293935902745&interfaceId=1275042059341799400&abilityId=1365686146595553298
Unlock Door Without Password
https://eu.iot.tuya.com/cloud/explorer?id=p1683230055249f8ftrp&groupId=group-561293935902745&interfaceId=1442670936242270200&abilityId=1365686146595553298

btw. local suport is not possible → Request support for Smart Lock - T12-Wifi-II / Card+PIN · Issue #678 · make-all/tuya-local · GitHub

1 Like

@macxq - As far as I know, there is no paid subscription required. I do not pay for anything (nor am I a dev) so I was able to access everything freely. The three important variable seem to be:

–header "sign: "
–header "access_token: "
–header "t: "

the first two will be unique for everyone. The t: header is a timestamp in epoch time as the access token expires after a set period.

Hope this helps.

I have also bought several different models of tuya door locks like wifi and zigbee (arround 20 different, zigbee one even can be remotely unlocked as well as one wifi model) was not able to integrate any into homeassistant. It would be rly nice to see any of them working with HA

1 Like

I just got a tuya padlock that is bluetooth, before I found this integration I had already loaded it into a gateway. It did show up to homeassistant but wouldn’t learn, so I unbound it from the gateway and now homeassistant isn’t seeing it anymore. It does still show up in the tuya app, I had assumed this was just via the bluetooth connection to my phone. Do I need to fully delete the lock and re add it only as a connection through my phone? Originally I linked it straight to the gateway.

Hi! I’ve seen you reply to a few messages with this while I try to work out if HA could solve my problems.

I have a Blusafe Origin (door lock) which uses Bluetooth (not sure if it’s BLE - can I tell somehow?). It is connected to the Tuya app along with a Gateway which I bought from the same company (it looks like a stock tuya gateway).

At the moment scenes don’t work within Tuya (not sure why), but I can unlock it within the app by holding down on the unlock.

With this integration, I think I’d need to delete the lock and gateway from tuya (and the gateway becomes pointless). Then have HA act as the Gateway with this integration?

With this integration can you add fingerprints and cards?

1 Like

Hi Phil,
sorry for late reply, so yes according to integration you supposed to unbind your device from tuya bluetooth gateway but still leave it in the tuya/smartlife app’s device list.
so the point or benefit of adding the lock to HA is that to run automations and see logs and it being controlled locally.
to add your cards and fingerprints and passwords im pretty sure you have to still use tuya/smartlife app.

although i could not still manage to use tuya ble integration properly,
there’s been a couple of new version since last time i tried, im going to try it again, you have a look at the original integration code page here:

Integrating them with Home Assistant could be a cool move, especially if your other Tuya devices are playing nice.Given your experience with flawless Tuya device connections, the odds are good that the locking mechanism could work smoothly too. Focusing solely on the locking action makes things simpler, and I’m all for keeping things hassle-free.By the way, speaking of doors, I’m knee-deep in house renovation plans. Came across these French doors at https://doorsdirect2u.co.uk/product-category/french-dоors/ that might interest you too. I’m just sharing some inspiration, no strings attached.

Has anyone got this lock and connected to HA?

https://www.aliexpress.com/item/1005004841248620.html?spm=a2g0o.cart.0.0.197f38dawF5yi2&gps-id=shoppingCartRecommend&scm=1007.13440.311564.0&scm_id=1007.13440.311564.0&scm-url=1007.13440.311564.0&pvid=ca78ecec-25f3-4bee-91ad-3c4b9a052663&_t=gps-id:shoppingCartRecommend,scm-url:1007.13440.311564.0,pvid:ca78ecec-25f3-4bee-91ad-3c4b9a052663,tpp_buckets:668%232846%238116%232002&pdp_npi=4%40dis!AUD!130.69!91.49!!!603.39!!%402103011116970160586145496e956e!12000030702649973!rec!AU!762881936!

Im confused with how this works and the steps?? did you have any luck?

1 Like

Hi Phil,

Did you get this working?

I was able to add it, but i had no controls over it

I made a virtual switch in smart life via their iot development website. Then made the switch unlock the door via a smart scene. Then I used a helper in home assistant to disguise the switch as a lock. After that I was able to add it to Google Home via home assistant with a pin and everything. I hid the virtual switch in another home in Google home so nobody can see it but me and I locked up smart life.

4 Likes

I too would very much like to get this working with my GeekSmart K01. The first issue I’m running into is I have no idea how to connect to Tuya using the HACS available integration. I created an account on platform.tuya.com and on the Tuya application, but I have no idea what credentials need to be entered into the Tuya IoT Access ID, Tuya IoT Access Secret, Account, and Password fields in the Tuya BLE integration. The second issue I’m running into is connecting the door knob to the Tuya application because I can’t seem to put the door knob into pairing mode.

Morning, is there a way you can show me how you accomplished this. I’ve been trying to get my tuya bluetooth door lock to work with home assistant