Roku Support

I am not sure what is wrong, it may help to set a rule when the switch is activated and add a log such as

rule "RokuMB Home"
  Item RokuMBHome changed from ON to OFF or
  Item RokuMBHome changed from OFF to ON

	logInfo("Roku", "Roku Home pressed")

This will let you know that Openhab is seeing the command.

I also have the http binding installed, but not sure if that is required?

Thanks BK, but I’ve found that the only thing that works is to put very stripped-out items in the .items file

Switch RokuPlayPause “Roku PlayPause”

then a corresponding rule in a .rules file

rule “RokuPlay” when
Item RokuPlayPause changed
executeCommandLine(“curl -XPOST”)

and then it all seems to work OK.

Thanks also for posting your widget; just one thing, do you know how to make the “Play” button a toggle as once it sends “On” then Roku is paused and the actual button on the remote control is a toggle On/Off = Play/Pause??

Thanks again for your help; I only heard of openHAB on Monday so I’m on a very steep learning curve :slight_smile:

I came across this post for a Roku binding. From the thread, it appears to be mostly done, maybe some final touches and testing needed. The author has opened it up for someone else to pick up. Maybe worth taking a look at?..
I’m definitely interested in a Roku binding. I just don’t do code…

@morph166955 I copied and pasted your code and it works great!

I had a little trouble getting the script to run. First you have to make the file executable with

sudo chmod a + x /etc/openhab2/scripts/

I still had trouble getting this to run, and discovered an EOL issue that I could fix in the edit menu of Notebook++. Once that was fixed, the script worked great.

I was able combine your example with the Habpanel in post #35 above by @bkyle.


Did you post the latest v3 code anywhere. I seem to be having trouble getting this to work. So far I had to update the roku.rules to point to where the python script was. (Yes Im testing all this out on a windows PC)

val String ssdp = executeCommandLine(“C:/openhab2/conf/scripts/”, 20000)

However, I am still getting an error

19:53:00.002 [ERROR] [untime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘ROKU APPINFO’: 1

Any ideas?

I’ve updated this for OH3 to use the new HTTP binding. See: ROKU Support on OH3 using HTTP binding

Greetings all,

Using the OH3 Roku binding works for me. Is there an issue? What I wanted was a widget that would act as a remote. I created a crude one that works. Just wanted to know if anyone had something refined. I am using an image card to act as buttons, so I had to create various button icons. Does anyone have a nice clean widget? Or, would someone like to have a look at my widget? thanks!

Check these out for some examples: