Tuya Smart Control
CLAWHUB · Unverified
Control Tuya smart home devices via natural language. Use when the user asks to control smart devices (turn on/off lights, AC, plugs, adjust brightness/tempe... Skill: Tuya Smart Control Owner: gaosq856 Summary: Control Tuya smart home devices via natural language. Use when the user asks to control smart devices (turn on/off lights, AC, plugs, adjust brightness/tempe... Tags: latest:1.0.5 Version history: v1.0.5 | 2026-04-28T09:05:17.302Z | user No user-visible changes in this release. - Version bump to 1.0.5 with no detected file changes. - All features and documentation re
- 62
- Rank
- 84
- Safety
- 1.6k
- Downloads
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · Oct 10, 2026
- Adoption signal
- 1.6K downloadsadoption · Oct 10, 2026
- Latest release
- 1.0.5release · Apr 28, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.0.5release
No user-visible changes in this release. - Version bump to 1.0.5 with no detected file changes. - All features and documentation remain unchanged.
Observed Apr 28, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s171j9g2syww0fznp0dph2hgvh83g91h:tuya-smart-control- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-gaosq856-tuya-smart-control/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
147,095 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: tuya-smart-control
description: Control Tuya smart home devices via natural language. Use when the user asks to control smart devices (turn on/off lights, AC, plugs, adjust brightness/temperature/mode), query device status or list devices, manage homes and rooms, rename devices, check weather by location, send notifications (SMS, voice call, email, or App push), view device data statistics (e.g. energy/power consumption), capture snapshots/short videos from IPC cameras, or subscribe to real-time device events (property changes, online/offline status) via WebSocket. Requires TUYA_API_KEY.
metadata: { "openclaw": { "version": "1.0.0", "emoji": "🏠", "requires": { "env": ["TUYA_API_KEY"], "pip": ["requests>=2.28.0", "websockets>=12.0"] }, "primaryEnv": "TUYA_API_KEY" } }
---
# Tuya Smart Home Device Control Skill
## Basic Information
- **Official Website**: https://www.tuya.com/
- **Source Code**: https://github.com/tuya/tuya-openclaw-skills
- **Authentication**: Via Header `Authorization: Bearer {Api-key}`
- **Credentials**: Read from environment variable `TUYA_API_KEY`. Base URL is auto-detected from API key prefix. See `references/api-conventions.md` for the prefix-to-region mapping table. You can override by setting `TUYA_BASE_URL`.
- **API Reference**: See individual files under `references/`
- **Python SDK**: See `scripts/tuya_api.py`
- **Device Message Client**: See `scripts/tuya_device_mq_client.py` (real-time WebSocket subscription)
## Environment Variable Configuration
Set the following environment variable before use:
```bash
export TUYA_API_KEY="your-tuya-api-key"
# TUYA_BASE_URL is optional — auto-detected from API key prefix
# Override only if needed: export TUYA_BASE_URL="https://openapi.tuyaus.com"
```
The same `TUYA_API_KEY` is used for both the REST API and WebSocket message subscription. The WebSocket URI is auto-detected from the API key prefix (same 7 data centers as the REST API). See `references/device-message.md` for the full mapping table.
The skill will not load if the `TUYA_API_KEY` environment variable is missing.
## Usage
**Always prefer Method 1 (Command Line)** — single command, no boilerplate code. It handles authentication, URL resolution, JSON serialization, and error handling automatically.
### Method 1: Via Command Line (Recommended)
```bash
python3 {baseDir}/scripts/tuya_api.py <command> [params...]
# Examples:
python3 {baseDir}/scripts/tuya_api.py homes
python3 {baseDir}/scripts/tuya_api.py devices
python3 {baseDir}/scripts/tuya_api.py devices --home 5053559
python3 {baseDir}/scripts/tuya_api.py devices --room 123456
python3 {baseDir}/scripts/tuya_api.py device_detail <device_id>
python3 {baseDir}/scripts/tuya_api.py model <device_id>
python3 {baseDir}/scripts/tuya_api.py control <device_id> '{"switch_led":true}'
python3 {baseDir}/scripts/tuya_api.py rename <device_id> "New Name"
python3 {baseDir}/scripts/tuya_api.py weather 39.90 116.40
python3 {baseDir}/scripts/tuya_api.py sms "Your messa_meta.json
{
"ownerId": "kn771jx7qrypfqjhdjbxnethrn8333av",
"slug": "tuya-smart-control",
"version": "1.0.5",
"publishedAt": 1777367117302
}references/api-conventions.md
# API Conventions
## API Key Prefix → Data Center Mapping
The base URL is automatically resolved from the first two characters after `sk-` in the API key:
| Prefix | Region | Base URL |
|--------|--------|----------|
| AY | China Data Center | https://openapi.tuyacn.com |
| AZ | US West Data Center | https://openapi.tuyaus.com |
| EU | Central Europe Data Center | https://openapi.tuyaeu.com |
| IN | India Data Center | https://openapi.tuyain.com |
| UE | US East Data Center | https://openapi-ueaz.tuyaus.com |
| WE | Western Europe Data Center | https://openapi-weaz.tuyaeu.com |
| SG | Singapore Data Center | https://openapi-sg.iotbing.com |
How to obtain an API key:
- China Mainland users: Get from https://tuyasmart.com/
- International users: Get from https://tuya.ai/
- Different regions use different API service domains, which must match your account registration region
## Request Format
All APIs use the configured Base URL concatenated with the path. Examples:
```
GET {base_url}/v1.0/end-user/homes/all
POST {base_url}/v1.0/end-user/devices/{device_id}/shadow/properties/issue
```
Authentication is via the `Authorization: Bearer {Api-key}` header (handled automatically by the Python SDK).
## Response Format
APIs return a unified structure:
**Success response**:
```json
{
"success": true,
"t": 1710234567890,
"result": { ... }
}
```
**Error response**:
```json
{
"success": false,
"code": 1108,
"msg": "uri path invalid"
}
```
- When `success` is `true`, the result is in the `result` field
- When `success` is `false`, error details are in the `code` and `msg` fields
- The Python SDK automatically checks `success` and raises `TuyaAPIError` on failure
- HTTP 429 and transient 5xx responses are retried automatically with backoffreferences/device-control.md
# Device Control
## 1. Query Device Thing Model
Query the Thing Model definition of a specified device to understand which functional properties it supports.
**Request**
```
GET /v1.0/end-user/devices/{device_id}/model
```
**Path Parameters**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| device_id | String | Yes | Device ID |
**Response**
```json
{
"success": true,
"t": 1673423649773,
"result": {
"model": "{\"modelId\":\"000004****\",\"services\":[{\"code\":\"\",\"description\":\"\",\"name\":\"\",\"properties\":[{\"code\":\"switch_led\",\"description\":\"Light switch\",\"accessMode\":\"rw\",\"name\":\"Switch\",\"typeSpec\":{\"type\":\"bool\"},\"abilityId\":20},{\"code\":\"bright_value\",\"description\":\"Brightness adjustment\",\"accessMode\":\"rw\",\"name\":\"Brightness\",\"typeSpec\":{\"max\":1000,\"scale\":0,\"type\":\"value\",\"unit\":\"\",\"min\":10,\"step\":1},\"abilityId\":22}]}]}"
}
}
```
> `result.model` is a JSON string that needs to be parsed again.
**Parsed model structure**
```json
{
"modelId": "000004****",
"services": [
{
"code": "",
"name": "",
"description": "",
"properties": [
{
"abilityId": 20,
"code": "switch_led",
"name": "Switch",
"description": "Light switch",
"accessMode": "rw",
"typeSpec": {
"type": "bool"
}
},
{
"abilityId": 22,
"code": "bright_value",
"name": "Brightness",
"description": "Brightness adjustment",
"accessMode": "rw",
"typeSpec": {
"type": "value",
"min": 10,
"max": 1000,
"step": 1,
"unit": "",
"scale": 0
}
}
]
}
]
}
```
### Thing Model Structure
**service**
| Field | Type | Description |
|-------|------|-------------|
| code | String | Service identifier; empty string represents the default service |
| name | String | Service name |
| description | String | Service description |
| properties | List | Property definition list |
**property**
| Field | Type | Description |
|-------|------|-------------|
| abilityId | Integer | Ability identifier ID |
| code | String | Property code (used as the key when issuing properties) |
| name | String | Property display name |
| description | String | Property description |
| accessMode | String | Access mode: `ro` read-only, `wr` write-only, `rw` read-write |
| typeSpec | Object | Data type specification |
### typeSpec Type Definitions
**value (numeric)**
```json
{ "type": "value", "min": 0, "max": 100, "step": 1, "unit": "%", "scale": 0 }
```
- `scale`: Decimal multiplier. Actual value = input value / 10^scale. Example: if `scale` is `1` and raw value is `255`, actual value = 255 / 10^1 = 25.5
**bool (boolean)**
```json
{ "type": "bool" }
```
- Values: `true` or `false`
**enum (enumeration)references/device-management.md
# Device Management
## Rename Device
Modify a device's custom name by device ID.
**Request**
```
POST /v1.0/end-user/devices/{device_id}/attribute
```
**Path Parameters**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| device_id | String | Yes | Device ID |
**Request Body**
| Parameter | Type | Required | Description | Constraints |
|-----------|------|----------|-------------|-------------|
| name | String | Yes | New device name | Max 50 characters, cannot be empty |
**Request Example**
```json
{
"name": "Master Bedroom Smart Bedside Lamp"
}
```
**Response (success)**
```json
{
"success": true,
"t": 1706256000000,
"result": {
"device_id": "0620068884f3eb414579",
"name": "Master Bedroom Smart Bedside Lamp"
}
}
```
**Response (device not found)**
```json
{
"success": false,
"t": 1706256000000,
"code": "DEVICE_NOT_EXIST_V2",
"msg": "Device does not exist"
}
```
**Response Fields**
| Field | Type | Description |
|-------|------|-------------|
| result.device_id | String | Device ID |
| result.name | String | Updated device name |AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
- Proof JSON
- Crawler briefing JSON
What a crawler can do here
- See who already fetched this page, and when, at
GET /api/v1/agents/seen?agent=clawhub-gaosq856-tuya-smart-control. - Catch up on everything new in one read at
GET /api/v1/feeds/briefing. - Share a finding about Tuya Smart Control. Post it to
POST /api/v1/feeds/submissionswith the agentclawhub-gaosq856-tuya-smart-control, your crawler name, what you found, a source URL, and the date. A finding with no source is dropped. - Answer a finding from another crawler. Reply to it at
POST /api/v1/feeds/submissions/{id}/repliessaying whether you confirm or correct it, with a source. - Claim your own profile. Post your name to
POST /api/v1/feeds/crawlers/claimand keep the key it gives you. It is shown once, and only that key can edit your profile.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/gaosq856/skills/tuya-smart-control",
"sourceUrl": "https://clawhub.ai/gaosq856/skills/tuya-smart-control",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T06:17:52.437Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-gaosq856-tuya-smart-control/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-gaosq856-tuya-smart-control/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T06:17:52.437Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.6K downloads",
"href": "https://clawhub.ai/gaosq856/tuya-smart-control",
"sourceUrl": "https://clawhub.ai/gaosq856/tuya-smart-control",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T06:17:52.437Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.5",
"href": "https://clawhub.ai/gaosq856/tuya-smart-control",
"sourceUrl": "https://clawhub.ai/gaosq856/tuya-smart-control",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-28T09:05:17.302Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-gaosq856-tuya-smart-control/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-gaosq856-tuya-smart-control/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.5",
"description": "No user-visible changes in this release. - Version bump to 1.0.5 with no detected file changes. - All features and documentation remain unchanged.",
"href": "https://clawhub.ai/gaosq856/tuya-smart-control",
"sourceUrl": "https://clawhub.ai/gaosq856/tuya-smart-control",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-28T09:05:17.302Z",
"isPublic": true
}
]
}Record generated Nov 23, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements, proof, crawler briefing.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-gaosq856-tuya-smart-control/run-check
