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

I see! So I'm just not waiting long enough when testing it out. :blush: I tried again and waited a tad and the lights dimmed in about two minutes. Totally works! I'll just leave-as is for now (with up to a five minute wait for the lights to change) but if that is bothersome later I'll do your suggestion of the advanced refresh. Btw I used Hubitat Package Manager and also installed the Roku Connect. Thanks for your help!

Hi Guys,
Im using the hubitat package manager to install the "Roku TV integration", but as soon as I click on the package or click "next", nothing seems to happen. It doesnt seem to install the package at all.
Any workarounds to this is definitely appreciated

Once you do that you create a virtual device the. Pick the Roku driver and click save. Then you fill out the IP address etc and click save again

Hubitat Package Manager only installs the software. It does not run the software. To run the software, you have two options (the officially supported method at this time is the app based solution).

App Based
Navigate to Apps section of Hubitat, and add a new User App. Select the Roku Connect application, then once executed and completed the initial configuration, open the installed a Roku connect instance, and start discovery of the roku devices and select the ones you want to install. Each one will create an instance of the a Roku TV device driver specific to the roku device selected.

Manual Device method
If you do not want to install or use the Roku Connect app, that is fine. I wrote the Roku TV device driver to work independently of the Roku Connect app. When you use the Device driver method, you will have to know the IP address of the Roku player, and some features, like the ability to detect IP address changes, will not work.

2 Likes

Thanks for that Armand. I used your App based method via the user app. It worked great.
Except that it only found my one Roku TV and not the other.
Both my Roku TVs are on the same subnet and have reserved MAC to IP. Not sure why the other TV wasnt picked up.

I probably have to go with the manual method, as it gives me the ability to punch in the IP manually.
Regarding the manual method, should I just install the device driver here: hubitat/roku/device at master Β· apwelsh/hubitat Β· GitHub , is that all ? or does that have an app accompanying it ?

Once the Tv device driver is installed. You don’t need to install it again. You just use it multiple times. If the Roku is not found, make sure it is powered on, and set for fast start under power preferences. Any other setting will result in an inability to wake it, unless it has a wired connection, but to learn the MAC address (required to wake it up) the Roku must be powered on, and awake. If turned on, and awake, then auto discovery will work.

both tvs are on fast start. The tv which wasnt discovered is on wired ethernet, but on the same subnet as the hubitat and the other tv.

That is interesting. I know some network switches have multicast issues β€” auto discovery relies in multicast. But it can also be because the TV is not setup to allow remote control access from the network. I cannot lookup the setting right now.

1 Like

For the TV that is not discovered, would you mind checking some settings.

  • Settings/Connection/Setup up connection/Wired
    • even if an ethernet cable is plugged in, it can be set to use wireless, so double checking this is worth the effort
  • Settings/System/About
    • Take note of the software version. My current Roku TV version is 11.0.0 (build 4193-92)
  • Settings/System/Advanced system settings/Device connect
    • Should one set to Enable 'Device connect'
  • Settings/System/Advanced system settings/Control by mobile apps/Network access
    • Should be set to Permissive
    • Default works on my TV, but if it's not working, it may be because that TV defaults to Disabled

Finally, as a last resort, you may consider Settings/System/Advanced system settings/Network connection reset/Reset connection. This will clear the wifi and ethernet settings, and reboot the TV. When it comes back on, it will default to using ethernet DHCP mode if the ethernet cable is plugged in, and it should clear up any other restrictions that may be in place preventing the auto-discovery.

Hi Armand,
You were right earlier. I had to manually enable IGMP snooping on the switch on which the wired roku was on. It discovered right away.

All other settings you mentioned, I had those enabled earlier.

1 Like

IGMP Snooping is a problematic setting. Sometime enabling fixes multicast, and sometimes disabling it fixes multicast traffic. It depends entirely on the switch / router software. Good to hear it is working.

1 Like

Did something change with the app or TLC version of Roku,

I have a rule that has been running for probably a year that automates ambient light with the Switch attribute on the TV. Basically it just turns the TV lights on and off when the tv turns on and off. Recently it quit working. When I look at logging it looks like it turns it off and then seems to think it is active because the TV reports it is on the Home app.

Any ideas. Only idea I have right now is to either resort to what i do for two other tv's that use roku sticks which is power monitoring, or change the automation from switch to the Power state on the TV.

Checking. Nothing should have changed. Power state should only be controlled by the device info status, and media streaming status. If the device is no home, them media state should be stopped, but if media state reports something else, I use that to trigger that the TV is on. Last I checked, my TCL TVs were fine. But again, I will test this out to see.

Notice: If you TV is not setup to use FAST-START then things do not work as intended.

Q: Is the Application "Home" or is the MediaInputSource "Home"? When the TV is in the off state, the mediaInputSource should read Home, and that should trigger setting the App to Home.

Here is the code snippet:

   // only perform updated if the application is different from last check
    if (currentApp != previousApp) {

        if (currentApp == 'Roku') {
            unschedule('queryMediaPlayer')
            scheduleQueryDeviceInfo()
        } else  {
            if (currentValue('switch') != 'on') {
                if (this[SETTING_LOG_ENABLE]) { log.info "turning on, because app is not roku" }
                sendEvent(name: 'switch', value: 'on')
            }

From this, you can see the a couple things must happen. First, the currentApp had to have changed from the previous refreshed state. Next, the currentApp must not be 'Roku', and finally, the switch must not be 'on'.

From your logs, I see that the powerOff keypress was initiated. This in turn resulted in a refresh which would have updated the application and all device info. Then, 10 seconds later, the current application was quarried, and the current application was not "roku", so it set the TV state to "on".

Perhaps your TCL is taking more than 10 seconds to shutdown, and incorrectly reporting Roku as the current app. Try unplugging the TV, to see if the adequately resets the TV and clears up the issue. I know the TCL Roku software is a bit buggy, and my older Roku TV will get very slow, requiring me to reboot the TV. Although sometimes, a reboot is not enough, and I have to unplug it.

If I power the TV on and then off with the driver. Application shows Roku and MediaInputSource shows Home. Once The queryActiveApp routine runs it changes the application to Home and then sets the switch to on.

When I take the URL from the driver for the queryactiveapp and run it manually it always shows Home. It can be minutes after the state has changed and it still shows home.

I confirmed faststart is running on the TV. I have powercycled the TV.

The TV in question is a TLC 55S515.

To me it looks like the driver changes all of the states as expected. Media Input source is Home, and it changed the application state to Roku. When the QueryActiveapp routine runs and queries the TV it gets "home" which triggers everything to be set to the active state even though the TV is turned off

OK i think I may have a clue what is going on. it looks like the tv is showing a different active app depending on where it is in the home menu system.

For example when i am on the Home section it shows "Home" app when queried. If you pus the down arrow on that screen to the Featured Free section the app the query gives is now "Featured free.

If i change to a Roku specific section it now responds with "Roku" for the app. The TV is running version 11.0.0 with build number 4193. Seems like the TV isn't responding as expected.

I had the TV on a screen that was returning Roku and after powering down it returned Home.

This is all new/unique behavior. On my TCL TVs, the Application attribute only ever shows as Roku. And the mediaInputSource attribute shows as Home.

I will check for updates on my TCL TVs again.

Thanks for looking into it. I agree it is unique as it looks like the two roku sticks i have act as you mentioned.

Only thing i can think of is to do a factory reset. Not sure why that would fix this but i am out of ideas. Look forward to hearing back from you, and thanks again for this great driver.

I am in 11.0.0 build 4193, but all my TVs are 4000 series, except the one my wife is watching at the moment /- that one is a 6Ss535. When I get a chance I will play with the power on that TV and see how it behaves. To be frank, I thought it was already on my Hubitat, but I just learned I needed to add it, so I have not apparently tested with this TV yet β€” it rather new.