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

If you install the app as a child device, it's in the Device Network ID (DNI) of the child app. The app number is the number following the hyphen. It also appears in the URL of the iconPath which is stored in the device's Data section.

How can I use webcore to set the Roku TV to a specific channel?

I don’t use WebCore, so I cannot answer that completely. But the method to set the channel are channelUp and channelDown. There is no setChannel function, because there is no way to do this on a remote control. I do have a roku TV with the channels enabled, so I can look into adding the feature, if it is possible, it will likely require a deep link which is app specific. That shouldn’t be a problem, since the TV app is common for all roku TVs…

1 Like

@armand

If it helps, the harmony hub can send a direct channel command to it, but of course it's logitech software so you can't send a "." or "-" to access HD channels because they have those buttons disabled in the device controls. (Common issue with them on various TV's). But, whole number channels work....so the TV can respond to it, even if the Roku remote can't send it.

I added a new "setChannel" command that accepts a number (decimal numbers are allowed).

The TV must already by on, and the Live TV app must be loaded (InputTuner) otherwise the command will exit silently.

This command is a bit of a hack. There is now way to change channels, but I can send any characters as key presses. Additionally, the Tuner app does not allow enter channel numbers, unless the guide is visible, so, what this does is the following

  1. send key press Left
  2. convert channel to a sequence of characters
    2a) for each character, send key press Lit_{key} there {key} is the number or period
  3. send key press Select.

so, channel 1180, looks like this:
keyPress('Left')
keyPress('Lit_1')
keyPress('Lit_1')
keyPress('Lit_8')
keyPress('Lit_0')
keyPress('Select')

channel 24.1, looks like this:
keyPress('Left')
keyPress('Lit_2')
keyPress('Lit_4')
keyPress('Lit_.')
keyPress('Lit_1')
keyPress('Select')

I do not pause between keypresses, as it appears to work without it, and does not have the look as if the keys are being pressed this way.

Let me know if I need to add a keypress delay.

Armand

Wanted to chime in on a new automation that I'm loving thanks to this integration.

Context: I have very young kids, and they have started to silently exit their room after we put them down. We caught our son sitting silently on the stairwell watching the TV we were watching which isn't age appropriote. We lucked out that for those 5 min nothing truly horrible happened beyond bad language.

Solution:
I installed a contact sensor on their door. I now have a RM rule that when their door opens when we are in "Kids sleep mode" which is 7:30-10:30pm, the downstairs light will slightly turn on then dim back off (like a soft-flash), and if the TV is playing, pauses the show we are watching.

Last night it worked perfectly, caught both our kids at different times tiptoeing out of their rooms to spy on mom and dad.

The WAF was stellar when she saw the auto-pause. Love it.

2 Likes

Bravo!

Here's hoping, though, that you don't watch anything with nudity, and that they don't pick that exact moment to sneak out and pause it. :stuck_out_tongue_winking_eye:

1 Like

I guess you could press pause, then the home button….then when you return to the app, it resumes where it left off.

1 Like

Ha, I did think about that. If that happens I will be quick to hit the home button.

@armand I'm getting an error when using supported inputs as an attribute. Use case is simple, when app is changed (netflix, hulu, etc) it should trigger a scene. During creation of the condition I get the following

Supported inputs is the list if all the inputs. What you want to use is attributes: application or mediaInputSource.

1 Like

Hi

I have a Roku Streaming Stick+. I would like to run automations that activate my cinema lighting scene if something starts playing and prevents some scheduled automations from running, but I'm not sure how to set this as a condition since 'play' doesn't seem to be an option in rule machine?

Any help with this would be greatly appreciated

It would likely be under "Custom Attribute" in Rule Machine. That is where most of the non-standard stuff can be found.

When I do this with my Roku, I do see my devices show up in Custom Attribute, and from there you select which of the ones you want to trigger from.

1 Like

Play is a command, not a state. Use the custom attribute trasportStatus for play, pause, stop state along with mediaInputSource for current app / input status.

1 Like

Like this?

I have mine like this. Works for my needs...

Then I use this to bring the lights up.

1 Like

Awesome! Thank you! I will try this! First time using RM and it's a bit confusing

First, I use the Roku Ultra,

I still have not had any of the apps launch... Wait a minute, ... you need to trigger the ON actuator!!!! Let's see what off off one does?? Yep, exited, Next ON one app then another ...
Yeah, it switches without having to exit first !!!! Channels do not work within apps. I use the Roku as a player for all my OTA recordings on my Tablo Quad but I do stream too.

Works - VolumeUp, VolumeDown, Stop, Reload Apps, Refresh. Home, Key Press, Off, On

The following act like the remote and toggle, MUTE = UNMUTE, sane for play = pause.
Mute and Unmute do the same thing, should be Mute On/Off,
Pause / Play do the same thing as well.

Fails - SetVolume (I expected this to work), Query (all 4, perhaps a TV only function)

N/A - Input Source

Untested - Initialize (no idea what it does)

Custom Command then Actuators exposes all the magic inside, I use Custom Commands ALL THE TIME. Same for properties, say I want to know the current wind direction, no other way to get it. I have strobe that blinks under a specific condition. You can only do that using a custom command, Get use to them, A lot of lighting can be done under a single app now. I am still having problems with while loops and editing them is impossible. I just wanted to change a sensor, fogedaabout it. Just start over!!

1 Like

Use ON not just changed!!! I am still looking for decent rollers that do not cost a few grand for me to set up. I have for HUGE windows in the "TV room". You might want to use Sunset and Sunrise and not a specific time. I do that with my outdoor lighting. Even 15 seconds is probably long enough for trigger. You alos may want to make on more generic and just ON/OFF rather than only if Hulu is ran.

I have enough automation I had to get a second hub for actions I need to happen instantly. Still porting over rules and meshing devices.