gadget-tuya-cloud-devices
Skill2.8k starsChanged 26 days agoApache-2.0View on GitHub
Read status and control the user's Tuya app devices through Tuya's cloud end-user API with a user-supplied API key: homes and rooms, device detail, thing-model property control, rename, weather, hourly statistics, self-send notifications, IPC cloud snapshots and real-time event subscription. Cloud only; prefer a device-specific or local-TCP skill when one matches. Switching heaters, valves, openers, irrigation or unknown loads needs the user's confirmation.
Trending
More talk lately.thin dataabout the whole repository
Who's talking about facebookincubator/muse-gadget-sdk
- @j4ck.xyz“I still wouldn't trust Meta with my personal context for agents, but what they're doing with Muse is pretty …”Bluesky · Oct 2, 2026 · 7 likes
- A Hacker News story“Open source SDK to build Muse gadgets”Hacker News · Oct 3, 2026 · 2 points
- ComBba/muse-gadget-sdk“CI preflight: wait for the installer serial close before SDK token setup”GitHub · Oct 17, 2026 · 1 reactions
- @sarubot.bsky.social“muse-gadget-sdk — Metaが放つ、ESP32やラズパイをAIガジェットへ変貌させるSDK。今週スター急増中の注目作! …”Bluesky · Oct 7, 2026 · 1 likes
- aegisfleet/tool-survey-report“feat: add survey report for Muse Gadget SDK”GitHub · Nov 9, 2026
The biggest 5 of 14 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 14
Talked about on GitHub, Bluesky and Hacker News (14 times).
On GitHub · 11
- Oct 17, 2026CI preflight: wait for the installer serial close before SDK token setup — ComBba/muse-gadget-sdk1 reaction · 2 comments
- Nov 9, 2026feat: add survey report for Muse Gadget SDK — aegisfleet/tool-survey-report0 reactions · 4 comments
- Oct 14, 2026Fix S3-2.06 ES7210 microphone and native USB serial console — polygoku/waveshare-amoled-206-debug0 reactions · 5 comments
- Oct 12, 2026Integration blocker: native Muse gadget command invocation — 1chris2many/muse-portal-kit0 reactions
- Oct 12, 2026Integration blocker: authoritative per-device reply correlation — 1chris2many/muse-portal-kit0 reactions · 2 comments
6 more on GitHub
- Oct 11, 2026[fork CI preflight] #181 candidate a6fd89c — ComBba/muse-gadget-sdk0 reactions · 1 comment
- Oct 11, 2026[fork CI] #179 Use the custom avatar in the UI simulator — ComBba/muse-gadget-sdk0 reactions · 1 comment
- Oct 11, 2026[fork CI] #181 Add validated avatar restore and host status — ComBba/muse-gadget-sdk0 reactions · 1 comment
- Oct 11, 2026[fork CI] #180 Validate avatar candidates before replacing the current renderer — ComBba/muse-gadget-sdk0 reactions · 1 comment
- Oct 11, 2026[fork CI] #174 Reject incomplete bench screenshots without padding pixels — ComBba/muse-gadget-sdk0 reactions · 1 comment
- Oct 11, 2026[fork CI] #177 Abort bench screenshots when USB console output stalls — ComBba/muse-gadget-sdk0 reactions · 1 comment
On Bluesky · 2
- Oct 2, 2026I still wouldn't trust Meta with my personal context for agents, but what they're doing with Muse is pretty cool & fun icl… — @j4ck.xyz7 likes and reposts
- Oct 7, 2026muse-gadget-sdk — Metaが放つ、ESP32やラズパイをAIガジェットへ変貌させるSDK。今週スター急増中の注目作! ・C言語製のESP32/Linux用SDK。センサーやオーディオをMuseエコシステムに即統合 ・AIエージェント「Muse… — @sarubot.bsky.social1 likes and repost
On Hacker News · 1
- Oct 3, 2026Open source SDK to build Muse gadgets2 points
In this repository57 other files it gives its agents.
- esp32/AGENTS.mdAGENTS.md
- linux/AGENTS.mdAGENTS.md
- gadget-amazon-echoSkill
- gadget-apple-homepod-miniSkill
- gadget-apple-tv-4kSkill
- gadget-bambu-lab-p2sSkill
- gadget-bambu-lab-printersSkill
- gadget-brother-printersSkill
- gadget-dyson-pure-hot-cool-hp04Skill
- gadget-ecowitt-gatewaysSkill
- gadget-elgato-key-lightSkill
- gadget-epson-printersSkill
- gadget-esphome-devicesSkill
- gadget-espsomfy-rtsSkill
- gadget-eufy-robovac-tuyaSkill
- gadget-freebox-player-popSkill
- gadget-google-castSkill
- gadget-google-home-maxSkill
- gadget-google-home-speakerSkill
- gadget-google-nest-audioSkill
- gadget-google-nest-hub-maxSkill
- gadget-google-nest-hubSkill
- gadget-google-nest-miniSkill
- gadget-google-nest-thermostatsSkill
- gadget-google-pixel-tabletSkill
- gadget-google-tv-streamerSkill
- gadget-homewhiz-laundrySkill
- gadget-hp-color-laserjet-pro-m254dwSkill
- gadget-insignia-fire-tvSkill
- gadget-irobot-roomba-braavaSkill
- gadget-lg-webos-tvsSkill
- gadget-logitech-squeezeboxSkill
- gadget-lutron-smart-bridgesSkill
- gadget-meross-smart-plugsSkill
- gadget-miele-g7566-dishwasherSkill
- gadget-moonraker-3d-printersSkill
- gadget-philips-hue-bridgesSkill
- gadget-pixoo-64Skill
- gadget-ratgdo-v32-garage-doorSkill
- gadget-roborock-vacuumsSkill
- gadget-roku-tvs-and-playersSkill
- gadget-samsung-tizen-tvsSkill
- gadget-shelly-plugsSkill
- gadget-sinricpro-cloud-devicesSkill
- gadget-sonoff-rf-bridgeSkill
- gadget-sonos-speakersSkill
- gadget-teslaSkill
- gadget-tplink-kasa-ep10Skill
- gadget-tplink-kasa-ep25Skill
- gadget-tuya-wifi-devicesSkill
- gadget-unifi-network-consolesSkill
- gadget-velux-klf200Skill
- gadget-vesync-humidifierSkill
- gadget-vizio-d40f-g9Skill
- gadget-wyze-rtsp-camerasSkill
- gadget-yi-hack-camerasSkill
- gadget-zigbee2mqtt-gatewaysSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Use this skill when the user supplies a Tuya end-user API key (sk-...) and asks to control or query devices from their Tuya app account.
- Very specific: line 20
Read and follow the Home Link networking and safety rules in ~/docs/devices/home_link.md.
- Very specific: line 52
Read GET /v1.0/end-user/devices/{device_id}/detail.
- Very specific: line 55
Read the thing model GET /v1.0/end-user/devices/{device_id}/model.
- Distinctive: line 75
Before switching a heater, valve, garage or door opener, irrigation controller, or a socket, plug or switch whose load is unknown, read …
- Distinctive: line 88
Wait 1–2 seconds, re-read the detail and compare the mapped value with the requested value before reporting success.
- Distinctive: line 91
If the value does not match or the device went offline, say so.
- Distinctive: line 146
Start it only when the user asks for ongoing monitoring or automation, and run one instance per key.
- Distinctive: line 171
No lock/unlock, live video streaming, firmware updates, pairing or device removal — say so and point to the Tuya app.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tuya Cloud Devices: End-User API Control
Use this skill when the user supplies a Tuya end-user API key (sk-...) and asks to control or
query devices from their Tuya app account. Devices are reached in the cloud, so no local keys or
model-specific datapoint maps are needed. For direct local-TCP control with a confirmed key and
datapoint schema, prefer Tuya Wi-Fi devices.
Prerequisites
Read and follow the Home Link networking and safety rules in ~/docs/devices/home_link.md.
- A user-supplied end-user API key, applied for at https://tuya.ai/. Treat it as a credential: keep it in a file only the user can read and load it from there for REST calls as well as the subscriber. Pass it in a header, never on a command line, and never log or echo it.
Send
Authorization: Bearer <key>on every call. Pick the base URL from the first two characters aftersk-; it must match the account's region. If the prefix is not listed, ask the user to confirm the key was issued for an international account at https://tuya.ai/.- Responses share one envelope:
{"success": true, "result": ...}or{"success": false, "code", "msg"}. On1010the key expired — ask for a fresh one. On429back off and honorRetry-After. List endpoints return everything in one response; there is no pagination.
Workflow
- List homes with
GET /v1.0/end-user/homes/all, and rooms withGET /v1.0/end-user/homes/{home_id}/roomswhen the user names one. - Locate the device:
GET /v1.0/end-user/devices/all, or scope to.../homes/{home_id}/devicesor.../homes/room/{room_id}/devices. Each entry inresult.devices[]carriesdevice_id,name,category,category_name,onlineand, under a home scope,room_id. Match the user's words againstcategory_namefirst, then fuzzy-matchname. With multiple matches, list the candidates with their rooms and ask. - Read
GET /v1.0/end-user/devices/{device_id}/detail. Anullresultmeans the device does not exist or the key has no access — stop.online: falsemeans report the device as offline and command nothing.result.propertiesmaps each property code to its current value. - Read the thing model
GET /v1.0/end-user/devices/{device_id}/model. Itsresult.modelfield is a JSON string that needs a second parse.services[].properties[]then defines each property'scode,accessMode(rois read-only — say so;wris write-only and cannot be read back) andtypeSpec:value:min,max,stepandscale— the real-world value is the raw number divided by 10^scale.enum: the issued value must be one ofrange.bool/string:true/false, andmaxlenrespectively. Common codes areswitch_led/switch(bool power),bright_value/temp_value(0–1000),temp_set(16–30) andmode(enum) — the model response is always authoritative.
- Issue
POST /v1.0/end-user/devices/{device_id}/shadow/properties/issuewith a body whosepropertiesvalue is a JSON string, not an object — it is double-serialized:{"properties": "{\"switch_led\":true}"}. An emptyresultobject means the command was accepted, not that it took effect. For relative asks ("a bit brighter"), adjust the current value by 10% of the typeSpec range for vague amounts or by the stated amount exactly, clamp to[min, max], honorscaleand round tostep. A relative ask needs a readable current value; for awrproperty, ask for an absolute value instead.
Confirm Before Acting
- Before switching a heater, valve, garage or door opener, irrigation controller, or a socket, plug or switch whose load is unknown, read back the device, its room, the property and the value, and wait for the user's yes. A yes covers that one command only.
- Judge this by the device's
categoryfrom the device list, not only by its name: for exampleqn,rs,dranddbl(heaters),sfkzqandggq(valves and irrigation),ckmkzqandmk(garage doors and access control), andcz,pcandkg(sockets, power strips and switches, unless the user has said what they power and it is none of these). Confirm an unfamiliar category the same way. - An automation's confirmed trigger→action mapping covers its later actions only if it names the device and the action.
Verify the Result
- Wait 1–2 seconds, re-read the detail and compare the mapped value with the requested value before reporting success. A value that already matched before the write is a success.
- A
wrproperty cannot be read back: report the command as accepted but unverified. - If the value does not match or the device went offline, say so; do not report success.
Also Available
- Rename:
POST /v1.0/end-user/devices/{device_id}/attributewith{"name": "..."}, max 50 characters. - Weather:
GET /v1.0/end-user/services/weather/recentwithlat,lonandcodes— a URL-encoded JSON array of attribute codes such asw.temp,w.humidity,w.condition,w.conditionNum,w.pressure,w.realFeel,w.uvi,w.windDir,w.windLevel,w.windSpeed, plusw.hour.Nto set the forecast horizon to the next N hours. Response keys are{code}.{index}with index0meaning now. Use the home'slatitude/longitudefrom the homes list, shaped{"Value": "30.3"}— read the innerValue. If the home has none set, ask the user for their city and use its latitude and longitude. - Hourly statistics: confirm capability with
GET /v1.0/end-user/statistics/hour/config(items carrydev_id,dp_code,statistic_typeofSUM/COUNT/MAX/MIN), thenGET .../hour/data?dev_id=..&dp_code=..&statistic_type=..&start_time=..&end_time=... Times areyyyyMMddHHand one request spans at most 24 hours; split longer ranges and aggregate. Values return as an array of{time: value}pairs with string values. - Notifications are self-send only — they reach the key's own user, nobody else:
POST /v1.0/end-user/services/{sms|voice|mail|push}/self-send. SMS and voice take{"message": "..."}; mail and push take{"subject": "...", "content": "..."}. Rate and duplicate limits apply (per contact: 15–30 per day, identical content more than twice within 50 seconds is refused). - IPC cloud snapshots (cameras): first ask the user to confirm they want a capture from
that camera and a decrypted, viewable link to it. A request for a snapshot is not by itself
that consent; if they decline, do not capture.
- Allocate with
POST /v1.0/end-user/ipc/{device_id}/capture/allocateand body{"capture_json": "<json string>"}— double-serialized like property issue. The string carriesdevice_id,capture_type(PICorVIDEO), optionallypic_count(clamped to 1–5),video_duration_seconds(1–60, default 10) andhome_id. Allocate only reserves an upload slot:result.statusisACCEPTEDorREJECTEDandresultcarriesbucket,encryption_keyand the object key(s) (image_object_key, and for VIDEO alsovideo_object_key/cover_image_object_key) — never a media URL; the device still has to capture and upload. Withpic_countabove 1,pic_slots[]holds per-snapshot keys. - Resolve with
POST .../capture/resolveand aresolve_jsonstring echoingdevice_id,capture_type,bucket,encryption_keyand the object key(s) — one resolve perpic_slots[]entry, with that slot's key andencryption_key. Setuser_privacy_consent_accepted: trueonly after the user's explicit yes for this capture; never set it on their behalf. It returns the decrypteddecrypt_image_url/decrypt_video_url(anddecrypt_cover_image_url); without it, resolve returns encryptedraw_presigned_*URLs that cannot be viewed. status: NOT_READYmeans keep polling — for PIC sleep 2 s, then resolve every 2 s up to 30 s, then retry up to 3 times 3 s apart; for VIDEO sleepmax(5, video_duration_seconds_effective) + 2s using the clamped duration from the allocate response, then resolve every 2 s up to 120 s, then retry up to 3 times 5 s apart. A video's cover image can lag the video itself — checkmessage_for_user.- The link is private camera footage: give it only to the requesting user; never log or forward it.
- Allocate with
Real-Time Subscription
Property changes and online/offline transitions are also pushed over WebSocket. This is a
long-lived process for an always-on host (a Linux gadget), not a one-shot query. Write a short
Python script using the websockets package:
- Start it only when the user asks for ongoing monitoring or automation, and run one instance per key. Read the key from the user-only file (see Prerequisites) instead of writing it into the script, and tell the user where it runs and how to stop it.
- URI by key prefix (same mapping as the REST table): AZ
wss://wsmsgs.iot-wus.com, EUwss://wsmsgs.iot-eu.com, INwss://wsmsgs.iot-ap.com, UEwss://wsmsgs.iot-eus.com, WEwss://wsmsgs.iot-weu.com, SGwss://wsmsgs.iot-sea.com. - Auth: an
Authorization: <key>header on the handshake — the same key as REST but without theBearerprefix. - Frames are JSON with two top-level fields,
eventTypeanddata. AdevicePropertyChangecarriesdata.devIdanddata.status[], each withcode,valueandtime(ms); anonlineStatusChangecarriesdata.devId,data.status("online"/"offline") anddata.time. - Codes match thing-model codes. Look their meanings up via the model endpoint instead of guessing from the code string.
- Reconnect with backoff on transient drops. Treat close codes 1002, 1003 and 1008 as fatal.
Close code 1011 is a server error: retry it a few times with growing backoff, then stop and
tell the user. A frame containing
error,errorMsg, a failingerrorCode, or"success": falseis a server error: stop and report it. - For event-driven automation, on a matching trigger issue properties to the action device as in Workflow step 5, and confirm the trigger→action mapping with the user before running it.
Limits
- Control only basic property types (bool, enum, integer
value, string). Never writeraw,bitmap,structorarrayproperties, or anything absent from the thing model. - No lock/unlock, live video streaming, firmware updates, pairing or device removal — say so and point to the Tuya app.
- Device listing takes one scope at a time (all, home or room). Rate-limit batch writes with a short delay between commands.
- Notifications triggered by device events must cool down at least 30 minutes — property events fire frequently.
- These are the user's own account devices behind an end-user key; never attempt another user's devices.
Sources
- tuya-openclaw-skills — upstream skill this was adapted from.
- Tuya developer docs
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

