I bought a Harmony a while ago and I got tired of not being able to run arbitrary stuff through wifi.
Emulated Hue worked, but creating switches was too cumbersome and you can only map the Home Control buttons to it.
Luckily, Harmony can control Roku through wifi too, and the Roku API is well documented, so I implemented it in python: Emulated Roku
With this, you can map all the buttons on the Harmony remote to Roku keys, which fire events you can use in automations.
You can create multiple roku servers if you run out of the predefined buttons.
I’ve been only using asyncio for a few days and my python is quite rusty so it may crash / burn your pi.
Only tested it with Harmony, but it could work with other Roku remotes.
Currently using it to control my NAD amplifier’s volume through WIFI instead of IR.
Follow the README and the Harmony app should auto discover it.
This is home assistant’s equivalent to fhem/iobroker’s “fakeroku”. (search word bump :-)) I was looking for this for so long. We need to get this integrated into the home assistant core.
Interesting, missed this when you announced and am guessing many others did too by the lack of feedback. Not sure what I’m going to do with it yet but I’ll get my thinking hat on.
I did that (./custom:components/emulated_eoku/emulated_roku.py) and just coped the config (changed the ip to the HA ip) and restarted. But it says in the log that emulated_roku can’t be found?
Error during setup of component emulated_roku
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 190, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File "/usr/lib/python3.6/asyncio/coroutines.py", line 210, in coro
res = func(*args, **kw)
File "/config/custom_components/emulated_roku.py", line 41, in async_setup
from emulated_roku import RokuDiscoveryServerProtocol, RokuEventHandler, make_roku_api
ModuleNotFoundError: No module named 'emulated_roku'
As a test I just copied the folder (emulated_roku) to /custom_components/emulated_roku and now it says:
Error during setup of component emulated_roku
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 193, in _async_setup_component
component.setup, hass, processed_config)
AttributeError: module 'custom_components.emulated_roku' has no attribute 'setup'
No, it should download the dependency dynamically. The only file you need is emulated_roku.py.
The last hass version I’ve tested was 0.55, maybe something has changed? It uses ‘async_setup’ instead of ‘setup’. I’ll take a look tomorrow.
The pure python emulated roku library is published to the python package index. Unfortunately third party components must be installed manually so it requires some knowledge, which is the same for all third party components.
The file that needs installing is just a bridge between the package on pypi and hass:)
Seems to work fine on 0.58.1 (official docker image)
Perhaps you have mixed up ha-emulated_roku and emulated_roku? (there’s no setup function in emulated_roku as it has nothing to do with HASS)
What you need to copy is ha-emulated_roku/components/emulated_roku.py to custom_components/emulated_roku.py and HASS should download the emulated_roku dependency from pypi when it starts up.
Your first error says that it couldn’t find (didn’t download from pypi) the emulated_roku library, which is weird.
I don’t know enough about HASS internals to know why that could happen. Have you tried restarting HASS again? (I’ve had errors like this once, a restart solved it)
I’ve used the component daily since I’ve posted it, and it is pretty stable, except for Harmony Hub losing WiFi all the time and having to reset it…