I would like to be able to control some of my electronics with my harmony elite hub.
In order to do that, I found the emulated_roku but unfortunately, I am unable to make it work.
I added what’s needed in the configuration.yaml but in the homeassistant web ui I get the following error:
Component not found: emulated_roku
Read the emulated_roku thread, almost guarantee you’ve made the same mistake many others have.
I was able to understand since the beginning that I am supposed to put the roku_emulated.py in custom_components folder I just didnt understand where is that custom_components folder so I created one in the homeassistant dir and I think it’s fine now.
I followed the instructions and configuration wise everything should be ok unless I missed something, but it still isnt working and here is my automations.yaml
- id: turn_off_ac alias: Turn off AC trigger: - platform: event event_type: roku_command event_data: type: keypress key: Fwd action: - service: climate.turn_off entity_id: climate.my_room
when I press on the Forward button on my harmony elite remote control nothing happens. am I missing something?
It’s also not working when I click on the toggle of this automation in the home assistant web ui
Your automation is perfect bar the fact you’ve forgotten to add the roku_usn: entry under event_data
I didn’t forget it, I left it out on purpose. The documentation says it’s not needed if you use emulated.
roku_usn the serial number of the roku. Not required for when using one Emulated Roku instance
I navigated to the local ip with roku’s port and took the serial number from that file and used it in the roku_usn but still nothing happens when I click on the Fwd button on my harmony. I even tried to use different buttons
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_componentsinside the homeassistant folder
- create file
roku_emulated.pyinside 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
- add the following configuration to the homeassistant’s configuration.yam (
sudo nano /var/opt/homeassistant/configuration.yaml)
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 (
- 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 (
- add the following automation script to your automations.yaml (
sudo nano /var/opt/homeassistant/automations.yaml)
- 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 (
- 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
that would explain a lot. Congrats for being man enough to admit it