Jack Moore

Email: jack(at)jmoore53.com
Project Updates

Roku CLI

26 Mar 2022 » roku, tv, commandline, automation

This is a pretty quick post. I have a Roku TV I want to control via command line. This post covers the two projects I used and the alias configurations in my ~/.bashrc file.

Control

I used the Roku-Cli Project for this as it provided a general remote. I needed to configure the IP address properly for the roku command, but the configuration in my ~/.bashrc looks like the following:

alias roku='roku 10.0.X.X' # where X.X is the IP address of my roku device.

Power On

Oddly enough, the controller above didn’t have a Wake On Lan (WOL) configuration available so the simple script from the Roku-TV-Control repo allowed for powering on and powering off the roku-tv.

I had to modify the script to configure it for my needs (needed to update the MAC address and IP configuration), however these fixes were easy enough.

My ~/.bashrc looks like the following for powering on and powering off the tv.

alias roku-on='python3 control.py power'
alias roku-off='python3 control.py power'

WOL?

Nope :( although when I get time I will look into this. (I seem to say this quite a bit…)

TODO: It looks like the roku-tv-control is a ~100 line python script written in python2. I will likely spin up some kind of docker python2.7 container to see if this works.

Conclusion

Now I’m able to power on/off the one Roku TV I have and control it as well.

Next I may look into quickly screencasting youtube links.. and fixing the control.py script.

© Jack Moore