I found this image of a Roku remote online and customized it with my own applications (Prime Video, HBO, Xfinity). It should work for stand-alone Roku devices and Roku TVs. All of the buttons work using the code below, and I added three volume controls on the right:
The actual image I used for the remote is pasted below, and it lives in the www folder in your Home Assistant directory (in my Supervised Debian installation, this is /usr/share/hassio/homeassistant/www). It’s called rokunew.png (referenced by the code pasted below). If you want to use it, make sure you click on it and download the full-sized file so that the resolution will be decent, and the buttons in my code line up correctly.
Finally, for the list of apps on your Roku, you can find their names by navigating on your local network to
http://[ROKU IP ADDRESS]:8060/query/apps
For this dashboard I used the custom layout cards from GitHub - thomasloven/lovelace-layout-card: 🔹 Get more control over the placement of lovelace cards. This was only to have finer control of column width to place the volume controls next to the Roku remote, but you can use built-in Home Assistant layouts if you prefer, with minimal change.
In my case, my Roku is called “dining_room”, so one would have to change remote.dining_room and media_player.dining_room to the appropriate Roku names in one’s Home Assistant installation.
title: Remotes
views:
- theme: Backend-selected
title: Roku
type: custom:layout-card
layout_type: custom:grid-layout
layout:
grid-template-columns: 230px 180px
grid-template-rows: auto
grid-template-areas: |
"main sidebar"
path: roku
subview: false
badges: []
cards:
- type: picture-elements
view_layout:
grid-area: main
elements:
- type: service-button
service: remote.send_command
service_data:
command: power
entity_id: remote.dining_room
style:
top: 6%
left: 50%
- type: service-button
service: remote.send_command
service_data:
command: back
entity_id: remote.dining_room
style:
top: 14%
left: 31%
- type: service-button
service: remote.send_command
service_data:
command: home
entity_id: remote.dining_room
style:
top: 14%
left: 70%
- type: service-button
service: remote.send_command
service_data:
command: up
entity_id: remote.dining_room
style:
top: 22%
left: 50%
- type: service-button
service: remote.send_command
service_data:
command: left
entity_id: remote.dining_room
style:
top: 29%
left: 24%
- type: service-button
service: remote.send_command
service_data:
command: select
entity_id: remote.dining_room
style:
top: 29%
left: 50%
- type: service-button
service: remote.send_command
service_data:
command: right
entity_id: remote.dining_room
style:
top: 29%
left: 76%
- type: service-button
service: remote.send_command
service_data:
command: down
entity_id: remote.dining_room
style:
top: 39%
left: 50%
- type: service-button
service: remote.send_command
service_data:
command: replay
entity_id: remote.dining_room
style:
top: 46%
left: 32%
- type: service-button
service: remote.send_command
service_data:
command: info
entity_id: remote.dining_room
style:
top: 46%
left: 70%
- type: service-button
service: remote.send_command
service_data:
command: reverse
entity_id: remote.dining_room
style:
top: 53%
left: 26%
- type: service-button
service: remote.send_command
service_data:
command: play
entity_id: remote.dining_room
style:
top: 53%
left: 50%
- type: service-button
service: remote.send_command
service_data:
command: forward
entity_id: remote.dining_room
style:
top: 53%
left: 75%
- type: service-button
service: media_player.select_source
service_data:
source: Netflix
entity_id: media_player.dining_room
style:
top: 64%
left: 50%
- type: service-button
service: media_player.select_source
service_data:
source: Prime Video
entity_id: media_player.dining_room
style:
top: 70%
left: 50%
- type: service-button
service: media_player.select_source
service_data:
source: HBO Max
entity_id: media_player.dining_room
style:
top: 77%
left: 50%
- type: service-button
service: media_player.select_source
service_data:
source: Xfinity Stream
entity_id: media_player.dining_room
style:
top: 84%
left: 50%
image: https://[EXTERNAL HOME ASSISTANT WEB ADDRESS:PORT]/local/rokunew.png?v=1
- type: custom:layout-card
view_layout:
grid-area: sidebar
layout_type: custom:grid-layout
layout:
grid-template-columns: auto
grid-template-rows: 1fr 1fr 1fr
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: remote.send_command
data:
command: volume_up
target:
entity_id: remote.dining_room
icon_height: 20px
name: Louder
icon: mdi:volume-plus
- show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: remote.send_command
data:
command: volume_down
target:
entity_id: remote.dining_room
icon_height: 20px
name: Quieter
icon: mdi:volume-minus
- show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: remote.send_command
data:
command: volume_mute
target:
entity_id: remote.dining_room
icon_height: 20px
name: Mute
icon: mdi:volume-mute