Which Roku do you have? If you have a Roku TV you might not need the Harmony Hub at all. I’m not sure though.
In order to use voice commands with Alexa to control Roku and/or Harmony Hub you have to make a separate script for each command you want and you have to have Nabu Casa or the Amazon Alexa manual setup and make your scripts visible to Amazon Alexa then you have to create a separate Routine in Alexa for each script.
In order to find the Harmony Hub commands you have to go to your config folder and look for the conf file that looks like harmony_12345678.conf then open it with a text editor. It will have all of the commands that you can use for your scripts.
I don’t know if the Activities actually work but I do know the other commands work. The commands are listed under each device in the conf folder.
Once you have identified the Activity and/or commands you want to use make a separate script for each of them. The Harmony page at https://www.home-assistant.io/integrations/harmony/ has Service Call examples that you need to include in your scripts.There is also an automation example for activity: "Watch TV"
which should be adjustable for a script as the following.
service: remote.turn_on
entity_id: remote.harmony_hub
data:
activity: "Watch Roku"
I don’t know if that will change your HDMI input or not since I don’t have any Activities setup because my TV has to cycle through inputs inputs instead of jumping directly from one specific input to another.
In my case to change HDMI input I have the following in a script.
data:
command: InputHdmi
device: TV
entity_id: remote.harmony_hub
entity_id: remote.harmony_hub
service: remote.send_command
Once you have the scripts created you can test them by selecting Execute within the page of the specific script or going to the Script page in Configuration then clicking on the Play icon next to the Script that you want to test. If you want to test scripts before creating them you can do that in Services in Developer Tools.
Then either Reload Scripts under Server Controls or restart HA then make sure the scripts are enabled in Alexa in Nabu Casa under Home Assistant Cloud in Configuration. Then Sync Entities. If your script doesn’t show up there it won’t show up in the Amazon Alexa app.
Then on your cellphone or tablet to the Amazon Alexa app then select Routines then click on the plus sign on top right then enter Routine name, when this happens, then Add Action then Smart Home then Control Scene then click on the desired script from HA that shows up in the list.
You don’t need Harmony Hub to control Roku since Roku has it’s own integration and can be controlled directly by HA.
These are the Roku commands that are available to be used in a script using remote.send_command
back
down
forward
left
select
info
play
replay
reverse
right
up
home
I use the Harmony and Roku scripts as buttons for Mini Media-Player I copied the setup here and here
You can also use the media_player.select_source in a script to jump to a specific app within Roku. I have separate scripts for Youtube, Netflix, Prime, and so on, so I can tell Alexa or Google to switch to what I want to watch.