Unable to setup emulated_roku

Hi,
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.

Thanks Bobby,

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 :slight_smile:

1 Like

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

  1. give write permissions to homeassistant folder (sudo chmod -R 777 /var/opt/homeassistant)
  2. create folder custom_components inside the homeassistant folder
  3. create file roku_emulated.py inside that folder from the above step
  4. copy content of https://gitlab.com/mindig.marton/ha-emulated_roku/blob/master/components/emulated_roku.py to the roku_emulated.py
  5. 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
  1. reboot your raspberry pi (sudo reboot)
  2. 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)
  3. copy the serial number (the value between the serialNumber tags (<serialNumber>5sEE3ioBPJU2m3ZR2QBHDb</serialNumber>)
  4. 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:

  1. reboot your raspberry pi (sudo reboot)
  2. add a new device to your harmony remote control
  3. choose Roku as the brand and 1 and model (you can also find it in the discoverable devices)
  4. finish to add the Roku device and thats it you are good to go!
  5. press on the button that you configured in step 9 (Info button) and watch the magic

:rofl: that would explain a lot. Congrats for being man enough to admit it :+1:

Does this integration still work for you please? In particular the discovery of the roku device in the harmony app?