Control Tuya smart devices via the Tuya Cloud API using access credentials and request signing

domain: developer.tuya.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register on platform.tuya.com, create a Cloud Project, and note the Access ID and Access Secret; add your Tuya-connected devices to the project and select the Smart Home or Industry Basic Service API products
  2. Obtain an access token by POST to https://<endpoint>/v1.0/token?grant_type=1; the endpoint varies by region (e.g., openapi.tuyaus.com for US, openapi.tuyaeu.com for EU); sign the request with HMAC-SHA256 using the Access Secret over a string composed of Access ID, timestamp, nonce, and the request body hash
  3. List devices associated with the user by GET /v1.0/iot-01/associated-users/devices after linking devices to the project via the Tuya app or Smart Life app; note each deviceId for subsequent commands
  4. Retrieve device function specifications with GET /v1.0/iot-03/devices/<deviceId>/specification to get the supported Codes (e.g., switch_led, colour_data, temp_value) and their value schemas
  5. Send a device command with POST /v1.0/iot-03/devices/<deviceId>/commands with body {"commands":[{"code":"switch_led","value":true}]}; include a fresh access token and re-sign each request with the current timestamp
  6. Poll device status with GET /v1.0/iot-03/devices/<deviceId>/status for a snapshot, or use Tuya's Pulsar message queue service to subscribe to device event streams for real-time updates

Known gotchas

Related routes

Use the Tuya Cloud OpenAPI to send commands to a device and poll device property status
developer.tuya.com · 6 steps · unrated
Subscribe to Tuya device status changes via the Pulsar-based Message Service
iot · 6 steps · unrated
Authenticate and control a Nest thermostat via Google Smart Device Management (Device Access) API
developers.google.com/nest/device-access · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans