Roku devices not being discovered after 0.86

Just curious, anyone else having issue with getting Roku devices to auto-discover since the new breaking change in 0.86? I have roku: in the configuration.yaml file (and went back and deleted the entries in media_player.yaml. I scrubbed all Roku entities from all yaml files and have cleared cache in Chrome. I did have some success by adding host to roku: entry in config file. Worked for a day or two, then I updated to 0.86.3 and they were gone again. Rolled back to 0.86.2 and still not showing up. Getting roku component failed to initialize errors in my logs. Running Hassio on VM in WIndows.

1 Like

Guess I am the only one

I also had difficulty getting my Roku showing up after a recent update. I was only able to get it working again by allowing autodiscovery for that component.

I commented-out my roku from the configuration.yaml

media_player:
#  - platform: roku
#    name: Roku Streaming Stick
#    host: 192.168.86.8

And then modified the discovery settings so that I was not ignoring the roku component.

discovery:
  ignore:
   #- samsungtv
   - yamaha
   - philips_hue
   - harmony
   #- roku
   - igd

There was actually a breaking-change explain note for this. Not sure if there’s a way to get the manual registration method back:
“Previous “manual” registration of roku devices will need to be updated or removed (discovery should discover all rokus on your network). (@soberstadt - #17548) (roku docs 1) (media_player.roku docs 2) (remote.roku docs 1) (breaking change) (new-platform)”

Thanks for the reply.

I did note the breaking change and commented out my roku in the media_player.yaml file and then added directly into the config.yaml, even added the host ip numbers.

Funny thing is, after my post this morning, they suddenly started working without any additional changes to my configuration. For several days they were not there, then I do a reboot this morning and there they are. (I have done several reboots prior to this morning with not change). Not sure how or why, but I am going to keep an eye on it.

Thanks.

Hmm… do you have your Roku’s setup with static IPs? If not, perhaps they are getting new IPs and then getting lost by Home Assistant? Just a thought.

The Roku’s are all DHCP, however I have assigned static IP addresses to them in my router so they are always given the same address. I’ve been doing some automation programming today and have rebooted multiple times and the Roku’s are still showing up fine as of right now. I am running 0.86.2 and am hesitant to upgrade to 0.86.3 because that was when the Rokus stopped working the last time.

Rebooted today and they are gone again.

image

Log below:

2019-01-31 16:11:57 DEBUG (MainThread) [async_upnp_client.traffic] Received packet from (‘192.168.0.38’, 1900):
b’HTTP/1.1 200 OK\r\nCache-Control: max-age=3600\r\nST: upnp:rootdevice\r\nUSN: uuid:05584181-8c02-1094-80ab-080581d50761::upnp:rootdevice\r\nExt: \r\nServer: Roku UPnP/1.0 Roku/9.0.0\r\nLOCATION: http://192.168.0.38:8060/\r\nWAKEUP: MAC=08:05:81:d5:07:61;Timeout=10\r\n\r\n’
2019-01-31 16:11:57 DEBUG (MainThread) [async_upnp_client.discovery] Received response: {‘cache-control’: ‘max-age=3600’, ‘st’: ‘upnp:rootdevice’, ‘usn’: ‘uuid:05584181-8c02-1094-80ab-080581d50761::upnp:rootdevice’, ‘ext’: ‘’, ‘server’: ‘Roku UPnP/1.0 Roku/9.0.0’, ‘location’: ‘http://192.168.0.38:8060/’, ‘wakeup’: ‘MAC=08:05:81:d5:07:61;Timeout=10’, ‘_timestamp’: datetime.datetime(2019, 1, 31, 16, 11, 57, 548678)}
2019-01-31 16:11:57 DEBUG (MainThread) [async_upnp_client.traffic] Received packet from (‘192.168.0.38’, 1900):
b’HTTP/1.1 200 OK\r\nCache-Control: max-age=3600\r\nST: roku:ecp\r\nUSN: uuid:roku:ecp:5F461S169131\r\nExt: \r\nServer: Roku UPnP/1.0 Roku/9.0.0\r\nLOCATION: http://192.168.0.38:8060/\r\ndevice-group.roku.com: E4D7FFC65E1EAC308A81\r\nWAKEUP: MAC=08:05:81:d5:07:61;Timeout=10\r\n\r\n’
2019-01-31 16:11:57 DEBUG (MainThread) [async_upnp_client.discovery] Received response: {‘cache-control’: ‘max-age=3600’, ‘st’: ‘roku:ecp’, ‘usn’: ‘uuid:roku:ecp:5F461S169131’, ‘ext’: ‘’, ‘server’: ‘Roku UPnP/1.0 Roku/9.0.0’, ‘location’: ‘http://192.168.0.38:8060/’, ‘device-group.roku.com’: ‘E4D7FFC65E1EAC308A81’, ‘wakeup’: ‘MAC=08:05:81:d5:07:61;Timeout=10’, ‘_timestamp’: datetime.datetime(2019, 1, 31, 16, 11, 57, 549786)}
2019-01-31 16:11:57 DEBUG (MainThread) [async_upnp_client.traffic] Received packet from (‘192.168.0.38’, 1900):
b’HTTP/1.1 200 OK\r\nCache-Control: max-age=3600\r\nST: urn:dial-multiscreen-org:service:dial:1\r\nUSN: uuid:05584181-8c02-1094-80ab-080581d50761::urn:dial-multiscreen-org:service:dial:1\r\nExt: \r\nServer: Roku UPnP/1.0 Roku/9.0.0\r\nLOCATION: http://192.168.0.38:8060/dial/dd.xml\r\nWAKEUP: MAC=08:05:81:d5:07:61;Timeout=10\r\n\r\n’
2019-01-31 16:11:57 DEBUG (MainThread) [async_upnp_client.discovery] Received response: {‘cache-control’: ‘max-age=3600’, ‘st’: ‘urn:dial-multiscreen-org:service:dial:1’, ‘usn’: ‘uuid:05584181-8c02-1094-80ab-080581d50761::urn:dial-multiscreen-org:service:dial:1’, ‘ext’: ‘’, ‘server’: ‘Roku UPnP/1.0 Roku/9.0.0’, ‘location’: ‘http://192.168.0.38:8060/dial/dd.xml’, ‘wakeup’: ‘MAC=08:05:81:d5:07:61;Timeout=10’, ‘_timestamp’: datetime.datetime(2019, 1, 31, 16, 11, 57, 550828)}
2019-01-31 16:11:57 ERROR (MainThread) [homeassistant.setup] Error during setup of component roku
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File “/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py”, line 80, in create_connection
raise err
File “/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py”, line 70, in create_connection
sock.connect(sa)
OSError: [Errno 113] Host is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File “/usr/local/lib/python3.6/http/client.py”, line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/local/lib/python3.6/http/client.py”, line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “/usr/local/lib/python3.6/http/client.py”, line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “/usr/local/lib/python3.6/http/client.py”, line 1026, in _send_output
self.send(msg)
File “/usr/local/lib/python3.6/http/client.py”, line 964, in send
self.connect()
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 181, in connect
conn = self._new_conn()
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 168, in _new_conn
self, “Failed to establish a new connection: %s” % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0c821e5080>: Failed to establish a new connection: [Errno 113] Host is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/requests/adapters.py”, line 449, in send
timeout=timeout
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File “/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py”, line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=‘192.168.0.29’, port=8060): Max retries exceeded with url: /query/device-info (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7f0c821e5080>: Failed to establish a new connection: [Errno 113] Host is unreachable’,))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/setup.py”, line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/roku.py”, line 62, in setup
_setup_roku(hass, config, conf)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/roku.py”, line 105, in _setup_roku
r_info = roku.device_info
File “/usr/local/lib/python3.6/site-packages/roku/core.py”, line 213, in device_info
resp = self._get(’/query/device-info’)
File “/usr/local/lib/python3.6/site-packages/roku/core.py”, line 172, in _get
return self._call(‘GET’, path, *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/roku/core.py”, line 189, in _call
resp = func(url, *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 546, in get
return self.request(‘GET’, url, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 533, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 646, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/adapters.py”, line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘192.168.0.29’, port=8060): Max retries exceeded with url: /query/device-info (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7f0c821e5080>: Failed to establish a new connection: [Errno 113] Host is unreachable’,))
2019-01-31 16:11:57 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following components and platforms could not be set up:

Please check your config., notification_id=invalid_config>
2019-01-31 16:11:57 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=None, new_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, message=The following components and platforms could not be set up:

Please check your config. @ 2019-01-31T16:11:57.626137-05:00>>

Are the roku’s powered on during the reboot? I have my usb power going to a constant power source. But perhaps if you are using a USB outlet on the back of you TV, it might not be powered on when HA is rebooting?

I thought about that, because one of them is actually powered by the usb on the back of the TV, but it can’t be that because my TCL Roku TV also doubles as a PC monitor that I am using right now. Even so, I wonder why they show up for a few days only, then disappear again, only to reappear a few days later. Just doesn’t make sense. The component is failing…intermittently…but why?

Figured out the issue. I had to exclude Roku from discovery and manually add the host IP addresses. Apparently it is a known issue with discovery on a 64 bit Linux or Windows install.

1 Like

It does not work adding them manually either, keep getting an notification it was configured wrong but I am use what the site says to use.

roku:
  host: 192.168.1.10

I had the same problem with Roku after .102 but it is now working again strangely

Hopefully your is too!

Weirdly, I just made some unrelated configuration changes and none of the 4 Roku device show up. One of them certainly might be asleep, but the other 3 respond just find when I manually do a curl command at them (like curl 10.200.20.3:8060/query/apps).

I restarted Home Assistant, and they didn’t come back - still running version 0.101.3 of Home Assistant for the last few weeks. Maybe I’ll just kill and restart the docker container and see if that help. I hate just doing random poking-in-the-eye stuff like this.

I get similar errors about not being able to contact the device.

So this is interesting. I’ve got 4 Roku devices, and right now, one of them is powered down/off and not on the network. If I comment that one out of my configuration, the Home Assistant starts up and finds the remaining 3 devices.

Interesting.