core icon indicating copy to clipboard operation
core copied to clipboard

LG Thinq Failed to Setup

Open arthurperezbessa opened this issue 7 months ago • 6 comments

The problem

Hi there,

I'm having an issue with my LG integration in Home Assistant. Occasionally, it fails to set up properly. While the problem usually resolves itself after manually reloading the integration, I’d like to automate this process whenever the climate entity becomes unavailable.

Here’s the tricky part: in the Home Assistant UI, the climate entity shows as unavailable, but when I check the device under Settings → Devices & Services → Integrations, it doesn’t appear as unavailable.

So I’m looking for help in two areas:

How can I reliably detect when the climate device becomes unavailable?

What can I do to prevent the integration from failing in the first place?

Thanks in advance for your help!

What version of Home Assistant Core has the issue?

core-2025.2.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

lg_thinq

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet


Anything in the logs that might be useful for us?


Additional information

No response

arthurperezbessa avatar May 05 '25 18:05 arthurperezbessa

The message shown in the logs: Error setting up entry LG ThinQ for lg_thinq

arthurperezbessa avatar May 05 '25 18:05 arthurperezbessa

How can I reliably detect when the climate device becomes unavailable?

This is a question for one of the support channels the Community Forum or the Discord chat server.

What can I do to prevent the integration from failing in the first place?

please provide more details about the error message, you'll find the full log file under Settings > System > Logs

mib1185 avatar May 05 '25 19:05 mib1185

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

Code owner commands

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


lg_thinq documentation lg_thinq source (message by IssueLinks)

home-assistant[bot] avatar May 05 '25 19:05 home-assistant[bot]

How can I reliably detect when the climate device becomes unavailable?

This is a question for one of the support channels the Community Forum or the Discord chat server.

What can I do to prevent the integration from failing in the first place?

please provide more details about the error message, you'll find the full log file under Settings > System > Logs

Logger: homeassistant.config_entries
Source: config_entries.py:637
First occurred: May 1, 2025 at 11:12:41 (1 occurrences)
Last logged: May 1, 2025 at 11:12:41

Error setting up entry LG ThinQ for lg_thinq
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/resolver.py", line 103, in resolve
    resp = await self._resolver.getaddrinfo(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
    )
    ^
aiodns.error.DNSError: (12, 'Timeout while contacting DNS servers')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1351, in _create_direct_connection
    hosts = await self._resolve_host(host, port, traces=traces)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 995, in _resolve_host
    return await asyncio.shield(resolved_host_task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1026, in _resolve_host_with_throttle
    addrs = await self._resolver.resolve(host, port, family=self._family)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp_asyncmdnsresolver/_impl.py", line 130, in resolve
    return await super().resolve(host, port, family)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/resolver.py", line 112, in resolve
    raise OSError(None, msg) from exc
OSError: [Errno None] Timeout while contacting DNS servers

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 637, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/lg_thinq/__init__.py", line 71, in async_setup_entry
    await async_setup_coordinators(hass, entry, thinq_api)
  File "/usr/src/homeassistant/homeassistant/components/lg_thinq/__init__.py", line 93, in async_setup_coordinators
    bridge_list = await async_get_ha_bridge_list(thinq_api)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/thinqconnect/integration/homeassistant/api.py", line 733, in async_get_ha_bridge_list
    device_list = await thinq_api.async_get_device_list()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/thinqconnect/thinq_api.py", line 169, in async_get_device_list
    return await self.async_request(method=METH_GET, endpoint="devices", timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/thinqconnect/thinq_api.py", line 305, in async_request
    async with await self._async_fetch(method=method, url=url, **kwargs, headers=headers) as response:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/thinqconnect/thinq_api.py", line 161, in _async_fetch
    return await self._session.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 703, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        req, traces=traces, timeout=real_timeout
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 548, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1056, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1357, in _create_direct_connection
    raise ClientConnectorDNSError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host api-aic.lgthinq.com:443 ssl:default [Timeout while contacting DNS servers]

arthurperezbessa avatar May 05 '25 20:05 arthurperezbessa

aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host api-aic.lgthinq.com:443 ssl:default [Timeout while contacting DNS servers] looks like your HA instance can't reach the DNS server on your network. You should check your network and DNS configuration.

mib1185 avatar May 05 '25 20:05 mib1185

aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host api-aic.lgthinq.com:443 ssl:default [Timeout while contacting DNS servers] looks like your HA instance can't reach the DNS server on your network. You should check your network and DNS configuration.

I added the Cloudfare DNS to the IP configuration. Let's see if it works. Thanks

arthurperezbessa avatar May 05 '25 20:05 arthurperezbessa

I have a similar problem, has anyone found a solution?

mkz212 avatar May 20 '25 09:05 mkz212

I have a similar problem, has anyone found a solution?

Add the Cloudfare (1.1.1.1) or Google (8.8.8.8) DNS to your HA Network Setup. So for I had not this issue again, but i keep monitoring

arthurperezbessa avatar May 20 '25 10:05 arthurperezbessa

I have a similar problem, has anyone found a solution?

Add the Cloudfare (1.1.1.1) or Google (8.8.8.8) DNS to your HA Network Setup. So for I had not this issue again, but i keep monitoring

That doesn't solve the problem.

Image

mkz212 avatar May 20 '25 10:05 mkz212

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.