← 返回 Skills 市场
lj-hao

Control Usb Relay

作者 jiahaoli · GitHub ↗ · v1.0.2 · MIT-0
linux ✓ 安全检测通过
184
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install control-usb-relay
功能描述
Control USB relay modules with on/off switching, state tracking, and automation support.
使用说明 (SKILL.md)

When to Use

User wants to control a USB relay module to switch devices on/off or automate based on sensor input.

Core Rules

  1. Verify Hardware First — Confirm relay is at /dev/ttyUSB1 and user is in dialout group.

  2. Always Initialize — Call relay.connect() before any control. Wait 500ms for connection.

  3. Use Correct Protocol — ON: A0 01 01 A2, OFF: A0 01 00 A1. Different modules may use different protocols.

  4. State May Driftget_status() tracks last command. May differ if manual override occurred.

  5. Disconnect on Exit — Always call relay.disconnect() to release serial port.

Data Storage

No persistent storage. Relay state tracked in memory during session only.

External Endpoints

Endpoint Purpose
/dev/ttyUSB1 Serial control

Quick Reference

Topic File
Setup & examples setup.md
Troubleshooting setup.md

Security Notes

  • Physical device control — confirm with user before switching
  • Some relays need external 5V/12V power supply
安全使用建议
This skill appears internally coherent for local USB relay control. Before installing: (1) ensure you have the physical relay and that you want software to be able to switch it (this is hardware actuation—test on a safe circuit), (2) add your user to the dialout group and install pyserial, (3) review relay.py (it writes bytes to the serial port and will actuate hardware), and (4) consider the agent autonomy settings: allowing an AI to call this skill lets it turn devices on/off without additional confirmation. If you don't trust the source, run it in an isolated test environment or review/modify the code to add confirmations or safeguards.
功能分析
Type: OpenClaw Skill Name: control-usb-relay Version: 1.0.2 The skill provides legitimate functionality for controlling a USB relay module via serial communication on /dev/ttyUSB1. The implementation in relay.py uses the standard pyserial library to send specific hex commands (e.g., A0 01 01 A2) to the hardware, and the documentation (SKILL.md, README.md) is consistent with this purpose, including appropriate security warnings about physical device control.
能力评估
Purpose & Capability
Name/description, README, SKILL.md, and relay.py all consistently implement local USB relay control using a serial port (/dev/ttyUSB1) and pyserial. Required binary (python3) and requirements.txt (pyserial) match the purpose. Documentation references optional companion tools (ClawHub, NanoBot) but those are usage/integration suggestions, not required for the relay functionality.
Instruction Scope
SKILL.md instructs only to verify hardware, connect to the serial port, send known 4-byte commands, track state in memory, and disconnect. There are no instructions to read unrelated files, exfiltrate data, or contact external network endpoints. The only 'endpoint' referenced is the local serial device (/dev/ttyUSB1).
Install Mechanism
No install spec is declared (instruction-only), and the included code is simple Python that depends on pyserial (requirements.txt). There are no remote downloads, obscure URLs, or archive extraction steps in the package metadata.
Credentials
The skill declares no required environment variables or credentials. The docs mention configuring an AI agent with an API key as an unrelated integration example, but relay.py itself does not read environment variables or secrets.
Persistence & Privilege
always is false and the skill does not request persistent system changes or modify other skills. Note: autonomous invocation is allowed (platform default) which means an agent could actuate hardware without further prompts — this is normal but worth considering because the capability controls physical devices.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install control-usb-relay
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /control-usb-relay 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
Version 1.0.2 - Added a new USAGE-GUIDE.md file for improved user guidance. - Updated SKILL.md and _meta.json with minor changes. - No changes to core logic or functionality.
v1.0.1
- Added a README.md file for improved documentation. - Updated version to 1.0.1 in metadata. - Minor updates for consistency in SKILL.md and _meta.json.
v1.0.0
Initial release for USB relay control. - Enables on/off switching, state tracking, and automation for USB relay modules. - Requires relay module at /dev/ttyUSB1 and user in dialout group. - Uses a specific serial protocol for relay commands (ON: A0 01 01 A2, OFF: A0 01 00 A1). - Monitors relay state in memory without persistent storage. - Provides setup and troubleshooting guidance in setup.md. - User confirmation required before switching devices for safety.
元数据
Slug control-usb-relay
版本 1.0.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Control Usb Relay 是什么?

Control USB relay modules with on/off switching, state tracking, and automation support. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 184 次。

如何安装 Control Usb Relay?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install control-usb-relay」即可一键安装,无需额外配置。

Control Usb Relay 是免费的吗?

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

Control Usb Relay 支持哪些平台?

Control Usb Relay 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux)。

谁开发了 Control Usb Relay?

由 jiahaoli(@lj-hao)开发并维护,当前版本 v1.0.2。

💬 留言讨论