Emulated Roku for Harmony

Hey, I got this all set up in Hassio and it’s working really well. However, I am limited to the keypress actions and can’t figure out how to use the ‘launch’ event type. I’ve assigned a button to Netflix in the phone app, but Home Assistant isn’t picking up any signal from the remote. Can anyone point me in the right direction?

For example I use traefik reverse proxy on the same machine (nginx works too) so roku.[my-dns-name].org is an alias for <home-assistant-ip>:8060. Home Assistant and emulated_roku listens on 127.0.0.1, so it’s only accessible via the reverse proxy. (or other local processes, depends on how you configured docker networking)
I configured traefik so only Harmony’s IP is white-listed, all others are blocked.

In Home Assistant, I use this config for emulated_roku:
advertise_ip: roku.[my-dns-name].org
advertise_port: 80
listen_port: 8060
host_ip: 127.0.0.1

Yeah, Harmony uses IR for launch instead of the WIFI API, so it doesn’t work.

From the docs:

Harmony cannot launch apps as it uses IR instead of the WiFi API and will not display the custom dummy app list.

I understand that I can’t actually launch an app. However, the Emulated Roku component page says that I should be able to access the ‘launch’ activity and 10 dummy apps. I’m wondering if the process is different for being able to use those commands instead of keypress commands. Maybe I am misunderstanding the documentation?

Harmony can only use the keypress event, it cannot use the ‘launch’ event or the 10 dummy apps.
That means you can’t use the ‘Netflix’ command from the phone app, as it uses IR instead of the WIFI API.

Okay, thank you for the reply. They should just remove any mention of the ‘launch’ event from the component page because that is very confusing.

I’m new to Home Assistant, and getting this component working is the whole reason I’m trying it. I’m stuck however, in that my Harmony Hub cannot discover the Emulated Roku component. I’m running Home Assistant on Raspberry Pi, and I’ve installed the Emulated Roku component with the intent of having buttons on the Harmony remote activate Lutron Caseta Scenes. Home Assistant itself can successfully trigger the Scenes from the GUI on the Overview page. When I manually browse to the Home Assistant IP on port 8060, I do get a page with what I’m assuming is the correct text string for Emulated Roku. However, when I have my Harmony try to discover it, it fails to. So it seems like I’ve got the beginning (the Emulated Roku component installed) and the end (the Caseta Scenes in Home Assistant), but I can’t tie them together yet. I’ve seen the posts on here referring to logs, but I can’t find any logs that look like what people are posting. I’d welcome any help.

question:
i am using the roku integration for controlling volume (via a dedicated harmony activity using specific key presses as harmony remote Volume + and Volume - buttons cannot be assigned), however roku is not recognized within the harmony configuration as a device that can change volume for a specific device. is this normal? or is there a fix to that?

Since I upgraded my network I can’t find the emulated Roku within the Harmony.
I run home assistant in a VM with Docker and forwarded the ports. I can access the roku page via ip-of-home-assistant:8060 and can see the details there.
My Harmony Hub and the Home Assistant Server are on a separate VLAN and they are able to communicate, I was able to connect the Harmony to Home Assistant. I enabled UPnP, but my Harmony won’t find the Roku.

My config:

emulated_roku:
servers:
- name: Roku Emu
listen_port: 8060
host_ip: ip_of_vm
advertise_ip: ip_of_home_assistant_server
advertise_port: 8060

I don’t know what I’m missing here.

The easiest solution is to run the advertise.py script on a PC on the same VLAN as Harmony as mentioned in this post:

I wanted to try this as well, however if I go to ip-of-homeassistant:8060, in the section serial number it only says “Roku Emu” and in the section “udn” it says “uuid:some-numbers-and digits”, but the number doesn’t look like a serial number (in the past it was different, not connected with dashes and without uuid: in the front. I can post some screenshots in the evening if this helps.

“Roku Emu” is fine. It used to be generated, now the USN is the “name” config.

1 Like

It worked, my issue was that I used the advertise.py from a different VLAN. Using the advertise.py from the same VLAN as the harmony HUB worked like a charm.

Thanks a lot!

I feel like I’m missing something so simple yet I cannot for the life of me figure this out. I feel like I’ve tried everything and I still keep getting an error in logs for binding.py. Anyone have a clue as how to fix this? I have tried changing advertise ip, advertise port, changing the listening port, enabling and disabling UPnP on my Comcast router. With no avail, I still get this error when trying to bind to the port.
Thanks in advance. Running Hassio on RP3 B+

Log Details (ERROR)
Sun Jan 12 2020 14:32:44 GMT-0600 (CST)

Error setting up entry Home Assistant for emulated_roku
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 192, in async_setup
hass, self
File “/usr/src/homeassistant/homeassistant/components/emulated_roku/init.py”, line 91, in async_setup_entry
return await server.setup()
File “/usr/src/homeassistant/homeassistant/components/emulated_roku/binding.py”, line 159, in setup
await emulated_roku_start(None)
File “/usr/src/homeassistant/homeassistant/components/emulated_roku/binding.py”, line 142, in emulated_roku_start
await self._api_server.start()
File “/usr/local/lib/python3.7/site-packages/emulated_roku/init.py”, line 424, in start
reuse_address=True)
File “/usr/local/lib/python3.7/asyncio/base_events.py”, line 1211, in create_datagram_endpoint
raise ValueError("Passing reuse_address=True is no "
ValueError: Passing reuse_address=True is no longer supported, as the usage of SO_REUSEPORT in UDP poses a significant security concern.

no longer getting the binding.py error but still getting the “reuse_address=True is no longer supported”

Log Details (ERROR)
Sun Jan 12 2020 21:42:52 GMT-0600 (CST)

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/emulated_roku/binding.py”, line 142, in emulated_roku_start
await self._api_server.start()
File “/usr/local/lib/python3.7/site-packages/emulated_roku/init.py”, line 424, in start
reuse_address=True)
File “/usr/local/lib/python3.7/asyncio/base_events.py”, line 1211, in create_datagram_endpoint
raise ValueError("Passing reuse_address=True is no "
ValueError: Passing reuse_address=True is no longer supported, as the usage of SO_REUSEPORT in UDP poses a significant security concern.

Seems like newer python versions deprecated the flag. I’ve removed it and uploaded emulated_roku 0.1.9 to pypi. Unfortunately I can’t update the component currently, It’d be great if someone could bump the version in HASS.

is there anyway to install the component manually? would love to get this working.

You can copy the component from emulated_roku to custom_components in the configuration folder and bump the version in the manifest file.

pretty sure I understand the custom_components part but not sure about the manifest file