Get local key tuya since June 2022


What do you mean?

I mean that it did’nt get my local key.

But problem solved with this method

Mine does not retrieve local keys… followed the docs but get error 1106 which Is also documented but the cloud API is linked and still no joy.


Not sure if you’re still looking, but this video worked for me.

I set it up manually myself (only 4 devices to add) so I didn’t use the script.

The messages in the API told me that the account was expired and I ended up just setting up a new trial account, adding the tuya account again, and waiting 24 hours to get the local keys.



This approach doesn’t seem to work any more. Is the Blue Stacks method above the only way to retrieve the local keys now? Thanks.

For another method to retrieve the local keys take a look at my post here (tuya-cli wizard). It still works (last retrieval ~2 weeks ago).

The easiest method to get the device local key is to log into TuyaIOT and go to API Explorer and use Device Management > ‘Query device details’ and enter in your device ID. The local key is in the response returned.
(Linked updated)

And while you are in there, you can also retrieve the DP values for your device using:
Device Control > Query Properties
(Linked updated)

And your can get the valid values for each setting from here:
Device Control (Standard Instruction Set) > Get the specifications and properties of the device


My answer might not be warranted here, but try to explore custom firmware flashing. I used to work with localTuya but it became a headache after a while and i decided to use tuya-cloudcutter for beken chips or TuyaConvert for other chips (ESPs etc). These methods are solder-free, meaning that its done wirelessly. It might be an advanced method but its worth the effort. All my tuya devices are now running ESPHome/Tasmota.


Hello thank you for the tutorial.I have managed to add some devices but some of them in the smart life app in the bluestacks only says “bluetooth is off” the devices are not working and I can not see the key in the xml file either, anyone have an idea why is that?

I opened the folder with the files, but the preferences_global_key.xml file is missing (in both applications: Tuya Smart and Smart life). I found another file with the same name in the /files/thingmmkv/preferences_global_key folder, but it has unreadable content, I suspect it is encoded. I used to get the key through the API explorer, but now there is no such possibility, it gives an error - “No permissions. Your subscription to cloud development plan has expired.” It’s simple, Tuya uses all available ways to block our WIFI devices from receiving the key to force us to allow them to work through their Chinese server and receive our data. It’s good that I only have 2 Tuya devices that work via WIFI. In the future, I will avoid them and buy only zigbee devices that work locally and do not leak data to China.

1 Like

Hi my friend. I try this method but it give me only this
“code”: 1010,
“msg”: “token invalid”,
“success”: false,
“t”: 1699957304033,
“tid”: “9be76a6f82d711eea7ba0a96cea2b375”
} "
how can I do ? I try it mor. can you help me ? please.

Have you logged into the Tuya IOT site and setup your Cloud project and can see all your devices? That is the first step before you can use the API explorer to retrieve the local keys and DP values for each device.

1 Like

None of the method worked for me. Luckily I found Getting Tuya Device ID, Local Key and DP ID using Tuya Smart Home Basic Service. It worked for me.

That just results in the same "“No permissions. Your subscription to cloud development plan has expired.”

You have to extend the subscription, it is not in service anymore. Just apply for it in the iot tool. You’ll have to do this once in a while.

  1. go to
  2. left pane choose [Cloud] > [Cloud Services]

I think the “Smart Home Basic Service” is the only one you need.

OUTSTANDING - Accurate - Concise - Added to my notes. This is awesome

1 Like

Some sort of unrelated question here.
Is there any way we could extract the device MAC address on TuyaIOT site?
On the Smart Thing mobile app, it does not show MAC address of my device anymore.

This works for me for the Smart Life app, I have only 1 device as a test, so all good. BUT historically, I installed all my devices on the Tuya app. As the Tuya app is not discussed in the video ,but only the Smart Life app, I can not reach my devices to get the Local Keys. Has anyone a good advice how I get to see my Tuya installed devices in the Smartlife app? OR Has anyone a trick to get the Tuya app installed in BS tweaker and Bluestack?

nope, this one doesn’t help

you go to Cloud → Cloud services. Click on Iot Basics, there going to be Iot Core. Its gonna say that “there are problems but its working” you click on Subscribe to resource pack. Got through the process, it will tell you that you already have this service and then you gonna see the button to Extend. Then you fill out the form and wait for “manual review” for extension approval.

1 Like

Thanks, it works.
I can extend the cloud service for free and get the local key