Install
openclaw skills install control-usb-relayControl USB relay modules with on/off switching, state tracking, and automation support.
openclaw skills install control-usb-relayUser wants to control a USB relay module to switch devices on/off or automate based on sensor input.
Verify Hardware First — Confirm relay is at /dev/ttyUSB1 and user is in dialout group.
Always Initialize — Call relay.connect() before any control. Wait 500ms for connection.
Use Correct Protocol — ON: A0 01 01 A2, OFF: A0 01 00 A1. Different modules may use different protocols.
State May Drift — get_status() tracks last command. May differ if manual override occurred.
Disconnect on Exit — Always call relay.disconnect() to release serial port.
No persistent storage. Relay state tracked in memory during session only.
| Endpoint | Purpose |
|---|---|
/dev/ttyUSB1 | Serial control |
| Topic | File |
|---|---|
| Setup & examples | setup.md |
| Troubleshooting | setup.md |