Get local key tuya since June 2022

Hello, someone knows about how to get the local key from IOT Tuya for every single device since June 2022?

I’m not able to get the 4 ultimate digit of my local key i.e : “local_key”: “9bf919751d59****”

When querying the details of this device, the localKey field will be reported. For more details you can see: Device Management-Cloud Services API Reference-Tuya Developer. If you still cannot get the localKey of your device according to the manual, this is because we have temporarily stopped providing the localKey for personal use in order to maintain the security of such devices (the leaked localKey will make it easy for hackers to hack into it. And it will cause great loss to your privacy and security), thank you for your understanding and support.

Source: https://support.tuya.com/en/help/_detail/K9tndtl21hlin

The npx tuya-cli wizard works fine for me. Also LocalTuya added something to automatically retrieve local keys recently.

2 Likes

when did you try for the last time?

And about TUYA local, i don´t see the option, above all if you want to configure a device for its first time…

Today.

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.

Hey,

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.

Cheers

6 Likes

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.

https://eu.iot.tuya.com/cloud/explorer?groupId=group-1633641687672688668&interfaceId=1633017151335964700
(Linked updated)

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

https://eu.iot.tuya.com/cloud/explorer?groupId=group-1633641501546254380&interfaceId=1633017088845021200
(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

https://eu.iot.tuya.com/cloud/explorer?groupId=group-1374194805969522705&interfaceId=1372847888740126700

24 Likes

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.

2 Likes

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 https://iot.tuya.com/
  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.