[Release] Roku Connect integration App and Roku TV Device Handler

I present for your use, my new Roku TV App and Driver for Hubitat.

Download from GitHub, or install it through the Hubitat Package Manager application and be kept updated on my changes as they are published.

This uses a parent, and child device. The parent device Roku TV is the main device driver that controls the Roku media players, and Roku powered TVs directly as a TV capable device. The child device is a hubitat/Generic Component Switch for launching Roku apps, and tracking state of which app is loaded. Each app can get its own switch. If automatic management is enabled, the switches will be deleted automatically if the app is deleted from the Roku -- there is no need to manage them manually. Still, if you wish to, you may.

I use state to keep track of some helpful data regarding the Roku device, and I no longer require the user to enter the device MAC address. The MAC is auto-discovered using the standard HE tools. If using the Roku Connect app, then the IP address will be automatically updated by the app, as it detects changes. The Roku Connect app uses SSDP to discover all your powered on, and connected Roku players, so there is no need to manually configure them -- though you may do so if you wish.

This driver works best with Roku Enabled TVs, however, it will enable standalone Roku devices. Standalone Roku players that support HDMI-CEC (like the Roku Ultra), when connected to an HDMI-CEC TV can control the TV power (provided that your TV has HDMI-CEC enabled). Note that the standalone Roku Streaming device that I tested did not offer volume control of the TV as of the last time I tested. If Roku adds this ability to the device, this driver will be able to control TV volume as well.

I use this driver myself on two Roku powered TCL TVs, and a Roku Premier+.

Driver Features
The Roku TV Driver has the following features:

  • implement capabilities for "TV", "AudioVolume", "Switch", "Refresh"
  • Can send any remote control command to TV
  • Easy access to Home button as a Custom Action
  • Easy access to KeyPress for any remote key as a Custom Action
  • Auto-discovery of installed Apps
  • Configurable Auto-Management of installed apps as child devices
  • Configurable child device for TV inputs
  • Implements custom "Application" attribute to report the current application
  • Child apps may be turned on or off.
  • Ability to turn on Roku media player connected TVs if
    • TV must support HDMI-CEC
    • TV must be connected with compliance HDMI 1.3 cable
    • Roku Player must support HDMI-CEC features (some Roku Sticks do not)
    • Roku Player / Roku TV must be powered on (fast-start enabled on Roku TVs)
  • Ability to search for content on Roku, and auto-play content if results are confident enough
  • Ability to create Child Switch Devices for any Remote Key

Roku Connect App

The Roku Connect app is optional, and it does require the Roku TV device driver be installed on your Hubitat device to function. At present, the app will:

  • Find and Install Roku devices
  • Create or Remove Roku "Channels" (aka apps) as Child Switches of the Roku Device
  • Renaming of Roku child switch labels of all app managed Roku devices.

As I progress on the app, I will integrate centralized management of other settings of the Roku TV devices into the app as well.

Note: Any Roku devices added via the app are owned by the app. If the app is deleted, like any other app, the child Roku TV devices will also be deleted.
Note 2: Any Roku devices created manually (without the app) cannot be managed by the Roku Connect app.

The Roku TV driver and Roku Connect app are available as a package via Hubitat Package Manager.



The install instructions are confusing. Can you update them to include the actual file names. Which file do you install first?

I'd like it if the apps were represented by auto off switches, instead of buttons, so they can be seen in Alexa.

The instructions are a little unclear but they are both drivers.

I can't get it to work at all though.

The instructions are a little unclear but they are both drivers.

I can't get it to work at all though.

See my response to @photographicnature for slightly more detailed instructions. If after entering the ip address, and issuing a browser refresh, if you do not see the child devices, let me know. Your roku may be different, and my handler may need some additional parsing.

This code may not work on older roku devices, as it is written based on modern API specifications. It is unlikely to be the case though, as this is the same web api that the roku app uses on smart phones.

Good point. I noticed that too today. I will make that change, it is easy enough.

1 Like

I have updated this to a momentary switch + button. To ensure maximum portability, I added the actuator capability, and changed the logic so that a button press will trigger an on/off event. As the documentation is still very limited, I have to rely on information I can find out on the web and in this community. This update should work better. I have confirmed it does export my apps to Alexa correctly now.

Thank you for the feedback. Huge miss on my part.

1 Like

Install the roku-tv.groovy and roku-app.groovy to the drivers code sections. Then in Devices, create a new device, and select Roku TV as the device type. enter anything for the required fields. I use a naming convention which will be apparent in my updated instructions that I will post later today.

Once the Roku TV app is added as a virtual device, enter the IP Address, and press the save button. If your roku is using wifi, the mac address should be detected automatically. Now, wait about 5 seconds, and refresh the browser page. Your new page will produce details about your roku under the state section, and it should show the current currentApp and switch values. That should be all there is to it.

If at anytime you want to reset your child devices, press the Refresh Apps button, and it will delete and re-add all your child devices.
The regular "Refresh" button will find any missing app, and add them as well as remove any app that are no longer installed on the TV. This means you do not have to manually maintain your child apps.

Nice I have it installed. I am not seeing my TV talking to my router right now so it must be sleeping. I will check it out when I get to the house and see if I can get things to talk. My Roku TV is a Sharp.

The power on action will attempt to wake up the roku device, if the device supports wake-on-lan or wake-on-wifi. If you can send me the XML result from the following call, I can see how to interpret the output.

From a web browser, navigate to "http://ip_address:8060/query/device-info"

The ip_address will be your TV's IP Address. Additionally, you may need to check that the TV allows access to it from the network. I will add more details to the github project as I collect those details from my TV.

FYI - the driver generates an error when saving preferences which prevents the current app polling from working. Should be runEvery1Minute (no "s" at the end):

dev:1052019-03-18 03:47:40.110 am errorgroovy.lang.MissingMethodException: No signature of method: user_driver_apwelsh_Roku_TV_321.runEvery1Minutes() is applicable for argument types: (java.lang.String) values: [queryCurrentApp] on line 49 (updated)


  1. is polling installed apps every 5 minutes really necessary? I haven't thought my way through it, so maybe it is. Just seems excessive. I would have thought hourly or once a day would be enough.

  2. I didn't try it, but do the child devices get uninstalled if you uninstall the parent device?

  3. Lastly - thank you! I happen to have 3 Roku TVs, and it is working great on all 3. I did have to turn on 'fast TV start' so that the TV would be reachable when 'off', but that was somewhat expected.

The app and driver seemed to work good.

However, the connection is broken once the TV sleeps. The TV’s MAC disappears from the arp table along with its IP lease that was associated with it.

Does the wake on LAN use the layer 2 or layer 3 address?

I am thinking if I just do a static MAC/IP association in my router. Wake on LAN might work.

@photographicnature On your TV do you have this option in the settings menu? And if you do, is it on?


I had one TV that had this setting OFF, and I saw the same thing - no communication once TV was off. Turning it ON fixed it.

1 Like

Oops. I fixed it on my install but forgot to do so on github. I cannot fix it from my phone so I will get it fixed later today when I can SSH into my server. Thanks.

Update: this has been corrected on github

I do not know how the wake in lan works, or if it actually does anything. This came from the parent code. I will look into it though. DHCP reservation does not affect ARP table cache expiration it is there to ensure that the device is always assigned the same address. The wake on lan feature of networks is a mac based feature and requires the target network card is listening even if the computing device is off. Not all devices support it. TCL does, but to know if sharp does, I would need the device info report from the TV.

@JasonJoelOld I did find that option and enable it. I will see how that works out.

1 Like

Just FYI.

My needs were a lot simpler than the full featured, and excellent, driver Armand made.

So I made a "Lite" version of this driver, will full credits to Armand included in the driver of course, that only does the parent app side of the functionality - and does not add the child apps at all.

I also added in debug logging, auto-debug logging turnoff, and set the device status to refresh every minute.



I will be looking into making this an app, so that the drivers will be created with the features desired. I think we can do that now. If we can, and IF I can figure out how to create the apps, it will offer auto-discovery (I have worked that out now), and once the device is selected, it will enable the installed apps. Then each supported action of the TV can be added as a part of the main remote, or as a stand-alone button.

I think the real draw back of the current solution is that even though this driver is for a TV, Alexa still sees it as a light. Alexa can work with TVs intelligently, so it would be nice if there was a way to make TVs in Hubitat appear as such in Alexa.

1 Like

I was actually thinking the same thing / a similar thing, but have zero time to work on it.

I also really want to rewrite the Sony TV driver to be a lot more like your Roku driver code, as the Sony TV driver code is a MESS, but it does work so no time for that right now either.

By the way, I've gotten a LOT of use out of your driver and use it for a number of things in my home automation. Thank you very much for making it!!!

1 Like