A simple utility to retrieve local keys for Tuya devices using the Tuya Cloud API.
- Clone this repository
- Install dependencies:
npm install
- Configure your Tuya credentials in
config.js
Edit config.js
with your Tuya IoT Platform credentials:
module.exports = {
CLIENT_ID: 'your_client_id_here',
CLIENT_SECRET: 'your_client_secret_here',
ENDPOINT: 'https://openapi.tuyaeu.com',
USER_ID: 'your_user_id_here'
};
Run the tool with:
node index.js
This will output all your devices with their local keys.
- Create a Tuya developer account at iot.tuya.com
- Create a cloud project
- Link your account to the project
- Obtain your Client ID and Secret from the project
- Get your User ID from your account details
- Local keys are required for local control of Tuya devices without cloud dependency
- Keys retrieved are specific to your account and should be kept secure