← 返回 Skills 市场
ooxtcoo

Local Tuya Light Control

作者 ooxtcoo · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
64
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fully-local-tuya-light-control-skill-lsc-connect-app-devices
功能描述
Control local LSC/Tuya lamps and groups to turn on/off, set brightness, colors, white modes, query status, or onboard after repair or network changes.
使用说明 (SKILL.md)

This skill may be installed outside the Tuya project directory, so do not assume the project root is relative to this SKILL.md.

Use these default project locations first:

  • This Maschine - Windows: C:\Users\1111\.openclaw\workspace uya-lights
  • Windows: %USERPROFILE%\.openclaw\workspace uya-lights
  • Linux / Android / Termux: ~/src/tuya-lights

If the local installation uses a different location, adjust this SKILL.md to match the actual project path.

Prefer the Go CLI variant:

  • Windows: lampctl.exe
  • Linux / Android / Termux: lampctl

Use Python only as fallback when the CLI binary is not available.

Source of truth

  • Registry: tuya_lamps.json
  • Preferred CLI: lampctl.exe (Windows) or lampctl (Linux/Android)
  • Python fallback: lamp_control.py
  • Single-device probe: tuya_test_lamp.py
  • Recovery notes: KEY_EXTRACTION.md
  • New-device flow: ONBOARDING.md

Command patterns

Windows PowerShell / CMD (ohne cd, direkt mit .):

.\lampctl.exe stehlampe on
.\lampctl.exe stehlampe brightness --value 50
.\lampctl.exe stehlampe color --value rot
.\lampctl.exe kitchen off
.\lampctl.exe all off
.\lampctl.exe vorzimmer on

# Linux / Android / Termux (mit cd)
cd ~/src/tuya-lights && lampctl stehlampe on
cd ~/src/tuya-lights && lampctl stehlampe brightness --value 50
cd ~/src/tuya-lights && lampctl stehlampe color --value red
cd ~/src/tuya-lights && lampctl küche off
cd ~/src/tuya-lights && lampctl all off
cd ~/src/tuya-lights && lampctl vorzimmer on

# Python fallback only if CLI is unavailable
python lamp_control.py stehlampe on

Natural language mapping

  • an -> on
  • aus -> off
  • 50% -> brightness --value 50
  • rot/blau/grün/... -> color --value \x3Cname>
  • warmweiß -> warmwhite
  • kaltweiß -> coldwhite
  • alle Lampen -> group all
  • Vorzimmer -> group vorzimmer

Onboarding / repair

If a lamp was repaired, re-paired, or moved to another network, assume the local_key may have changed. Read KEY_EXTRACTION.md and ONBOARDING.md, refresh the key, test with the preferred CLI first (lampctl \x3Clamp> status), then use tuya_test_lamp.py --probe if Python fallback is needed, and finally update tuya_lamps.json.

Portability note

This skill intentionally prefers explicit standard project paths so it can still work after being copied into a separate OpenClaw skills directory. If a local installation uses a different layout, update this SKILL.md so the binary and project paths match that environment.

Current live lamps

  • kitchen
  • livingroom_floor
  • vorzimmer1
  • vorzimmer2
  • vorzimmer3
  • vorzimmer4

Live groups

  • all
  • vorzimmer

Discover devices

lampctl discover

  • Beispiel für diese Maschiene: C:\Users\1111\.openclaw\workspace uya-lights\lampctl.exe" stehlampe off
安全使用建议
This skill appears coherent for controlling locally installed Tuya/LSC lights, but it will read and update local configuration and key files. Before installing or invoking it: 1) verify the lampctl binary or the Python scripts are ones you trust and are located at the paths listed; 2) inspect tuya_lamps.json, KEY_EXTRACTION.md, and ONBOARDING.md to confirm they don't contain unexpected secrets or links; back up tuya_lamps.json before allowing modifications; 3) be aware local_key values in these files are sensitive (treat like device credentials); 4) don't run unknown binaries or copy this SKILL.md into an environment where those paths point to untrusted code; and 5) if you want stricter control, run commands manually or in a sandbox rather than letting an agent invoke them autonomously.
功能分析
Type: OpenClaw Skill Name: fully-local-tuya-light-control-skill-lsc-connect-app-devices Version: 1.0.0 The skill bundle contains instructions for an AI agent to execute local binaries (lampctl.exe) and Python scripts (lamp_control.py) using hardcoded, user-specific paths (e.g., C:\Users\1111\...). It also includes a meta-instruction for the agent to modify its own SKILL.md file if the project path differs, which is a risky behavior that could be exploited via prompt injection. While the stated goal of controlling Tuya lights is plausible, the reliance on unverified local binaries and the instruction for self-modification of the skill's logic are significant security concerns.
能力评估
Purpose & Capability
Name/description match the SKILL.md: all commands, file names (tuya_lamps.json, lampctl, lamp_control.py) and onboarding/repair flows are consistent with managing local Tuya/LSC lights.
Instruction Scope
The instructions explicitly read and update local project files (tuya_lamps.json, KEY_EXTRACTION.md, ONBOARDING.md) and run local binaries or Python scripts. This is expected for a local-device control skill, but it means the skill will access potentially sensitive local device keys and configuration files.
Install Mechanism
No install spec or external downloads are present — instruction-only skill that expects existing local binaries/scripts. This minimizes supply-chain risk.
Credentials
The skill declares no environment variables or external credentials, which is proportional. However, it does operate on local config files that likely contain device local_keys (sensitive). Access to those files is appropriate for the stated task but worth noting.
Persistence & Privilege
always:false and user-invocable:true — the skill does not request permanent/system-wide privileges. It edits only the stated local project files (tuya_lamps.json), which is consistent with its purpose.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fully-local-tuya-light-control-skill-lsc-connect-app-devices
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fully-local-tuya-light-control-skill-lsc-connect-app-devices 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
https://github.com/ooxtcoo/openclaw-tuya-lights openclaw-tuya-lights Local Tuya lights control for OpenClaw with two controller variants in one repo: Python controller (Python variant of the Tuya light controllers) Go CLI controller (standalone binary, no Python runtime needed for control) Project layout Shared files tuya_lamps.json – local device/group registry (commit only sanitized local_key values like xxxx) tuya_lamps.example.json – sanitized example registry for git tuya_device_catalog.json – capability/type metadata used by GUI gui-v1/ – web GUI + local API backend start-gui.bat – convenience starter Python variant lamp_control.py – Python Tuya controller discover_lamps.py – Python LAN discovery tuya_test_lamp.py – low-level lamp test Go CLI variant main.go go.mod internal/ – CLI + Tuya LAN protocol implementation prebuilt binaries can be used directly as lampctl.exe (Windows) or lampctl (Linux/Android-Termux) How backend mode is selected The GUI backend auto-detects what is available in the project root: if CLI binary exists (lampctl.exe on Windows / lampctl on Linux) → CLI available if lamp_control.py + discover_lamps.py exist → Python available if both exist → both can be selected in GUI if only one exists → that one is used The GUI shows only backend options that are actually available. Quick start (Windows) cd C:\Users\1111\.openclaw\workspace\tuya-lights\gui-v1 npm install npm start Open: http://127.0.0.1:5173 API backend runs on: http://127.0.0.1:4890 Quick start (Linux / Android / Termux) Recommended: work from a normal Linux/Termux home directory such as ~/src/tuya-lights, not from /sdcard/..., because Go builds and some tooling can fail on Android shared storage. Go CLI If the lampctl binary is already present, you can use it directly without rebuilding: cd ~/src/tuya-lights ./lampctl stehlampe status ./lampctl stehlampe on ./lampctl stehlampe brightness --value 50 ./lampctl discover If you want to compile it yourself: cd ~/src/tuya-lights go build -o lampctl GUI + API together cd ~/src/tuya-lights/gui-v1 npm install node start-all.mjs GUI: http://127.0.0.1:5173 API: http://127.0.0.1:4890 API only cd ~/src/tuya-lights/gui-v1 npm install npm run api GUI / dev frontend only cd ~/src/tuya-lights/gui-v1 npm install npm run dev Quick API test curl http://127.0.0.1:4890/api/health curl -X POST http://127.0.0.1:4890/api/status \ -H "Content-Type: application/json" \ -d '{"target":"stehlampe"}' Screenshot Tuya Lights GUI Python CLI examples python .\lamp_control.py stehlampe on python .\lamp_control.py stehlampe off python .\lamp_control.py stehlampe brightness --value 50 python .\lamp_control.py stehlampe color --value red python .\lamp_control.py all off Go CLI examples go build -o lampctl.exe . .\lampctl.exe stehlampe status .\lampctl.exe stehlampe on .\lampctl.exe stehlampe brightness --value 50 .\lampctl.exe stehlampe hue --value 180 .\lampctl.exe discover Security / keys tuya_lamps.json is required by the project, but committed versions must have local_key values sanitized (for example xxxx). Keep real keys local only. tuya_lamps.example.json is included as an additional sanitized example. FRIDA_HOOK/ contains the files and instructions users need to extract their own local keys for their devices. Without a valid local_key, local Tuya control will not work. Notes The Go CLI variant is the better default choice for most users because it is standalone and does not require Python, extra libraries, or dependency setup. In real use, the Go CLI version also switches lamps noticeably faster than the Python variant and can feel close to instant. The Python variant stays in the repo because it is easier to inspect and modify, but it requires Python and the tinytuya module. The included OpenClaw skill should prefer lampctl.exe on Windows and lampctl on Linux/Android via relative project paths. If an installation uses a different layout, adjust the paths in skills/tuya-lights/SKILL.md to match the local project root. After re-pairing / network repair, local keys can change. If control suddenly fails, refresh local_key values in local tuya_lamps.json.
元数据
Slug fully-local-tuya-light-control-skill-lsc-connect-app-devices
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Local Tuya Light Control 是什么?

Control local LSC/Tuya lamps and groups to turn on/off, set brightness, colors, white modes, query status, or onboard after repair or network changes. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 64 次。

如何安装 Local Tuya Light Control?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fully-local-tuya-light-control-skill-lsc-connect-app-devices」即可一键安装,无需额外配置。

Local Tuya Light Control 是免费的吗?

是的,Local Tuya Light Control 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Local Tuya Light Control 支持哪些平台?

Local Tuya Light Control 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Local Tuya Light Control?

由 ooxtcoo(@ooxtcoo)开发并维护,当前版本 v1.0.0。

💬 留言讨论