Tuya Lock Bridge

Home Assistant’s Tuya integration supports every platform except lock, so my Tuya keypad showed up as a read-only binary sensor: no way to open the door and no way to manage access codes, which is what I needed for a small guesthouse. So I built it myself, on top of Tuya’s Smart Lock Open APIs.

Update, September 2026: this started as a Home Assistant app (what used to be called an add-on) and has now been rewritten as a proper HACS integration. It works on every install type (not just HA OS), needs no port and no MQTT, and answers service calls directly. The app’s repository (leanderdl2/tuya-lock-bridge) stays online for anyone using it, but new development happens in the integration.

GitHub: GitHub - leanderdl2/hass-tuya-lock-bridge: Home Assistant integration for Tuya smart locks: open the door, manage access codes and profiles, see who came in · GitHub
Install via HACS as a custom repository (a PR for the default store is pending).

What you get, per lock

  • button to open the door
  • sensor with the codes valid right now (full list in its attributes)
  • sensor + event for who opened the door, how (PIN, card, app) and when — trigger an automation on who came in
  • one switch per profile: off disables its PINs and cards, on brings them back, nothing is deleted (think “the cleaner only on changeover days”)
  • a Locks page in the sidebar (admins only) to see codes, create and revoke them, open the door and manage profiles by hand

Services (actions) for everything else: temporary codes with a period, single-use, or a recurring daily pattern (“weekdays 11:00–15:00”); a book helper that turns a check-in, check-out and phone number into a code; profiles with permanent PINs; card enrolment (the lock goes into enrolment mode, you hold the card against the keypad); rename and delete. Services that create something answer with its id, so an automation can keep it.

Entity names follow your HA language; English and Dutch are included.

Prerequisites: a Cloud Development project on the Tuya IoT platform with your Tuya/Smart Life account linked, subscribed to the Smart Lock Open Service. The Trial Edition has a monthly call allowance and must be extended periodically; the integration polls every five minutes by default (configurable).

Hardware: developed and tested on a Nivian NV-ACCESS-PIN-RFID-W WiFi keypad (Tuya category mk). It should work with any Tuya lock exposing the same APIs; if you try it on another model, I’d like to hear how it went. Recurring daily patterns are the one thing Tuya documents as Zigbee-only, so test one before relying on it.

If all you need is open/close, also look at the xtend_tuya or tuya-smart-lock integrations on GitHub; this one is for when you also want codes, profiles and the unlock log.

Using the term add-on is confusing to new users that have never heard of add-ons.
I would suggest to include the current term apps in you git and here to future proof your install procedures.
GitHub - leanderdl2/tuya-lock-bridge: Home Assistant add-on for Tuya smart locks: remote unlock and temporary access code management · GitHub.

Small update: the app has been rewritten as a HACS integration — GitHub - leanderdl2/hass-tuya-lock-bridge: Home Assistant integration for Tuya smart locks: open the door, manage access codes and profiles, see who came in · GitHub

Compared to the app it runs on any HA install type, needs no port or MQTT, and adds a few things: an event entity per unlock (who, how, when), profiles with permanent PINs and cards including card enrolment from HA, and a switch per profile to disable its codes temporarily. The sidebar panel is still there. I’ve updated the first post.

@Sir_Goodenough thanks for the terminology tip, I’ve switched to “app” throughout.