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

Yeah, it works for me and the author.
It mostly lists the app, or home. I have not tested if it tracks anything more yet.

OK, not now though. It has USB (on side, for storage), HDMI OUT, Ethernet, power only.

I agree, mediaInputSource works for me.

mediaInputSource : Home

is what it resets to when no app is running and is in screensaver mode.

I am currently getting it saying ON mode. That may be different of it were
in a TV. My Roku and Tablo are always ON unlike the TV so I would probably
use the TV as a trigger instead. I have Samsung HDTV's and a LG C1. The
C1 is gorgeous to watch!! Hard to imagine what the Q-dot OLED sets that
Samsung is working on will look like. Anyhow, ...

What is 'transportStatus :' checking, It appears to be if it is streaming?

How does "Select a key to add a child switch for" does this create and actuator??
There are not keys on the Roku, only its remote, but the items appear to be the
full set of available commands, including find remote. I am asking because they
are potentially useful IF I knew how to use them.

Is there a guide on how to do this??

1 Like

I would like to know how to turn the Roku TV off when I leave home. I was hoping there was a guide on how to set that up.

1 Like

If you have a roku tv, then this should be fine

Adapt to your needs

2 Likes

Do you use Alexa? You can have her turn it off and on.

1 Like

I do, but I would like to use a Presence trigger.

Modify the rule shown by @rlithgow1 to use Presence. My guess is that @rlithgow1's automations have two rules:

  1. A rule that changes the Mode to be Away when all his family's presence sensors indicate "not present".
  2. A second rule that is triggered by Mode = Away to turn off his TV.
1 Like

I just whipped that together. Typically I just hit the shutdown button on the way out. I will be setting up a multi device presence rule that will activate with phone(s) and @iharyadi's sensor(s) to do it... Any trigger will do it, and you simply use switch off as the action on the roku tv...

1 Like

I'm super new to this, and I see the buttons on the device but when I go into the rules I'm having trouble matching them up.

Is it the Switch Attribute to turn it off, even though there is a button on the device page?

It should be.

That’s not how it works. Inputs in the app are not just input ports, they are also apps. This is to allow the Roku channels (apps) to be selected by use of the media input capability.

What the driver does is to query the current media stream (reports play, pause, stop state, and the app or input in use), and if not found it queries the current app, which reports the application or input that is in use, or home omit on the Home Screen. Both are used to determine the value for media input.

It’s quite simple, perform a refresh and see what the values are. Then change the app and perform another query. The values should change, even in the Roku ultra (which is the same box as the premier+ that I have).

If this is. It the behavior then it is likely a bug that I need to fix.

1 Like

Switch attribute reports on/off state.

On/Off commands set the on/off state.

The switch attribute and the commands on, and off are all linked, and provided as required by the switch capability.

You can turn the TV on/off by using the TV as a switch in rules (provided that on/off support works on your Roku setup).

Additionally, you can turn apps on/off by installing the Roku apps as child devices. Child app devices run in two modes: as triggers (virtual buttons) and as switches.
When running the child app device as a switch, turning the app on, turns off any other app that was previously on. And turning off the app, closes the app, and returns the Roku to the Home Screen.
When running the child app device as a trigger, the switch turning off does not turn off the app nor return the Roku to the Home Screen. That must be done by pressing the home button (which can be added as a child device to enable the ability to go home with a simple switch)

To automate using this device is somewhat an advanced level task. You need to understand the basics of how the hub works.

In the gui, the button In the device are the supported commands. And the attributes are the current reported state of the physical device, while the state variables are the software state of the driver and have little or nothing to do with the physical device. The state variables are used to control the driver, or to track state changes in the driver.

So, with custom devices like this, that have a lot of custom commands, you would generally use custom commands to control it. There are only two types of devices in Hubitat, sensors, and actuators. A device can implement both the sensor and actuator at the same time. An actuator is a device that performs some action, typically a physical action, like lock a door, turn on a light, open a blind. A sensor reports the status of sensors, like temperature, light brightness, humidity.

If you are creating rules, most rules will be based on l custom attributes of a sensor device or execute a custom command for an actuator device. These will both expose the devices command and attributes provided the device appears in the list of devices. And, it doesn’t matter what type of device you choose, so long as the device you want appears in the list.

1 Like

Roku TV and Roku streaming devices offer all the same commands. The only thing that is specific to a TV is the an ability to select an input device, like HDMI. Even the TV Tuner is available on streaming devices, provided the Roku live TV app is installed, which emulates perfectly having an antenna in a TV.

2 Likes

I thought I had done something where I would see all the buttons / options that showed On and Off as the Power Buttons from the device.

Don't use attribute, use switch. You will see the tv there

Can you share a screen shot of this?