Emulated Roku for Harmony

Yes! I just discovered sequences when poking around in the Harmony app and that’s exactly what I was looking for. Tested it out where play/pause is sent to the device and then also to HA and it works perfectly!

I’m trying to get Emulated Roku setup, but when I add the integration, no matter what port I configure it to use, I get an error “Address already in use” and I’m unable to view the Emulated Roku at ip:8060 (or whatever port I’ve setup the integration to use). And when I scan for devices in the MyHarmony app, it doesn’t find the Emulated Roku.

Here is the trace:

2023-01-10 19:23:54.893 ERROR (MainThread) [homeassistant.components.emulated_roku] Failed to start Emulated Roku RokuHA on 192.168.0.109:8068
Traceback (most recent call last):
  File "/Users/eengert/homeassistant/lib/python3.10/site-packages/homeassistant/components/emulated_roku/binding.py", line 142, in emulated_roku_start
    await self._api_server.start()
  File "/Users/eengert/homeassistant/lib/python3.10/site-packages/emulated_roku/__init__.py", line 419, in start
    self.sock.bind(("", MULTICAST_PORT))
OSError: [Errno 48] Address already in use

EDIT: I’ve since tried setting up HA and Emulated Roku on a different Mac and I get the exact same issues. No matter what ports I try, Emulated Roku gets an “Address already in use” error when trying to start.

So I am running HASS in a docker container with network as bridge. Is there a way to make this work? It works when I set network to host but that is not a great idea.

A long time ago I added a Roku device to MyHarmony :

image

I have mapped buttons on the Harmony remote to Roku keys, wich fire events in Home Assistant…works great !

But…only the Roku keys listed here are working. The problem is that not all listed keys are available in the Harmony Software.

F.e. “channel_down” is not available :

image

Which Roku device should I chose to get the most of the working keys ?

click buttons in the roku device and see what event’s appear. Chances are it’s the page up / page down buttons.

Nope :unamused:

But…is there a way to get the name of the key ?

This is fired :

  - platform: event
    event_type: roku_command
    event_data:
      source_name: Home Assistant
      type: keypress
    id: general

Now, how can I get the name of the key ?

      - conditions:
          - condition: trigger
            id:
              - general
        sequence:

Watch the event in event viewer

developer tools → event

I found it with ‘trace’ :wink:

Meanwhile I found that the list is not complete : InstantReplay and PowerOff are also working.

Thanks for the help !

Some events are sent as infrared to the Roku device, instead of wifi in harmony, so those cannot be used.

InstantReplay is not on the list, but works for me.

  - platform: event
    event_type: roku_command
    event_data:
      source_name: Home Assistant
      type: keypress
      key: InstantReplay
    id: open Goplay
`      - conditions:
          - condition: trigger
            id:
              - open Goplay
        sequence:
          - service: script.ga_open_goplay
            metadata: {}
            data: {}

The list of commads for emulated ROKU includes InstantReplay as listed here:

Correct, thank you !

PS : PowerOff is not on the list, but works too.

1 Like

Nice, I see now that PowerOff is not listed but fires an event!