PLUGIN: RokuControl

This is my first attempt at writing a luup plugin, and has only been tested with a Roku 3 and a TCL RokuTV on Vera Plus and Vera Lite. Much of the functionality hasn’t been tested at all. This was initially an attempt to simplify turning my Roku on and off, and it kinda got out of hand.

All that being said, it has surpassed my expectations in terms of functionality even though there are a few minor issues I’ve yet to figure out. I’m putting the code out here for all of you gurus to use, test, modify, and give me feedback. I’m particularly interested in how functional it is on other Roku versions. Keep in mind, I implemented a number of features in the Vera interface that may not be supported by your Roku device, however I found that there were more features supported on my devices than I expected.

Plugin is attached and code is also on github.

Incomplete list of supported actions:

[ul][li]on/off[/li]
[li]volume up/down/mute[/li]
[li]basically whatever is on your remote[/li]
[li]launch or install applications[/li]
[li]search for and launch content[/li]
[li]change input[/li]
[li]query active application[/li][/ul]

When installing the plugin, make sure your Roku is powered on. You’ll have to specify its IP address, and it should be set to static either in the Roku or your router’s settings. Once the IP is set, the plugin will start querying for information about your device.

**
Attached some screenshots
2018-02-27: Updated description, fixed minor bugs.


2018-03-11: The released version of the plugin is now available in the app store.
[url=https://apps.mios.com/plugin.php?id=9041]MiOS Apps

Additional documentation is available here.

I have a Roku 3 and will probably use a Harmony Hub to control it and the TV and receiver via Vera someday. I am currently using an old Harmony 600.

I was not aware the Roku 3 could be turned off. Is that just via the API or am I missing something?

So I had no idea it could be turned off either. It responds to power on, power off, and power toggle commands through the API and turns the TV on and off. The Roku itself actually stays on, which is nice because, unlike my Roku TV, it still responds to queries in that state.

I did read “off” is just putting the Roku to sleep, or the screensaver that display’s the time.

I really like the plugin so far. I know the interface is fairly simple so a plugin is not necessary for simple things, but I like the ability to use the actions in scenes. I did notice a couple things while using it. The SetPlayMode action in I_RokuControl1.xml had a copy and paste error where every play control action(fwd,play,rev) triggers a fast forward keypress.

The other oddity is the volume up and down do not seem to change the volume. I think this is possibly and issue with my device. I can turn the TV volume up and down with the Roku remote through the HDMI interface, but when doing this with the external API, it does not have the same result. It could related to the fact that a single keypress on the physical remote only displays the volume level without changing it. I think the keypress command on the external API will have the same result, but when I used keydown it had the same result. The mute button works just fine.

Again thank you for sharing this great plugin. Hopefully Roku keeps expanding the API in the future.

Thought I would mention you should upload it to the MIOS app store. I know I would appreciate the live updates.

Thanks for the feedback! What Roku model do you have?
Volume works on my TV, but the Roku doesn’t support volume control, so maybe this is an API limitation on some devices.

[quote=“bdparker”]Thanks for the feedback! What Roku model do you have?
Volume works on my TV, but the Roku doesn’t support volume control, so maybe this is an API limitation on some devices.[/quote]4200X - Roku 3

It is just a set top box but the remote has volume controls that work through the HDMI input to the TV. Just apparently not with the external API.

Sent from my A0001 using Tapatalk

Are there any values or expressions that i can use for SetPlayMode in PLEG?

Would it be possible at all to separate the play/pause button? as I have a motion sensor that when triggered pauses my roku, but it unfortunately also unpauses it.

Nice app! Any way to get more than one Roku working with it?

Yay, got this plug-in working just fine after following the instructions a bit more closely (hadn’t clicked NEW SERVICE > RELOAD ENGINE the right way).

NOTE: I notice that the “Roku Control” child device is not available for use in Scenes, so I cannot automate it using Vera.

Any chance of exploring whether this plug-in could direct one’s Roku device to issue CEC media commands? (If the Roku model being used can even do such a thing…)

For example, could a Roku Stick be told to “Set TV to HDMI Input 4” (even if the Roku itself is plugged into HDMI Input 2)?

Right now, if I mash the “HOME” button on the physical Roku remote (RF), it magically turns on the TV and sets it to the HDMI Input into which the Roku is plugged. I’m just wondering if such functionality can be expanded. The possibilities then become much greater!

Thanks for all your great work on this plug-in!

  • Libra

P.S. Hmm, I also notice that the Roku Control “device” is NOT listed when I go to “Manage Alexa” on my Vera login page. Is there some way to expose the plug-in’s child device(s) in such a way that Alexa could then “Discover” them and thus do voice control??

This is a really old post but I’m also attempting to gain voice control of this app.
Any suggestions?

Any chance that it’s possible to use RokuControl plug-in to send a brief text message to the screen of a Roku TV? Such as the kind you see on some cable systems when Caller ID information appears?