ollo69 / ha-smartthinq-sensors

HomeAssistant custom integration for SmartThinQ LG devices configurable with Lovelace User Interface.
Apache License 2.0
1.03k stars 149 forks source link

Connection not available. ThinQ platform not ready #737

Closed kalmma closed 1 month ago

kalmma commented 2 months ago

Describe the bug Connection not available. ThinQ platform not ready

I have been experiencing a problem with the integration for a few weeks now.

Screenshots

Scherm­afbeelding 2024-04-17 om 12 29 30

Environment details:

Output of HA logs Paste the relavant output of the HA log here.

This error originated from a custom integration.

Logger: custom_components.smartthinq_sensors Source: custom_components/smartthinq_sensors/init.py:252 integration: SmartThinQ LGE Sensors (documentation, issues) First occurred: 12:03:47 PM (1 occurrences) Last logged: 12:03:47 PM

Connection not available. ThinQ platform not ready Traceback (most recent call last): File "/config/custom_components/smartthinq_sensors/init.py", line 252, in async_setup_entry client = await lge_auth.create_client_from_token(refresh_token, oauth2_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/init.py", line 151, in create_client_from_token return await ClientAsync.from_token( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1570, in from_token await client.refresh() File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1488, in refresh self._auth = await self.auth.refresh(True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 983, in refresh access_token, token_validity = await self._gateway.core.refresh_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 701, in refresh_auth out = await self._auth_request( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 647, in _auth_request oauth_url = await self.get_oauth_url() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 430, in get_oauth_url async with self._get_session().post( File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 504, in _request with timer: File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in exit raise asyncio.TimeoutError from None TimeoutError

Connection not available. ThinQ platform not ready

pjoter1337666 commented 2 months ago

Same exact issue here. I think it stopped working after the HA core 2024.4.3 update. I also have an update in HACS available from v0.38.7 to v0.39.0 but it is not updating.

someevil commented 2 months ago

I have the same error, mine has occured because I had to 1) log into the app to accept updated terms and condtition, and 2) i had misplaced my username/password so I had to reset password for my LG account. Now I am trying to work out how to 'refresh' my username/password for LG app in HA and I am not having any luck.

Is it possibly you guys recently changed username/password or logged into your mobile ThinQ app?

fgimenezm commented 2 months ago

I had the same issue about accepting terms and conditions a few days (weeks?) ago but now it's broken again with a similar log

2024-04-22 14:11:37.235 WARNING (MainThread) [custom_components.smartthinq_sensors] Connection not available. ThinQ platform not ready Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 603, in _request resp = await req.send(conn) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 723, in send await writer.write_headers(status_line, self.headers) File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 130, in write_headers self._write(buf) File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 75, in _write raise ConnectionResetError("Cannot write to closing transport") ConnectionResetError: Cannot write to closing transport

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

Traceback (most recent call last): File "/config/custom_components/smartthinq_sensors/init.py", line 252, in async_setup_entry client = await lge_auth.create_client_from_token(refresh_token, oauth2_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/init.py", line 151, in create_client_from_token return await ClientAsync.from_token( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1570, in from_token await client.refresh() File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1488, in refresh self._auth = await self.auth.refresh(True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 983, in refresh access_token, token_validity = await self._gateway.core.refresh_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 701, in refresh_auth out = await self._auth_request( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 647, in _auth_request oauth_url = await self.get_oauth_url() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 430, in get_oauth_url async with self._get_session().post( File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 617, in _request raise ClientOSError(*exc.args) from exc aiohttp.client_exceptions.ClientOSError: Cannot write to closing transport

joelquadros commented 2 months ago

same here also ...

Traceback (most recent call last): File "/config/custom_components/smartthinq_sensors/init.py", line 252, in async_setup_entry client = await lge_auth.create_client_from_token(refresh_token, oauth2_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/init.py", line 151, in create_client_from_token return await ClientAsync.from_token( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1570, in from_token await client.refresh() File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1488, in refresh self._auth = await self.auth.refresh(True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 983, in refresh access_token, token_validity = await self._gateway.core.refresh_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 701, in refresh_auth out = await self._auth_request( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 647, in _auth_request oauth_url = await self.get_oauth_url() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 430, in get_oauth_url async with self._get_session().post(

fgimenezm commented 2 months ago

hmmm... this is odd... I enabled debug logging on the integration and I can see the devices being returned from the LG API calls. Maybe LG changed something today?

shwarnock commented 2 months ago

I too am having issues with this integration as of today. I have a ThinQ refrigerator.

DIntriglia commented 2 months ago

I am also running into this issue. Curious what the resolution will be.

RedWheiler80 commented 2 months ago

Same problem. The LG android app got an update, HA lost all connection.

erkr commented 2 months ago

Same issue since 2 hours. Had also an update on android. Both apps on Android and iOS work fine. integration now broken work the same token log error. All terms and conditions are accepted AFAIK

SeanPM5 commented 2 months ago

EDIT: Working again now for me, same as posts below. Didn't have to do anything, just started working.

Got this issue just now after restarting. Integration was working fine approx ~2 hours ago, reporting cooktop state etc. Then restarted Home Assistant and it's not connecting and all devices unavailable.

A few days ago there was terms of service update in ThinQ app (US) on iOS but don't see anything there now. App appears to work fine but not the integration.

This error originated from a custom integration.

Logger: custom_components.smartthinq_sensors
Source: custom_components/smartthinq_sensors/__init__.py:252
integration: SmartThinQ LGE Sensors (documentation, issues)
First occurred: 2:05:33 PM (1 occurrences)
Last logged: 2:05:33 PM

Connection not available. ThinQ platform not ready
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 603, in _request
    resp = await req.send(conn)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 723, in send
    await writer.write_headers(status_line, self.headers)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 130, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 75, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

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

Traceback (most recent call last):
  File "/config/custom_components/smartthinq_sensors/__init__.py", line 252, in async_setup_entry
    client = await lge_auth.create_client_from_token(refresh_token, oauth2_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/__init__.py", line 151, in create_client_from_token
    return await ClientAsync.from_token(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1570, in from_token
    await client.refresh()
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1488, in refresh
    self._auth = await self.auth.refresh(True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 983, in refresh
    access_token, token_validity = await self._gateway.core.refresh_auth(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 701, in refresh_auth
    out = await self._auth_request(
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 647, in _auth_request
    oauth_url = await self.get_oauth_url()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 430, in get_oauth_url
    async with self._get_session().post(
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 617, in _request
    raise ClientOSError(*exc.args) from exc
aiohttp.client_exceptions.ClientOSError: Cannot write to closing transport
lylydang commented 2 months ago

Edited: Seems to work again.

Same issue for me, not sure what breaks it in HA. I just noticed this today, my LG app still showing functional appliances.

Error logs:

Logger: custom_components.smartthinq_sensors
Source: custom_components/smartthinq_sensors/__init__.py:252
integration: SmartThinQ LGE Sensors ([documentation](https://github.com/ollo69/ha-smartthinq-sensors), [issues](https://github.com/ollo69/ha-smartthinq-sensors/issues))
First occurred: 11:38:58 AM (1 occurrences)
Last logged: 11:38:58 AM

Connection not available. ThinQ platform not ready
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 603, in _request
    resp = await req.send(conn)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 723, in send
    await writer.write_headers(status_line, self.headers)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 130, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 75, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
diegocjorge commented 2 months ago

I was having the same problem, but it just started working again at this very moment.

If it's not working for you guys, try re-adding the integration with your login credentials.

erkr commented 2 months ago

Yes it works for me as well (not restarted) since 8 minutes!

fgimenezm commented 2 months ago

Yup, fixed for me too.

RedWheiler80 commented 2 months ago

Works again for me.

shwarnock commented 2 months ago

Yup confirmed it works again

kalmma commented 2 months ago

For me it's not working.

This error originated from a custom integration.

Logger: custom_components.smartthinq_sensors Source: custom_components/smartthinq_sensors/init.py:252 integration: SmartThinQ LGE Sensors (documentation, issues) First occurred: 9:44:44 PM (1 occurrences) Last logged: 9:44:44 PM

Connection not available. ThinQ platform not ready Traceback (most recent call last): File "/config/custom_components/smartthinq_sensors/init.py", line 252, in async_setup_entry client = await lge_auth.create_client_from_token(refresh_token, oauth2_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/init.py", line 151, in create_client_from_token return await ClientAsync.from_token( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1570, in from_token await client.refresh() File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1488, in refresh self._auth = await self.auth.refresh(True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 983, in refresh access_token, token_validity = await self._gateway.core.refresh_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 701, in refresh_auth out = await self._auth_request( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 647, in _auth_request oauth_url = await self.get_oauth_url() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 430, in get_oauth_url async with self._get_session().post( File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 504, in _request with timer: File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in exit raise asyncio.TimeoutError from None TimeoutError

joelquadros commented 2 months ago

It's back in business here

erkr commented 2 months ago

@kalmma Error looks the same. Maybe some terms & conditions open to agree with?

jkosharek commented 2 months ago

For me it's not working. Logged out of the iPhone app and back in with no issues. Deleted and tried to re-add the integration and it fails:

Logger: custom_components.smartthinq_sensors Source: custom_components/smartthinq_sensors/init.py:252 integration: SmartThinQ LGE Sensors (documentation, issues) First occurred: 12:11:25 AM (1 occurrences) Last logged: 12:11:25 AM

Connection not available. ThinQ platform not ready Traceback (most recent call last): File "/config/custom_components/smartthinq_sensors/init.py", line 252, in async_setup_entry client = await lge_auth.create_client_from_token(refresh_token, oauth2_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/init.py", line 151, in create_client_from_token return await ClientAsync.from_token( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1570, in from_token await client.refresh() File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1488, in refresh self._auth = await self.auth.refresh(True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 983, in refresh access_token, token_validity = await self._gateway.core.refresh_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 701, in refresh_auth out = await self._auth_request( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 647, in _auth_request oauth_url = await self.get_oauth_url() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 430, in get_oauth_url async with self._get_session().post( File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 504, in _request with timer: File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in exit raise asyncio.TimeoutError from None TimeoutError

LongDono commented 2 months ago

I was forced to accept new terms in the mobile app a week or two ago, which included requiring an SMS sent code, which is new (and somewhat had me wondering if it would cause trouble for this integration). The app wouldn't take the old password so I had to change it, twice, as the first password change wouldn't allow me to login. I finally checked it on this intergration today and was greeted with this issue's error. I deleted the integration and re-added it with the new credentials. It detected all 7 devices and knew what rooms they belonged in. All seems well.

ollo69 commented 1 month ago

Close this because seems issue is fixed. Open a new one in case of specific problem