[RELEASE] Roku Virtual Buttons

Is there any sort of scheduled state refresh that can occur? I’ve successfully installed MrDalek fork along with the ‘remote’ device which does appear to be able to show the current state of the device in SmartThings. I have a few Roku TV (TCL and Sharp branded) with built-in Roku and I’m trying to add an automation that will automatically turn off the Roku TV after it has been powered on for a set period of time, say 4 hours or so.

I have the automation working using the native smart lights and switches power allowance smart app but I’ve noticed that the Roku Manager does not appear to automatically/periodically update the state of the Roku devices in Smart Things.

Can this be enabled?

EDIT: Actually I was able to solve this myself and add a quick times refresh to the Roku device handler.
I simply added “runEvery5Minutes(refresh)” to the def refresh section to refresh the current state every 5 minutes. Not exact timing in the grand scheme but also not overly chatty either.

def refresh() {
  log.debug "refresh"

@MrDalek I originally used MadMouses code to have my TCL/Roku TV turn on via motion sensor connected to smart things. The IP address on the the TV periodically changes. During the last time I had to set it up, I used your modified code. The TVs IP address changed again but it doesn’t seem to be discovered. I cannot see a way to reset the application or delete/re-add. Any advice for having the Roku Manager discover the new IP address of the existing TV? Thank you

@MrDalek I was able to find my own resolution. Since the buttons were associated to Google, I had to disconnect the Google connection before it allowed me to remove the existing Roku TV and then the app. Then reloaded the app and new IP address for the TV popped up. All good. Thanks again.

Anyone dropping in here fresh like I was a couple days ago look here:
Use the files here by MrStevenFeldman, the originally posted ones won’t get this working: https://github.com/MrStevenFeldman/RokuSmartThings

Now go find the Roku device made through RokuConnect and press the power button in there. You should be able to get it to turn off. You’ll know you’re good to go add the buttons because your TV will turn off and additionally the bottom right of the app will say ‘n Channels’ meaning it sees how many unique ‘channels’ you can launch from the home screen. Once you do go back to add the virtual buttons and all of your apps/custom named inputs should then list out. If you don’t do this step when you go to flip on the buttons you want in the virtual buttons app setup you won’t see any of you Home screen apps and your inputs will have their generic names like HDMI 1.

If you’re using Google Home and your Smartthings account is already connected then all the Virtual buttons made in Smartthings will transfer to Google Home and you just need to assign them to a room (I made a Roku TV room since there’s a lot) then you can add them to a routine. This will save you a step from setting them up as a scene in Smartthings then triggering that scene through a Routine in Google. You just don’t need the Smartthings scene at all (also note if you’re new to this like me that you don’t put a period at the end of a custom Google routine, it has issues if you add punctuation to the voice command).

It does appear the Virtual Buttons Smartthings app will only work for one TV unfortunately. You can add multiple TVs through RokuConnect but virtual buttons doesn’t let you individually setup buttons for both.

The official Roku integration with Google does now allow multiple devices though the voice commands are weaker than what you can setup here.

I stumbled across this thread because i’m wanting to setup a IFTTT Applet to tell Google to “Power on the Living Room” which i would want my lights powered on (connected via smartthings) AND to power on my TCL Roku TV. Trying to decipher what you guys are saying, is there a way to somehow have it power on the TV via Smartthings? I already linked the Roku account to my Google Home which I can power on the TV with my voice, but wanted to encompass IFTTT to power on everything.

Yes, this smart app can be installed on smartthings and will allow you to do exactly that.