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

You are welcome. But I too just modified another one that had most of what mine has except the app support, and it was non-standard in that it pretended to be a switch, where mine uses the official more specific Tv mode. Still, happy it was useful.

@armand

Thank you for this app. I can get it to turn on/off the TCL Roku TV in my bedroom.

I have two questions:

  • I am unable to get Alexa to turn on/off any of the child apps (eg. I have Netflix; I exposed the switch "Bedroom TV-Netflix" to Alexa. But telling Alexa to "Turn on Bedroom TV-Netflix" doesn't turn on Netflix. What am I doing wrong?
  • How do I control volume/mute using Alexa?

Thanks again!

Are you using the latest version on github? Play original version of the application child handler Use a push button. Push buttons don’t work with Alexa, so I replace them with momentarily on switches.

You cannot. This is not a limitation of my device similar, this is a limitation of the hubitat Alexa immigration.Presently, only devices that behave like Lightbulb or light switches can be exported to Alexa. Lights only have one on/off state, and Roku API does not offer a set level option. Because I can only level up level down, there is no way to keep the TV volume in sync with a virtual volume in the driver.

What I would recommend is to create a virtual device using a momentary on switch. Then create a rule in habitat when the switch is turned on you push the volume up button. Same for volume down. This would be the only way I could do it in my device handler as well (without the extra rule).

I have posted a request asking the devs About supporting exporting television type devices to Alexa as televisions. If they do, my DTH is already a TV device, so it would automatically gain support.

Yes. It is the latest version. So they are momentary switches. And as I said, Alexa sees them, but takes no action when I turn them on.

For example,

  • "Alexa, turn on Bedroom-TV" turns on the TV (as expected)
  • "Alexa, turn on Bedroom-TV Comedy Central" does not turn on Comedy Central

Also, even if I try the momentary switch directly from the HE Webpage for the "Bedroom-TV Comedy Central" switch, it doesn't turn on Comedy Central. So maybe the device driver isn't working properly with my Bedroom-TV. Here are the details on the TV.

State Variables

  • user-device-name : 40" TCL Roku TV
  • serial-number : 2N005D674148
  • active-app : Roku
  • vendor-name : TCL
  • device-id : 4KK455674148
  • screen-size : 40

Also, I will use your suggestion for Volume COntrol - THANK YOU!!

This works perfectly! Thank you very much!!

I can't figure out why the Child App momentary switches don't do anything. I don't know if it will help, but I've attached a photo of the log file from the following events from the parent device:

  1. Click "On"
  2. Click "Poll"
  3. Click "Refresh"
  4. Click "Reload Apps"
  5. Open device "Bedroom TV-Acorn TV" and click "On"
  6. Open device "Bedroom TV-Netflix" and click "On"

Basically nothing happens for step 5 & 6 - apps aren't launched. I think this must be a compatibility issue with my TV.

This is really odd. I have that exact same TV in my bar at home. That is the TV I used to write this interface. Admittedly, I have not actually used this feature in the past couple months. I will take a look tonight when I get home. I am wondering if something has changed in a recent Hubitat update or Roku API update.
If you want to report the issue on my github project, I can actively track it there, and not clutter the forums with the details. Also, I think I can run a simple test remotely, so I will try that now.

Will do.

I have updated my device handler to improve overall usability, and performance. If you are using this handler, I highly recommend the update. Additionally, I have created a branch of the device handler to treat the apps as switches, instead of momentary switches. Only one switch may be on at any given time, so if you go from Hulu to HBO, Hulu will turn off automatically. Also, if you turn off the current app, then the TV will return to the home screen.

This version is still a beta version, as I have some regression testing to perform. I suspect turning off an app that is already off will have undesired consequences.

If you use my device handler, please share your experience.

Any problems, please open an issue on github so I can address it.

For the beta device handler

Even better, the beta version now is standard toggle switches. See my GitHub page for details.

I'm a bit confused (I'm a slow kid) I already have your latest version (prior to the post above) It appears both driver links (with recently been updated in each) above have the same drivers in each. Which link of drivers should I copy over my existing drivers?

One is the master branch, which is the old version, but should be stable.
The other is the feature-switch branch (there is a pull-down to select the branch)

I recommend the feature-switch branch, but here is some changed behavior which may affect rule machine rules, so I did not simply swap it out.

Both branches have the recent fixes in them.

I have some more regression testing to do before I merge the new logic into the standard master branch.

I know this branching stuff is confusing. And am willing to go back to just one branch, just not until after my extensive testing this week.

Right on I'll try it out......appreciate your work

1 Like

@armand Great work, I am so thankful for this driver! Got it setup yesterday and it works great for my Roku TV's, I plan on creating a rule via a virtual switch to turn off the tv 45 minutes after a command as I always use the sleep timer on the tv and hated all of the steps it took to get me there!

Thank You!

? is there a way to use the arrow and enter commands or add them to the driver??? I know I currently can create a rule to turn on the tv in the morning, then goto my youtube tv chanel but that is it. If I had a command for the arrow and enter buttons I could continue this rule to select the news Chanel I watch in the morning and have the tv go to it and start playing....

Maybe this is already possible and I am just missing it...

I have been toying with the idea of a tV Controller child handler. This would enable the Channels App, enable arrows, and other keys not already implemented. The problem is defining the use cases. I would make this a child handler, because I am trying to keep things that users use commonly in the main app, and the less used stuff in the child apps. The good news, is that even though such buttons are not items you can control normally, since the RM allows for calling functions these would be available in any user defined RM based use cases, so the probability of this being added soon is high.

2 Likes

Okay, I provided two major updates in my DTH (the feature-switch branch). Now, in RM you can call any key press event that is supported. I provided a command keyPress(key) that you can create RM functions for. So, to cursor up, down, left, right you can create an RM custom command for each. You will pass the arguments, "Up", "Down", "Left", "Right" for each. You can create an RM custom command for each key provided in the Key Press pull down of the device. If you pass an invalid option to the function, it will log an error.

The other new feature is I move all the inputs HDMI 1 - 4 to child devices, using the Roku App device. This serves two purposes, 1st) is enables you switch inputs using Alexa, or other voice controlled home assistant, and 2nd) now you can tune your HDMI inputs to the number of actual inputs provided by your TV. Since Roku does not provide me a list of all the HDMI inputs, I have made a preferences input for this that defaults to 3 (the most common number). Roku supports up to 4. Setting the number to zero disables the HDMI inputs as child devices.

I plan to continue to follow this pattern for other input types as I test them out.

3 Likes

Sounds like great additions, will definitely check it out tomorrow

1 Like

Okay, so I got anxious. I just added the Tuner and AV inputs as child Apps. Just enable them in the preferences, and they will get created. Turn them off, and they will be deleted as child apps.

I am not really sure where to take this now. It seems pretty complete for the purposes of automation. Please let me know if anyone has anymore ideas.

Have you added the link to your GitHub in the import line? Also is there away to turn off the logs? It would also be nice to be able to select what child devices you want rather than it creating all of them. So go to a selection drop down option before it creates them?

Please explain. I don’t know what this means

In the preferences, just select the option to turn off the logs. This feature was added a few days ago, so if you have an older version, please update. I recommend using the feature-switch branch which ■■■ all the new features.

This isn’t really possible, as there is no way to link the preferences with the results of the web lookup. I can add a switch to enable/disable auto-discovery of apps. Maybe I will do this tomorrow. At least then, after you discover the apps you want, you can freeze them, and go delete the ones you don’t want.

1 Like

Once I get back to a PC I'll show you the line and where to put it :slight_smile:

What link is this?

That will do the job :smile: