Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot specify powerview-g3.local as the hub address during setup #134364

Open
tailg8nj opened this issue Dec 31, 2024 · 1 comment
Open

Cannot specify powerview-g3.local as the hub address during setup #134364

tailg8nj opened this issue Dec 31, 2024 · 1 comment

Comments

@tailg8nj
Copy link

tailg8nj commented Dec 31, 2024

The problem

I have a PowerView G3 hub. When I go to add the integration, the config flow asks for the host. I cannot specify the local DNS name powerview-g3.local, only the IP.

I've traced the code path to the following config flow:

api = await async_connect_hub(hass, hub_address)

Subsequent util call:

websession = async_get_clientsession(hass)

which gets the HTTP client and TCP connector from homeassistant:

resolver=AsyncResolver(),

Running sudo docker exec -it homeassistant python with the following reproduces the error:

import asyncio
import logging

import aiohttp
from aiopvapi.helpers.aiorequest import AioRequest
from aiopvapi.hub import Hub


_LOGGER = logging.getLogger(__name__)

logging.basicConfig(level=logging.DEBUG)

async def on_request_exception(session, trace_config_ctx, params):
    _LOGGER.exception("Exception request")


trace_config = aiohttp.TraceConfig()
trace_config.on_request_exception.append(on_request_exception)

async def setup(host):
    async with aiohttp.ClientSession(trace_configs=[trace_config]) as client:
        pv_request = AioRequest(host, websession=client)
        hub = Hub(pv_request)
        await hub.query_firmware()


asyncio.run(setup("powerview-g3.local"))
aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host powerview-g3.local:80 ssl:default [Domain name not found]
DEBUG:aiopvapi.hub:Gen 3 connection failed Failed to communicate with PowerView Hub

I am not sure if this is related to aio-libs/aiohttp#10186

I cannot curl inside the container either via:

$ sudo docker exec homeassistant curl -vs http://powerview-g3.local/gateway/info
* Could not resolve host: powerview-g3.local
* shutting down connection #0

However, executing curl outside the docker container works

$ curl -si http://powerview-g3.local/gateway/info
HTTP/1.1 200 OK

Workarounds:

  • leveraging a static IP
  • leverageing zeroconf config flow similar to this comment (although my hub doesn't seem to show up in Discovered, while Google cast and others do)

But I think this is a bigger issue than just PowerView. I guess this comes down to should folks expect to be able to leverage local DNS names in their integration setup or should integrations lean on zeroconf or other mechanisms?

What version of Home Assistant Core has the issue?

core-2024.12.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Hunter Douglas PowerView

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

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

Code owner commands

Code owners of hunterdouglas_powerview 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 hunterdouglas_powerview 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)


hunterdouglas_powerview documentation
hunterdouglas_powerview source
(message by IssueLinks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants