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

Is the error "java.net.NoRouteToHostException: No route to host (Host unreachable)" expected?
before I would just get the warn of "The device appears to be powered off. Please make sure Fast-Start is enabled on your Roku.", but now that error shows up after I upgraded my app and driver.

Just want to make sure I'm not hitting an uncaught error that will cause any issues with the app. If this is expected, great!

In all fairnesss, I try to help but I am a bit fuzzy on how HPM works. I just don't have the time to dig into the source code to reverse engineer it. Conceptually I know what it is doing, but as I not involved in its development, I just push my repo files, and test that it works. Beyond that, I am just trying what makes sense for the next test as well.
Glad it worked.

1 Like

Just got this installed and can launch channels from the virtual switches created via a dashboard

How would you go about setting the logo of the channel to appear on a button?

Also, I can power off the TV via the parent device, how do I create a switch to issue the power off?

On a related note, has anyone had any luck opening the roku remote app on an android device via a dashboard link?

Thanks in advance!

I really have no idea. The URL to the logos is available to each device, but how you add this to buttons depends on your UI. I do not know if the Dashboards have support yet — they did not when I decided to use another product, and I do t spend much time in dashboards.

The parent device is the switch. It will appear anywhere switches appear.

I use only iOS devices other than development testing. Each application can have a specific URL that launches the app, but that depends on the Android Roku app. If it has an app URL, then you can launch it using said URL.

I created my Roku Dashboard remotes using HTTP Requests and Node Red so I can't give you a final answer but if you can find out the channel number in the Roku native app, you paste something like this into the Background Image field for button:
http://IPAddressOfRoku:8060/query/icon/837

where 837 is the channel number ID.

EDIT:. Check it this page
https://developer.roku.com/docs/developer-program/debugging/external-control-api.md

Paste http://IPAddressOfRoku:8060/query/apps into a browser and it should generate list of channels on that Roku and corresponding Channel IDs.

The app number is the last part of the channel’s network ID.

Apologies, I had a version of the driver that exposed the URL to the app icon, but that seems to have been removed. I will have to add that back.

1 Like

Just FYI - here's the documentation I found for the various ROKU queries you can pull

yup. This is what I used to code my driver. Initially, I borrowed the other driver that was a near direct port from SmartThings, but I wanted more control, and reporting, so I found this, and re-wrote my driver from scratch based on every possible feature in this API document. I still have plans for other controls, like assigning content to view within an app, though I cannot think of a use case in how I could make that happen. For me, the number one priority is to wrap up my Roku Connect app, so that everything is managed through it, and then to find out how to create an Alexa integration for the TV devices, since Hubitat still does not export TVs as televisions to Alexa... My TV device is published to HE with the TV capability, we just need to find a way to expose this to Alexa so that we can control it more naturally as a TV...

1 Like

I finally got around to adding the URL and discovered it is there. Make sure you have the latest Roku drivers. If you do, then remove, and re-add the child devices for your channels, and you will then see the URL in DATA section as iconPath.

1 Like

Thanks ! I’ll take a look

If your ROKU devices have changing IP addresses, the Roku Connect app will be able to update the IP address when it discovers the new address. I did not add the ability to update the iconPath should the IP address change, so I will look into adding this as well.

+1 to this question from @SoundersDude, receiving same errors and want to know if that will cause unnecessary hub traffic or issues, etc. Otherwise it is working for me, thank you!

I did not see SoundersDude's message. The error is expected. It is logged immediately from the "The device appears to be powered off. Please make sure Fast-Start is enabled on your Roku" message is logged. The reason for the error is to identify the actual error that the hub is producing when making the Roku API call. Host Unreachable is what I would expect, but the error could be something else, so this provides insight as to why. I can certainly add another switch setting to suppress the actual error message if this bothers people. If you turn off Debug logging, you should not see either the notice nor the error message.

2 Likes

Thanks for the response! A switch setting to suppress the error message would be nice, but probably also just fine to turn off Debug logging

1 Like

Just wanted to say thanks for this project. I successfully installed using Hubitat Package Manager.

1 Like

Excellent piece of work! Following your excellent instructions, I got it working in short order. It works great!

I do have one question:
I am experimenting with Roku development. I installed the Hello World app using Roku developer mode on my TV. The app works as expected and your Hubitat device picks up the new device as a child device.

However, I am unable to launch it by hitting the On switch in the device.

Could this be because it's a developer app? Is there some piece of your code that would disable launching a dev-mode app on Roku?

1 Like

Prossibly. I don't see why that would be the case though. When you press the On button of the child app, it call the componentOn() function in the RokuTV device. This function in turn simply calls the launch() function to launch child app based on the app's App_ID. I would imaging if you can launch the app from the Roku menu, that the ECP protocol's launch should work the same way.

What I recommend if you to send me the screen snippet of the Roku device, and child devices. it should look like this:

From here, I can see what the dev mode App IDs look like and can see if it is more likely a parsing issue in my code.

Here you go. Thanks for taking a look.

It looks like there are zombie devices hanging around. I just deleted and redeployed the HelloWorld app, but the zombies remained.

I can't tell what the app IDs are from this, because you Roku's network ID is too big. Can you send a screen shot of the HelloWorld child app instead? The whole thing If you could.