Control Usb Relay

v1.0.2

Control USB relay modules with on/off switching, state tracking, and automation support.

0· 196· 3 versions· 0 current· 0 all-time· Updated 8h ago· MIT-0
byjiahaoli@lj-hao

Install

openclaw skills install control-usb-relay

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

EndpointPurpose
/dev/ttyUSB1Serial control

Quick Reference

TopicFile
Setup & examplessetup.md
Troubleshootingsetup.md

Security Notes

  • Physical device control — confirm with user before switching
  • Some relays need external 5V/12V power supply

Version tags

latestvk978t7h3bzavy3x09401ste5cn832ma9

Runtime requirements

🔌 Clawdis
OSLinux
Binspython3