← Back to Skills Marketplace
lj-hao

Control Usb Relay

by jiahaoli · GitHub ↗ · v1.0.2 · MIT-0
linux ✓ Security Clean
184
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install control-usb-relay
Description
Control USB relay modules with on/off switching, state tracking, and automation support.
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install control-usb-relay
  3. After installation, invoke the skill by name or use /control-usb-relay
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug control-usb-relay
Version 1.0.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Control Usb Relay?

Control USB relay modules with on/off switching, state tracking, and automation support. It is an AI Agent Skill for Claude Code / OpenClaw, with 184 downloads so far.

How do I install Control Usb Relay?

Run "/install control-usb-relay" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Control Usb Relay free?

Yes, Control Usb Relay is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Control Usb Relay support?

Control Usb Relay is cross-platform and runs anywhere OpenClaw / Claude Code is available (linux).

Who created Control Usb Relay?

It is built and maintained by jiahaoli (@lj-hao); the current version is v1.0.2.

💬 Comments