Skip to content

Commit 19d51b5

Browse files
authored
[roku] Add rule examples for starting apps (openhab#18154)
Signed-off-by: Michael Lobstein <[email protected]>
1 parent ed9bcf5 commit 19d51b5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

bundles/org.openhab.binding.roku/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ String Player_ChannelName "Channel Name: [%s]" { channel="roku
146146
String Player_ProgramTitle "Program Title: [%s]" { channel="roku:roku_tv:mytv1:programTitle" }
147147
String Player_ProgramDescription "Program Description: [%s]" { channel="roku:roku_tv:mytv1:programDescription" }
148148
String Player_ProgramRating "Program Rating: [%s]" { channel="roku:roku_tv:mytv1:programRating" }
149+
150+
// A virtual switch used to trigger a rule to start a given app
151+
Switch Player_StartYouTube "Start YouTube"
149152
```
150153
151154
### `roku.sitemap` Example
@@ -174,6 +177,10 @@ sitemap roku label="Roku" {
174177
Text item=Player_ProgramDescription
175178
Text item=Player_ProgramRating
176179
180+
// Virtual switch/button to trigger a rule to start a given app
181+
// The ON value displays as the button label
182+
Switch item=Player_StartYouTube mappings=[ON="YouTube"]
183+
177184
// Buttongrid for Roku player
178185
Buttongrid label="Remote Control" staticIcon=material:tv_remote item=Player_Button buttons=[1:1:Back="Back", 1:2:Home="Home"=f7:house, 1:3:Search="Search", 2:2:Up="Up"=f7:arrowtriangle_up, 4:2:Down="Down"=f7:arrowtriangle_down, 3:1:Left="Left"=f7:arrowtriangle_left, 3:3:Right="Right"=f7:arrowtriangle_right, 3:2:Select="Select", 5:1:InstantReplay="Instant Replay", 5:2:Info="Info*", 6:1:Rev="Reverse"=f7:backward, 6:2:Play="Play/Pause"=f7:playpause, 6:3:Fwd="Forward"=f7:forward, 7:1:Enter="Enter", 7:2:Backspace="Backspace", 7:3:FindRemote="Find Remote"]
179186
@@ -182,3 +189,25 @@ sitemap roku label="Roku" {
182189
}
183190
}
184191
```
192+
193+
### `roku.rules` Example
194+
195+
```java
196+
rule "Start the YouTube app on Roku"
197+
when
198+
Item Player_StartYouTube received command
199+
then
200+
// Find the list of all installed apps and their IDs at http://$ROKU_IP:8060/query/apps
201+
Player_ActiveApp.sendCommand("837")
202+
203+
// It is also possible to launch specific content within an app via deep-linking.
204+
// See here for more details:
205+
// https://virtu.is/frozen-buttons-launching-disney-movies-on-roku-with-automator/
206+
207+
// Command to start 'Frozen' on Disney+:
208+
// Player_ActiveApp.sendCommand("291097?MediaType=movie&ContentID=8e06a8b7-d667-4e31-939d-f40a6dd78a88")
209+
210+
// Command to start 'Me at the zoo' on YouTube:
211+
// Player_ActiveApp.sendCommand("837?contentId=jNQXAC9IVRw")
212+
end
213+
```

0 commit comments

Comments
 (0)