Get Local Keys for your devices - iRayanKhan/homebridge-tuya GitHub Wiki
To get the local keys for your devices, you'll need an account on Tuya's IoT site. Don't be overwhelmed, there's a lot on that site but it's pretty easy to get what you need out of it. The free trial will give you enough access to the Tuya API to get the information you need, on up to 50 devices.
As a prerequisite, add all of your devices to the Tuya Smart app (iOS / Android)
Go to https://iot.tuya.com and click Sign Up
- Fill in your information
- Make up a company name if you need to
- Check Agree to Terms
- Click Agree
- You'll be emailed a code, enter it
- Click through the intro
- On the sidebar click cloud, then projects
- Click Free Trial under TRIAL EDITION
- Click Buy now in the new tab
- Close the Tuya Value Added Service tab/popup
- In the Tuya IoT Platform tab, click Subscribed to be taken back to Cloud -> Projects
- Click create
- Make sure you pick smart home PAAS and the correct region, this affects whether you will be able to access your devices in the following steps. Click create
- Click Authorize for the recommended APIs
- From your project, click the link devices tab, then Link devices by App Account, then Add App Account
- In the Tuya Smart app, click me at the bottom, then the scan button, then scan your QR code
- Confirm the sign in
- Go to the device list tab
- Copy the device ID for your device
- In the sidebar, hover over "Cloud" and click on "API Explorer"
-
In the sidebar, search for "get device information" endpoint and click on the highlighted option. (It should be under "General Devices management" section. Note: there is also another endpoint called "Get the device information" which will not work.)
-
In the "device_id" text field, paste in the device ID you copied and click "Submit Request"
-
In the "Response" section, there should be a property called
local_key
which is your local key.