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.
1. Discover your Roku:
python3 scripts/roku_control.py discover
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:
python3 scripts/roku_control.py --ip 192.168.1.100 info
# Get device details
python3 scripts/roku_control.py --ip 192.168.1.100 info
# List all installed apps
python3 scripts/roku_control.py --ip 192.168.1.100 apps
# See what's currently playing
python3 scripts/roku_control.py --ip 192.168.1.100 active
# Navigate menus
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
# Go home
python3 scripts/roku_control.py --ip 192.168.1.100 key Home
# Go back
python3 scripts/roku_control.py --ip 192.168.1.100 key Back
# Play/pause
python3 scripts/roku_control.py --ip 192.168.1.100 key Play
python3 scripts/roku_control.py --ip 192.168.1.100 key Pause
# Rewind/fast forward
python3 scripts/roku_control.py --ip 192.168.1.100 key Rev
python3 scripts/roku_control.py --ip 192.168.1.100 key Fwd
# Instant replay (back 10 seconds)
python3 scripts/roku_control.py --ip 192.168.1.100 key InstantReplay
# Volume control (Roku TV or HDMI-CEC enabled)
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
# Power off
python3 scripts/roku_control.py --ip 192.168.1.100 key PowerOff
# Launch by app ID (faster)
python3 scripts/roku_control.py --ip 192.168.1.100 launch 12 # Netflix
# Launch by app name (case-insensitive)
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+"
# Send search text
python3 scripts/roku_control.py --ip 192.168.1.100 text "Breaking Bad"
# This is much faster than individual key presses for searches
Map user requests to commands:
Navigation:
key Homekey Backkey Downkey SelectPlayback:
key Playkey Pausekey Revkey Fwdkey InstantReplayVolume:
key VolumeUpkey VolumeDownkey VolumeMuteApps:
launch Netflixlaunch YouTubelaunch HuluSearch:
text "Breaking Bad"Power:
key PowerOffSee references/common-apps.md for a comprehensive list.
Quick reference:
To get app IDs for your specific Roku:
python3 scripts/roku_control.py --ip <ip> apps
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, Info
# Go home, launch 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
# Open search, send text, select first result
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
# Go back 10 seconds and resume
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
# Launch streaming app, adjust volume
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
Store your Roku IP in references/roku.json:
{
"living_room": {
"ip": "192.168.1.100",
"name": "Living Room TV",
"model": "Roku Ultra"
},
"bedroom": {
"ip": "192.168.1.101",
"name": "Bedroom Roku",
"model": "Roku Streaming Stick+"
}
}
Then reference by friendly name in conversations.
"No Roku devices found"
"Connection timeout"
ping "Key not working"
App won't launch
apps commandDiscovery not finding device
Combine with Govee lights skill:
# Dim lights
for light in "living room" "tv lights"; do
python3 govee-lights/scripts/govee_control.py brightness "$light" 15
python3 govee-lights/scripts/govee_control.py temp "$light" 2700
done
# Launch streaming app
python3 roku-control/scripts/roku_control.py --ip 192.168.1.100 launch Netflix
# Set comfortable volume
python3 roku-control/scripts/roku_control.py --ip 192.168.1.100 key VolumeDown
共 1 个版本