Get tuya local key via SmartLife/TuyaSmart QR login (No Tuya IoT Developer Account)

I built a small tool to solve a problem I’ve run into a few times with local tuya integration.

Most local tuya integrations can fetch the local key during the initial setup. But if you factory reset a device and pair it again, the local key changes. Your device stops working in Home Assistant, and all you really need is the new local key.

To get the latest local key, you have to go through the Tuya IoT Developer Portal. This tool skips that completely.

Just enter your Smart Life or Tuya Smart User Code, then scan the generated QR code. That’s it. It will list all the devices in your account along with their Local Key , Device ID , Device Name and more. The login session is cached, so you don’t need to scan the QR code every time.

You can use it however you prefer:

  • :house: Install it as a Home Assistant app (add-on)
  • :spouting_whale: Run it as a Docker container
  • :laptop: Use it directly from the CLI

GitHub: https://github.com/vineetchoudhary/tuya-local-key

If you’re using Home Assistant, you can add the app repository directly:

Open your Home Assistant instance and show the add add-on repository dialog with this repository URL pre-filled.

Hopefully it saves someone else from having to deal with the Tuya developer portal. Feedback, feature requests, and contributions are always welcome!

great, but I got…

2026-07-27 08:51:12.908 ERROR (MainThread) [supervisor.docker.interface] Can’t install ghcr.io/vineetchoudhary/tuya-local-key:1.3: [0] failed to copy: httpReadSeeker: failed open: content at https://ghcr.io/v2/vineetchoudhary/tuya-local-key/manifests/sha256:f1591d8f0fc306f5c3c6c0fcaebb5f86e5e6d7aca4ce4ce980f79d8ca6ca7078 not found: not found

2026-07-27 08:51:12.908 ERROR (MainThread) [supervisor.apps.app] Could not pull image to update app 20492cfe_tuya_local_key: Can’t install ghcr.io/vineetchoudhary/tuya-local-key:1.3: [0] failed to copy: httpReadSeeker: failed open: content at https://ghcr.io/v2/vineetchoudhary/tuya-local-key/manifests/sha256:f1591d8f0fc306f5c3c6c0fcaebb5f86e5e6d7aca4ce4ce980f79d8ca6ca7078 not found: not found

2026-07-27 08:56:36.714 INFO (MainThread) [supervisor.docker.interface] Downloading docker image Package tuya-local-key · GitHub with tag 1.3.

2026-07-27 08:56:38.031 ERROR (MainThread) [supervisor.docker.interface] Can’t install ghcr.io/vineetchoudhary/tuya-local-key:1.3: [0] failed to copy: httpReadSeeker: failed open: content at https://ghcr.io/v2/vineetchoudhary/tuya-local-key/manifests/sha256:f1591d8f0fc306f5c3c6c0fcaebb5f86e5e6d7aca4ce4ce980f79d8ca6ca7078 not found: not found

2026-07-27 08:56:38.032 ERROR (MainThread) [supervisor.apps.app] Could not pull image to update app 20492cfe_tuya_local_key: Can’t install ghcr.io/vineetchoudhary/tuya-local-key:1.3: [0] failed to copy: httpReadSeeker: failed open: content at https://ghcr.io/v2/vineetchoudhary/tuya-local-key/manifests/sha256:f1591d8f0fc306f5c3c6c0fcaebb5f86e5e6d7aca4ce4ce980f79d8ca6ca7078 not found: not found

This is awesome! Thank you!

Could you let me know which CPU architecture your Home Assistant is running on? It looks like it is fetching the unknown/unknown build (multi-platform build manifest) instead of a platform-specific image. Right now it only supports amd64 and arm64.

I get the same error as @Remco_van_Geel. Running HAOS 18.0 on Proxmox

Proxmox should definitely be amd64 . I’ll investigate and see if I can remove the unknown/unknown manifest.

@Remco_van_Geel @Holdestmade could you please try again with version 1.5, where I’ve disabled the provenance and SBOM image attestations?

GHCR images no longer contains any manifests with the unknown/unknown OS/architecture. Please make sure you’re pulling the 1.5 image.

Yes, that worked.

EDIT - App works great thanks for sharing

it works!!

Cool took me few minutes to click on the link, install and pasting my Tuya Code, working great
On My HA-Green Device

Will try later on my HA-VM installs later :+1:

EDIT: On the other hand, i only need it 1 Place ,unless you plan to add other features :grin:

Thanks for trying it out! glad to hear it is working well on HA Green device

I intentionally named the project tuya-local-key to keep its scope focused on retrieving the local key only. I may add a few small features in the future, like, support for a fixed username/password when running the container directly with Docker for users who are not using HAOS, since they can’t use it behind HA Ingress.

In the meantime, I’ll do my best to maintain the project for as long as Tuya/SmartLife doesn’t make any breaking changes :grinning_face_with_smiling_eyes:

Update: I’ve just released 1.6 and 1.7 with the following changes:

  • Optional Web UI Authentication

    • Added optional basic username/password authentication. Set AUTH_USERNAME and AUTH_PASSWORD to enable it.
    • v1.7: Authentication only applies to direct port access and is automatically disabled when using Home Assistant Ingress.
    • This is recommended whenever the port is reachable beyond localhost. Basic Auth sends credentials unencrypted over plain HTTP, so still keep it on a trusted network or behind a TLS reverse proxy, and do not expose it directly to the internet. On Home Assistant, ingress already authenticates access, so these credentials are ignored for ingress requests. Set them only if you enable the direct port access and want a separate login there.
  • 24-Hour Device List Caching

    • Cached the tuya device list for up to 24 hours to improve subsequent page load times and reduce number of requests to tuya backend.
    • If you need the latest devices, click the Refresh button on WebUI to fetch the newest list from tuya.
  • Home Assistant QR Code Configuration

    • Added a configuration option to choose between SmartLife and TuyaSmart QR code schemes. This is helpful if you have trouble logging in with different apps.
  • Various other improvements and bug fixes.