Roku Control
Control Roku devices over your local network using the External Control Protocol (ECP). No authentication, cloud services, or complex setup required - just local HTTP commands.
Prerequisites
- - Roku device on the same network as OpenClaw
- Roku's IP address (can be discovered automatically)
Setup (First Time)
1. Discover your Roku:
CODEBLOCK0
This will show all Roku devices on your network with their IP addresses.
2. Save the IP address:
Note your Roku's IP (e.g., 192.168.1.100) for use in commands.
3. Test connectivity:
CODEBLOCK1
Common Operations
Device Information
CODEBLOCK2
Navigation & Control
CODEBLOCK3
Playback
CODEBLOCK4
Volume & Power
CODEBLOCK5
Launch Apps
CODEBLOCK6
Search & Text Input
CODEBLOCK7
Natural Language Translation
Map user requests to commands:
Navigation:
- - "Go to home screen" → INLINECODE1
- "Go back" → INLINECODE2
- "Scroll down" / "Move down" → INLINECODE3
- "Select this" / "Click" → INLINECODE4
Playback:
- - "Play" / "Resume" → INLINECODE5
- "Pause" → INLINECODE6
- "Rewind" → INLINECODE7
- "Fast forward" → INLINECODE8
- "Go back 10 seconds" / "Replay that" → INLINECODE9
Volume:
- - "Turn up the volume" → INLINECODE10
- "Turn down the volume" → INLINECODE11
- "Mute" / "Unmute" → INLINECODE12
Apps:
- - "Open Netflix" → INLINECODE13
- "Launch YouTube" → INLINECODE14
- "Start Hulu" → INLINECODE15
Search:
- - "Search for Breaking Bad" → INLINECODE16
- "Find Stranger Things" → Open search + send text
Power:
- - "Turn off the TV" → INLINECODE17
Common App IDs
See references/common-apps.md for a comprehensive list.
Quick reference:
- - Netflix: 12
- YouTube: 837
- Hulu: 2285
- Disney+: 291097
- Amazon Prime Video: 13
- HBO Max: 61322
- The Roku Channel: 151908
To get app IDs for your specific Roku:
CODEBLOCK8
Complete Key Reference
See references/remote-keys.md for all supported remote keys.
Common keys: Home, Back, Up, Down, Left, Right, Select, Play, Pause, Rev, Fwd, VolumeUp, VolumeDown, VolumeMute, PowerOff, Search, INLINECODE34
Advanced Workflows
Watch Netflix
CODEBLOCK9
Search and Play
CODEBLOCK10
Quick Replay
CODEBLOCK11
Movie Night Setup
CODEBLOCK12
Device Mapping
Store your Roku IP in references/roku.json:
CODEBLOCK13
Then reference by friendly name in conversations.
Troubleshooting
"No Roku devices found"
- - Ensure Roku is powered on and connected to network
- Check that OpenClaw and Roku are on same network/subnet
- Some routers block SSDP discovery - try manual IP if known
- Verify Roku's network settings in Settings → Network
"Connection timeout"
- - Verify IP address is correct
- Ping the Roku: INLINECODE36
- Check firewall isn't blocking port 8060
- Roku may have changed IP (use DHCP reservation)
"Key not working"
- - Some keys only work on Roku TVs (volume, power, inputs)
- Volume keys require HDMI-CEC or Roku TV
- Power commands may not be supported on older devices
- Check references/remote-keys.md for compatibility
App won't launch
- - Verify app is installed: run
apps command - Use correct app ID (case-sensitive for name matching)
- Some apps require additional authentication in their own UI
Discovery not finding device
- - Try manual IP if you know it: check router DHCP leases
- Roku's IP is shown in Settings → Network → About
- Set static IP or DHCP reservation for reliability
Integration with Other Skills
Movie Night Routine
Combine with Govee lights skill:
CODEBLOCK14
Notes
- - ECP protocol works entirely over LAN (no internet required)
- No authentication or API keys needed
- Commands are instant (local network speed)
- Multiple Roku devices can be controlled independently
- Works with Roku TVs, streaming sticks, and boxes
- Power-on commands not supported (ECP limitation - Roku must be awake)
- For power-on, use HDMI-CEC or network wake features if available
Limitations
- - Cannot power on a fully-off Roku (ECP only works when device is on)
- Volume/power commands limited to Roku TVs or HDMI-CEC setups
- No feedback on success/failure for some commands
- Text input is character-by-character (slower for long searches)
- Discovery requires SSDP (some networks block multicast)
Roku 控制
使用外部控制协议(ECP)通过本地网络控制 Roku 设备。无需认证、云服务或复杂设置——仅需本地 HTTP 命令。
前提条件
- - Roku 设备与 OpenClaw 处于同一网络
- Roku 的 IP 地址(可自动发现)
设置(首次使用)
1. 发现您的 Roku:
bash
python3 scripts/roku_control.py discover
这将显示网络上所有 Roku 设备及其 IP 地址。
2. 保存 IP 地址:
记下您的 Roku IP(例如 192.168.1.100)以便在命令中使用。
3. 测试连接:
bash
python3 scripts/roku_control.py --ip 192.168.1.100 info
常用操作
设备信息
bash
获取设备详情
python3 scripts/roku_control.py --ip 192.168.1.100 info
列出所有已安装应用
python3 scripts/roku_control.py --ip 192.168.1.100 apps
查看当前播放内容
python3 scripts/roku_control.py --ip 192.168.1.100 active
导航与控制
bash
导航菜单
python3 scripts/roku_control.py --ip 192.168.1.100 key Up
python3 scripts/roku_control.py --ip 192.168.1.100 key Down
python3 scripts/roku_control.py --ip 192.168.1.100 key Left
python3 scripts/roku_control.py --ip 192.168.1.100 key Right
python3 scripts/roku_control.py --ip 192.168.1.100 key Select
返回主页
python3 scripts/roku_control.py --ip 192.168.1.100 key Home
返回上一级
python3 scripts/roku_control.py --ip 192.168.1.100 key Back
播放控制
bash
播放/暂停
python3 scripts/roku_control.py --ip 192.168.1.100 key Play
python3 scripts/roku_control.py --ip 192.168.1.100 key Pause
快退/快进
python3 scripts/roku_control.py --ip 192.168.1.100 key Rev
python3 scripts/roku_control.py --ip 192.168.1.100 key Fwd
即时重播(后退10秒)
python3 scripts/roku_control.py --ip 192.168.1.100 key InstantReplay
音量与电源
bash
音量控制(Roku TV 或启用 HDMI-CEC)
python3 scripts/roku_control.py --ip 192.168.1.100 key VolumeUp
python3 scripts/roku_control.py --ip 192.168.1.100 key VolumeDown
python3 scripts/roku_control.py --ip 192.168.1.100 key VolumeMute
关机
python3 scripts/roku_control.py --ip 192.168.1.100 key PowerOff
启动应用
bash
通过应用ID启动(更快)
python3 scripts/roku_control.py --ip 192.168.1.100 launch 12 # Netflix
通过应用名称启动(不区分大小写)
python3 scripts/roku_control.py --ip 192.168.1.100 launch Netflix
python3 scripts/roku_control.py --ip 192.168.1.100 launch YouTube
python3 scripts/roku_control.py --ip 192.168.1.100 launch Disney+
搜索与文本输入
bash
发送搜索文本
python3 scripts/roku_control.py --ip 192.168.1.100 text Breaking Bad
这比逐个按键搜索快得多
自然语言翻译
将用户请求映射到命令:
导航:
- - 前往主屏幕 → key Home
- 返回 → key Back
- 向下滚动 / 向下移动 → key Down
- 选择这个 / 点击 → key Select
播放:
- - 播放 / 继续 → key Play
- 暂停 → key Pause
- 快退 → key Rev
- 快进 → key Fwd
- 后退10秒 / 重播那个 → key InstantReplay
音量:
- - 调高音量 → key VolumeUp
- 调低音量 → key VolumeDown
- 静音 / 取消静音 → key VolumeMute
应用:
- - 打开 Netflix → launch Netflix
- 启动 YouTube → launch YouTube
- 开始 Hulu → launch Hulu
搜索:
- - 搜索 Breaking Bad → text Breaking Bad
- 查找 Stranger Things → 打开搜索 + 发送文本
电源:
常用应用ID
完整列表请参见 references/common-apps.md。
快速参考:
- - Netflix: 12
- YouTube: 837
- Hulu: 2285
- Disney+: 291097
- Amazon Prime Video: 13
- HBO Max: 61322
- The Roku Channel: 151908
获取您特定 Roku 的应用ID:
bash
python3 scripts/roku_control.py --ip apps
完整按键参考
所有支持的遥控器按键请参见 references/remote-keys.md。
常用按键:Home、Back、Up、Down、Left、Right、Select、Play、Pause、Rev、Fwd、VolumeUp、VolumeDown、VolumeMute、PowerOff、Search、Info
高级工作流
观看 Netflix
bash
返回主页,启动 Netflix
python3 scripts/roku_control.py --ip 192.168.1.100 key Home
sleep 1
python3 scripts/roku_control.py --ip 192.168.1.100 launch 12
搜索并播放
bash
打开搜索,发送文本,选择第一个结果
python3 scripts/roku_control.py --ip 192.168.1.100 key Search
sleep 1
python3 scripts/roku_control.py --ip 192.168.1.100 text The Office
sleep 1
python3 scripts/roku_control.py --ip 192.168.1.100 key Select
快速重播
bash
后退10秒并继续播放
python3 scripts/roku_control.py --ip 192.168.1.100 key InstantReplay
sleep 1
python3 scripts/roku_control.py --ip 192.168.1.100 key Play
电影之夜设置
bash
启动流媒体应用,调整音量
python3 scripts/roku_control.py --ip 192.168.1.100 launch Disney+
sleep 2
python3 scripts/roku_control.py --ip 192.168.1.100 key VolumeDown
python3 scripts/roku_control.py --ip 192.168.1.100 key VolumeDown
设备映射
将您的 Roku IP 存储在 references/roku.json 中:
json
{
living_room: {
ip: 192.168.1.100,
name: 客厅电视,
model: Roku Ultra
},
bedroom: {
ip: 192.168.1.101,
name: 卧室 Roku,
model: Roku Streaming Stick+
}
}
然后在对话中通过友好名称引用。
故障排除
未找到 Roku 设备
- - 确保 Roku 已开机并连接到网络
- 检查 OpenClaw 和 Roku 是否在同一网络/子网
- 某些路由器会阻止 SSDP 发现——如果知道 IP,请尝试手动输入
- 在设置 → 网络中验证 Roku 的网络设置
连接超时
- - 验证 IP 地址是否正确
- Ping Roku:ping
- 检查防火墙是否阻止了端口 8060
- Roku 可能已更改 IP(使用 DHCP 保留)
按键不起作用
- - 某些按键仅适用于 Roku TV(音量、电源、输入)
- 音量键需要 HDMI-CEC 或