2017-11-26 17:41:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "uvloop/loop.pyx", line 2448, in uvloop.loop.Loop.create_datagram_endpoint (uvloop/loop.c:44337)
File "uvloop/handles/udp.pyx", line 117, in uvloop.loop.UDPTransport._bind (uvloop/loop.c:103378)
OSError: [Errno 98] Address in use
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 179, in _step
result = coro.send(None)
File "/config/custom_components/emulated_roku.py", line 100, in start_emulated_roku
discovery_server, _ = yield from discovery_endpoint
File "uvloop/loop.pyx", line 2459, in create_datagram_endpoint (uvloop/loop.c:44639)
OSError: could not bind to local_addr ('0.0.0.0', 1900)
So this is the weirdness I was talking about… On windows where I was testing portability, python has reuse_address=True parameter for asyncio datagram sockets, but I couldn’t do the same on linux because the python version was lagging behind. Now that hassio has an updated python I think the if branch can be removed. (resinio uses multicasting so the port must be reused)
Well, wifi is pretty weak in my room (I have a tp-link switch which keeps filling the HASS logs with communication errors) and I don’t think the Harmony Hub handles such errors gracefully, thus freezing the whole thing. I’ve tested scenarios where I’ve killed HASS while I was using Harmony and it handled that fine, so I don’t think any errors in the emulated roku implementation could bring the Harmony Hub down.
Edit: I’ll try to push an updated version tonight.
I literally just used the example from the readme and tweaked the serial for what was shown in Harmony at set up. Then just change names to whatever you want, pick a key, assign any service you have set up in HA and that’s it.
It just feels a little weird at first because you use automations as the middle man.
Should only show in dev-state when you have a autodiscovery or the roku component enabled. (basically hass discovers itself…)
I’ll open a PR when I get around making a dev env.
Also, Android remotes don’t auto discover the emulated roku server which I don’t quite understand. Perhaps something is wrong with the model number, etc in the response template. (I’d like to be as compatible with the original API as possible)
Ahh…I don’t have the component enabled and I killed discovery five minutes after first using HA as all I got out of it was loads of ongoing errors in the log from devices I had no interest in.
Is there any advantage to enabling the component if you don’t have a real one and want to control it.
Would you happen to have a list of the key names that work as the names Harmony uses don’t work eg in your example you use Fwd which works perfectly but FastForward as Harmony itself calls it doesn’t. This is the full list of Harmony names…
PowerOn
DirectionDown
DirectionLeft
DirectionRight
DirectionUp
Select
Play
Rewind
Pause
FastForward
Back
Search
Sleep
Info
PageDown
PageUp
Exit
Netflix
Pandora
Amazon
Crackle
HBONow
Home
Hulu
InstantReplay
MGO
Options*
Showtime
SlingTv
Vudu