home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.95k stars 31.01k forks source link

nfandroidtv - Error connecting to the device #130553

Open SergioRius opened 1 week ago

SergioRius commented 1 week ago

The problem

Trying to setup Android TV notifications on my Shield TV but after all the setup is done, the integration in home assistant can't connect. I've setup the related Notifier app in the TV, ran it and gave the required permissions. I've tried with the bare Ip of the Shield and with the api address shown in the app.

What version of Home Assistant Core has the issue?

core-2024.11.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

nfandroidtv

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nfandroidtv

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Registrador: homeassistant.components.nfandroidtv.config_flow
Fuente: components/nfandroidtv/config_flow.py:55
integración: nfandroidtv (documentación, problemas)
Ocurrió por primera vez: 19:37:20 (6 ocurrencias)
Última vez registrado: 20:10:20

Error connecting to device at 10.1.5.34
Error connecting to device at http://10.1.5.34
Error connecting to device at http://10.1.5.34:7676/api

-------------------------------------------------------------------------------------------

Registrador: homeassistant.components.nfandroidtv.config_flow
Fuente: components/nfandroidtv/config_flow.py:53
integración: nfandroidtv (documentación, problemas)
Ocurrió por primera vez: 20:11:01 (1 ocurrencias)
Última vez registrado: 20:11:01

Unexpected exception
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.12/site-packages/requests/models.py", line 433, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
                                                      ^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/urllib3/util/url.py", line 397, in parse_url
    return six.raise_from(LocationParseError(source_url), None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: http://10.1.5.34:7676:7676

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/nfandroidtv/config_flow.py", line 53, in _async_try_connect
    await self.hass.async_add_executor_job(Notifications, host)
  File "/usr/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/notifications_android_tv/notifications.py", line 62, in __init__
    requests.get(self.url, timeout=self.DEFAULT_TIMEOUT)
  File "/srv/homeassistant/lib/python3.12/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/requests/sessions.py", line 575, in request
    prep = self.prepare_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/requests/sessions.py", line 484, in prepare_request
    p.prepare(
  File "/srv/homeassistant/lib/python3.12/site-packages/requests/models.py", line 367, in prepare
    self.prepare_url(url, params)
  File "/srv/homeassistant/lib/python3.12/site-packages/requests/models.py", line 435, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://10.1.5.34:7676:7676

Additional information

If leaving the default name (2nd box as is) it registered the device. Then I don't know if it was the fact of re-trying or if there's a problem with the name. After deleting the wrong named device, still persists in home assistant.

home-assistant[bot] commented 1 week ago

Hey there @tkdrob, mind taking a look at this issue as it has been labeled with an integration (nfandroidtv) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `nfandroidtv` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign nfandroidtv` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


nfandroidtv documentation nfandroidtv source (message by IssueLinks)