So, I was able to understand my issue (I didnt add Roku device to harmony remote, just tried to send the Fwd button using one of my existing devices, how stupid?)
I am gonna write a quick guide on how to setup this roku with the harmony and home assistant so others will be able to do it smoothly.
please note that I was using home assistant installed on RASPBIAN STRETCH WITH DESKTOP
- give write permissions to homeassistant folder (
sudo chmod -R 777 /var/opt/homeassistant
) - create folder
custom_components
inside the homeassistant folder - create file
roku_emulated.py
inside that folder from the above step - copy content of https://gitlab.com/mindig.marton/ha-emulated_roku/blob/master/components/emulated_roku.py to the
roku_emulated.py
- add the following configuration to the homeassistant’s configuration.yam (
sudo nano /var/opt/homeassistant/configuration.yaml
)
example:
emulated_roku:
host_ip: 192.168.1.150 # should be set to Home Assistant's address
advertise_ip: 10.0.0.10 # optional, defaults to host_ip if not specified
upnp_bind_multicast: True # optional, defaults to True
listen_ports:
- 8060
- 8061:8080 # optional format when using something like Docker - port:advertise_port
mine looks like that:
emulated_roku:
host_ip: 192.168.1.100
listen_ports:
- 8060
- reboot your raspberry pi (
sudo reboot
) - navigate to 192.168.1.100:8060 (the host_ip you just set in step 5 for the emulated roku (which is the homeassistant’s ip but with the roku’s port)
- copy the serial number (the value between the serialNumber tags (
<serialNumber>5sEE3ioBPJU2m3ZR2QBHDb</serialNumber>
) - add the following automation script to your automations.yaml (
sudo nano /var/opt/homeassistant/automations.yaml
)
example:
- id: Test Roku Automation
alias: test_roku_automation
trigger:
- platform: event
event_type: roku_command
event_data:
roku_usn: 5sEE3ioBPJU2m3ZR2QBHDb
type: keypress
key: Info
action:
- service: media_player.volume_up
entity_id: media_player.amplifier
pay attention the the following stuff:
- the roku_usn’s value should be the serial number from step 8.
- you may find the service name and entity id in your homeassistant’s web ui under developer tools
- a list of harmony keys https://sdkdocs.roku.com/display/sdkdoc/External+Control+API#ExternalControlAPI-KeypressKeyValues
- reboot your raspberry pi (
sudo reboot
) - add a new device to your harmony remote control
- choose Roku as the brand and 1 and model (you can also find it in the discoverable devices)
- finish to add the Roku device and thats it you are good to go!
- press on the button that you configured in step 9 (Info button) and watch the magic