ollo69 / ha-smartthinq-sensors

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

Can't login. #786

Open MaestroEngineering opened 2 months ago

MaestroEngineering commented 2 months ago

The integration worked last week just fine, tried to check why my automations didnt run and found it had an error, I tried logging back in and kept getting this error:

Invalid SmartThinQ credentials. Use the LG App on your mobile device to verify if there are Term of Service to accept. Account based on social network are not supported and in most case do not work with this integration.

I signed out on the app and signed back in again, there are no Ts and Cs I need to accept.

Screenshot_20240817_132330_Home Assistant

Environment details:

Output of HA logs This error originated from a custom integration.

Logger: custom_components.smartthinq_sensors Source: custom_components/smartthinq_sensors/init.py:135 integration: SmartThinQ LGE Sensors (documentation, issues) First occurred: 12:10:29 PM (2 occurrences) Last logged: 12:14:20 PM

Error retrieving OAuth info from ThinQ Traceback (most recent call last): File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 910, in oauth_info_from_user_login token_info = await gateway.core.auth_user_login( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 600, in auth_user_login raise exc.TokenError() custom_components.smartthinq_sensors.wideq.core_exceptions.TokenError: Token Error

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 135, in get_oauth_info_from_login return await ClientAsync.oauth_info_from_user_login( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1623, in oauth_info_from_user_login result = await Auth.oauth_info_from_user_login(username, password, gateway) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 919, in oauth_info_from_user_login raise exc.AuthenticationError("User login failed") from ex custom_components.smartthinq_sensors.wideq.core_exceptions.AuthenticationError: User login failed

rafaelarcanjo commented 2 months ago

Same error here. Now when trying to log in to the app thing, a 2fa is requested via SMS. I believe this is the problem.

drsmarsden commented 2 months ago

Ha version 2024.8.3 but broken a few days Lg app access ok but took ages to login

This error originated from a custom integration.

Logger: custom_components.smartthinq_sensors Source: custom_components/smartthinq_sensors/init.py:269 integration: SmartThinQ LGE Sensors (documentation, issues) First occurred: 18:31:50 (1 occurrences) Last logged: 18:31:50

Connection not available. ThinQ platform not ready Traceback (most recent call last): File "/config/custom_components/smartthinq_sensors/init.py", line 269, in async_setup_entry client = await lge_auth.create_client_from_token( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/init.py", line 153, in create_client_from_token return await ClientAsync.from_token( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1605, in from_token await client.refresh() File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1513, in refresh self._auth = await self.auth.refresh(True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 989, in refresh access_token, token_validity = await self._gateway.core.refresh_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 707, in refresh_auth out = await self._auth_request( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 675, in _auth_request raise exc.TokenError() custom_components.smartthinq_sensors.wideq.core_exceptions.TokenError: Token Error

wepster commented 2 months ago

Same here Please advise

macavelly commented 1 month ago

Also having this same issue.

wepster commented 1 month ago

For me it started working the next day, without mine intervention. Looks like its your turn now :)

rafaelarcanjo commented 1 month ago

Here the issue persists.


Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1155, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 874, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -3] Try again

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 134, in get_oauth_info_from_login
    return await ClientAsync.oauth_info_from_user_login(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1498, in oauth_info_from_user_login
    gateway = await Gateway.discover(core)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 702, in discover
    gw_info = await core.gateway_info()
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 408, in gateway_info
    result = await self.thinq2_get(V2_GATEWAY_URL)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 295, in thinq2_get
    async with self._get_session().get(
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1169, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host route.lgthinq.com:46030 ssl:default [Try again]```
MaestroEngineering commented 1 month ago

Thought it might be my HA Time that was wrong, but I double checked that, it's fine.

Still can't login.

MaestroEngineering commented 1 month ago

I figured it out.

Forget the app. It's completely different.

Go to www.lg.com, reset your password there, (I tried resetting on app it didn't work) and then log in with the new password.

I'm not sure if it'll stay logged in, I'll let you guys know if it doesn't.

wepster commented 1 month ago

Password reset didnt help in my case

rafaelarcanjo commented 1 month ago

The password reset was my first attempt and it didn't work.

MaestroEngineering commented 1 month ago

Password reset didnt help in my case

The password reset was my first attempt and it didn't work.

On the website specifically? i tried resetting through the app twice and that didn't work.

rafaelarcanjo commented 1 month ago

On the website specifically? i tried resetting through the app twice and that didn't work.

I performed the reset through the app and also through the website https://www.lg.com/br/my-lg/ without success.

MaestroEngineering commented 1 month ago

Had a power failure and we're back to it not working anymore

And the password reset doesn't work this time.

I did just notice that my date is wrong on my HASS setup, is yours maybe wrong too? You can paste this into template in Development: '"{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"'

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 669, in _auth_request raise exc.TokenError() custom_components.smartthinq_sensors.wideq.core_exceptions.TokenError: Token Error

drsmarsden commented 1 month ago

doing a little debugging (retired, but have some python knowledge) getting back status of 406 - not acceptable I will do some more digging

drsmarsden commented 1 month ago

Oops, before more debugging deleted integration and reinstalled Now works, reboot HA and it still works

mikekay1 commented 1 month ago

above worked for me

rafaelarcanjo commented 1 month ago

It only worked after updating to the latest version of HA. Thank you.

jterpstra1 commented 1 month ago

Still having this issue , anyone else? Have tried to delete integration and reinstall it, no success. Creating new account also doens't do anything.

Any ideas?

macavelly commented 1 month ago

So, I was able to resolve my issue. It was not an issue with the application but on my own end.

The problem was DNS. I have home assistant running in a docker container and the docker container was not able to resolve the url the plugin was trying to access.

I found this was the problem buy opening a terminal of the container and doing "ping google.com" and it could not resolve the google.com to an ip address. I added the -dns 8.8.8.8 argument when running the container and I was able to login and no issues finding my lg microwave.

So my recommendation to you would be to verify you don't have any dns issues.

Mehran50 commented 1 month ago

So, I was able to resolve my issue. It was not an issue with the application but on my own end.

The problem was DNS. I have home assistant running in a docker container and the docker container was not able to resolve the url the plugin was trying to access.

I found this was the problem buy opening a terminal of the container and doing "ping google.com" and it could not resolve the google.com to an ip address. I added the -dns 8.8.8.8 argument when running the container and I was able to login and no issues finding my lg microwave.

So my recommendation to you would be to verify you don't have any dns issues.

This worked also for me! Or it was the reboot of the Pc running the virtual box..

djcrawleravp commented 1 month ago

No success:

Deleted the integration, restarted, installed again, restarted.

Changed my password on the app and on the site

Tried with and without redirect

Screen Shot 2024-09-26 at 15 50 26 Screen Shot 2024-09-26 at 15 50 55

After putting my credentials on the site th pages refreshes and copying the link gives me teh same error

mikelly999 commented 4 days ago

modify /etc/resolv.conf inside the docker container.

  1. ssh into your HA server

  2. docker exec -it homeassistant /bin/bash

  3. replace contents of /etc/resolv.conf with nameserver 8.8.8.8