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

SmartThinQ LGE Sensors integration has stopped connecting to the server. #651

Closed
golds69 opened this issue Dec 23, 2023 · 52 comments
Closed

Comments

@golds69
Copy link

golds69 commented Dec 23, 2023

Describe the bug
The SmartThinQ LGE Sensors integration has stopped connecting to the server. There were no updates of HA or other components. Everything was working well, but suddenly stopped a few hours ago.

Expected behavior
N/A

Screenshots
N/A

Environment details:

  • Environment (HASSIO, Raspbian, etc): Debian GNU/Linux 12 (bookworm) VirtualEnv
  • Home Assistant version installed: 2023.12.3
  • Component version installed: 0.35.6
  • Last know working version: 0.35.6
  • LG device type and model with issue: All
  • LG devices connected (list): Washing Machine, Refrigerator

Output of HA logs

Logger: custom_components.smartthinq_sensors
Source: custom_components/smartthinq_sensors/init.py:252
Integration: SmartThinQ LGE Sensors (documentation, issues)
First occurred: 18:02:14 (1 occurrences)
Last logged: 18:02:14
Connection not available. ThinQ platform not ready

Traceback (most recent call last):
File "/home/homeassistant/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 "/home/homeassistant/config/custom_components/smartthinq_sensors/init.py", line 151, in create_client_from_token
return await ClientAsync.from_token(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/homeassistant/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1446, in from_token
await client.refresh()
File "/home/homeassistant/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1366, in refresh
await self._load_devices()
File "/home/homeassistant/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1283, in _load_devices
new_devices = await self._session.get_devices()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/homeassistant/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1065, in get_devices
self._common_lang_pack_url = dashboard.get("langPackCommonUri")
^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'


@ErikProductions
Copy link

I'm getting the same.

@LeonidPY
Copy link

Same here.

@ollo69
Copy link
Owner

ollo69 commented Dec 23, 2023

This is strange. I will add an additional check to this part of code to avoid this error, hoping that there are no other changes in API.

@vicar82
Copy link

vicar82 commented Dec 23, 2023

Same problem. Password change in LG ThinQ app doesn't help.
After integration delete not possible to login: Error connecting to SmartThinQ. Try again, and make sure you can access the ThinQ app on your phone.
But everything ok in LG ThinQ app

@ollo69
Copy link
Owner

ollo69 commented Dec 23, 2023

Uhm, wait, does not make sense. If dashboard is type str it doesn't contain all the info related to devices, this would be a problem. There are someone with this problem able to add a line a of log at line 1064 of core_asyng.py module to get the content of variable dashboard?

Just a line like this:

_LOGGER.info(dashboard)

@LeonidPY
Copy link

LeonidPY commented Dec 23, 2023

I can't login into account via HA.
If i just put mail and pass, getting this
image

If i try token - this
image

I've edited core_async.py like

1063         dashboard = await self.get2("service/application/dashboard")
1064         _LOGGER.info(dashboard)
1065         if self._common_lang_pack_url is None:

Here is the log

2023-12-24 01:19:33.439 ERROR (MainThread) [custom_components.smartthinq_sensors.config_flow] Error connecting to ThinQ
Traceback (most recent call last):
  File "/config/custom_components/smartthinq_sensors/config_flow.py", line 222, in _check_connection
    client = await lge_auth.create_client_from_token(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 1447, in from_token
    await client.refresh()
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1367, in refresh
    await self._load_devices()
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1284, in _load_devices
    new_devices = await self._session.get_devices()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1066, in get_devices
    self._common_lang_pack_url = dashboard.get("langPackCommonUri")
                                 ^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'

I've changer password, logged out /in in App, same trouble.

@LeonidPY
Copy link

Looks like LG fixed something on their side. Successfully logged in by login and password.

@ErikProductions
Copy link

IMG_0087
I still can't log in.

@golds69
Copy link
Author

golds69 commented Dec 24, 2023

This morning I woke up and was surprised to see that the devices were connected. But I was happy early. After some time, the devices disconnect again and the error repeated.

@ollo69
Copy link
Owner

ollo69 commented Dec 24, 2023

I think that there are some problem LG server side. Wait some days to see if they fix.
BTW at my side everything working properly till now.

@LeonidPY
Copy link

Rebooted HA, took error again. Before reboot all worked ok.

2023-12-24 20:34:30.406 WARNING (MainThread) [custom_components.smartthinq_sensors] 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 1447, in from_token
    await client.refresh()
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1367, in refresh
    await self._load_devices()
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1284, in _load_devices
    new_devices = await self._session.get_devices()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1066, in get_devices
    self._common_lang_pack_url = dashboard.get("langPackCommonUri")
                                 ^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'
2023-12-24 20:34:30.456 ERROR (MainThread) [homeassistant.components.homekit.type_thermostats] climate.dc07rh: Received invalid HVAC mode: unavailable

@diahellfire
Copy link

Did it work for anyone?
Same problem...

@ollo69
Copy link
Owner

ollo69 commented Dec 25, 2023

Please enable integration debug and provide debug log.

@LeonidPY
Copy link

Please enable integration debug and provide debug log.

home-assistant_smartthinq_sensors_2023-12-25T22-14-08.307Z.log

@ollo69
Copy link
Owner

ollo69 commented Dec 26, 2023

Looks like the endpoint https://ruic-service.lgthinq.com:46030/v1/service/application/dashboard is returning an empty string instead of a dict with device information. Also fixing this will not fix the problem because integration will not be able to discover registered device.
I do not understand if there are some changes at API level, but seems that this issue is limited to some region. If the app is still working could someone try to analyze the traffic using instruction provided here ?

@ErikProductions
Copy link

Looks like the endpoint https://ruic-service.lgthinq.com:46030/v1/service/application/dashboard is returning an empty string instead of a dict with device information. Also fixing this will not fix the problem because integration will not be able to discover registered device. I do not understand if there are some changes at API level, but seems that this issue is limited to some region. If the app is still working could someone try to analyze the traffic using instruction provided here ?

The app is not working for me.

@ollo69
Copy link
Owner

ollo69 commented Dec 27, 2023

The app is not working for me.

In this case I think that you could try to contact LG support and ask for clarification.

@vicar82
Copy link

vicar82 commented Dec 27, 2023

I don't know how, but integration is working!!!!
I was able to login through integrations. But yesterday it definitely didn’t work as I tried several times.
It seems to me that this is not related to integration and the problem was on LG's side.

@Druidblack
Copy link

There is a pattern in the failure of integration. According to the +3 time zone, the integration starts working at night and works during the day. The shutdown occurs in the evenings and into the night.

@Taronaga
Copy link

Taronaga commented Dec 27, 2023

Hello everyone, this problem also appeared after rebooting the system. The APP works without failures, notifications are received, devices are available.

2023-12-27 18:06:42.138 WARNING (MainThread) [custom_components.smartthinq_sensors] 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 1446, in from_token
    await client.refresh()
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1366, in refresh
    await self._load_devices()
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1283, in _load_devices
    new_devices = await self._session.get_devices()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1065, in get_devices
    self._common_lang_pack_url = dashboard.get("langPackCommonUri")
                                 ^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'

@wantsoftat
Copy link

I confirm, but it started recently

@freest555
Copy link

There is a pattern in the failure of integration. According to the +3 time zone, the integration starts working at night and works during the day. The shutdown occurs in the evenings and into the night.

Changing the region in the same situation helped me for this moment.

@ollo69
Copy link
Owner

ollo69 commented Jan 3, 2024

Today I took some logs from LG app. While in my country integration is still working, seems that application use some different web requests. I suppose that they changed something in the API and they are progressively disabling old API.
I need some times to implement new requests, hoping that this will not break functionality on other countries.

@ollo69
Copy link
Owner

ollo69 commented Jan 4, 2024

Please try using last release and let me know if it fix this issue.

@Andreweburg
Copy link

Andreweburg commented Jan 5, 2024

Please try using last release and let me know if it fix this issue.

Thnx. Logged in, but no devices found 🙈
IMG_1954

Logger: custom_components.smartthinq_sensors.wideq.core_async
Source: custom_components/smartthinq_sensors/wideq/core_async.py:1079
Integration: SmartThinQ LGE Sensors (documentation, issues)
First occurred: 06:23:38 (7 occurrences)
Last logged: 07:00:56

LG API return invalid homes information: ''

Logger: custom_components.smartthinq_sensors.wideq.core_async
Source: custom_components/smartthinq_sensors/wideq/core_async.py:1123
Integration: SmartThinQ LGE Sensors (documentation, issues)
First occurred: 06:23:38 (7 occurrences)
Last logged: 07:00:56

Not possible to determinate a valid home_id

@e2ret
Copy link

e2ret commented Jan 5, 2024

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.

@edwardtich1
Copy link

  1. I tried several accounts
  2. I have the latest version
  3. I tried changing the region and country

mobile app works well
It does not work for me

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.

@Stif007
Copy link

Stif007 commented Jan 5, 2024

after authorization:
"No SmartThinQ devices found. Component setup aborted"

@Drafteed
Copy link

Drafteed commented Jan 5, 2024

Got it after update (previous version was also broken with AttributeError):

2024-01-05 10:01:05.719 WARNING (MainThread) [custom_components.smartthinq_sensors.wideq.core_async] LG API return invalid homes information: ''
2024-01-05 10:01:05.719 WARNING (MainThread) [custom_components.smartthinq_sensors.wideq.core_async] Not possible to determinate a valid home_id

@oksibutch
Copy link

Please try using last release and let me know if it fix this issue.

Thnx. Logged in, but no devices found 🙈 IMG_1954

Logger: custom_components.smartthinq_sensors.wideq.core_async Source: custom_components/smartthinq_sensors/wideq/core_async.py:1079 Integration: SmartThinQ LGE Sensors (documentation, issues) First occurred: 06:23:38 (7 occurrences) Last logged: 07:00:56

LG API return invalid homes information: ''

Logger: custom_components.smartthinq_sensors.wideq.core_async Source: custom_components/smartthinq_sensors/wideq/core_async.py:1123 Integration: SmartThinQ LGE Sensors (documentation, issues) First occurred: 06:23:38 (7 occurrences) Last logged: 07:00:56

Not possible to determinate a valid home_id

im have this problem too
Region Russia

@DivanX10
Copy link

DivanX10 commented Jan 5, 2024

SmartThinQ LGE Sensors 0.36.0
Core 2024.1.0
Supervisor 2023.12.0
Operating System 11.3

Region Russia

When adding SmartThinQ integration, LGE Sensors received a message. There are devices in the LG ThinQ mobile app.

SmartThinQ LGE Sensors
No SmartThinQ devices found. Component setup aborted.

There is a message in the logs

Logger: custom_components.smartthinq_sensors.wideq.core_async
Source: custom_components/smartthinq_sensors/wideq/core_async.py:1123
Integration: SmartThinQ LGE Sensors ([documentation](https://github.com/ollo69/ha-smartthinq-sensors), [issues](https://github.com/ollo69/ha-smartthinq-sensors/issues))
First occurred: 12:37:47 (1 occurrences)
Last logged: 12:37:47

Not possible to determinate a valid home_id
This error occurred in the user integration.

Logger: custom_components.smartthinq_sensors.wideq.core_async
Source: custom_components/smartthinq_sensors/wideq/core_async.py:1079
Integration: SmartThinQ LGE Sensors (documentation, issues)
First occurred: 12:37:47 (1 occurrences)
Last logged: 12:37:47

LG API return invalid homes information: ''

@ErikProductions
Copy link

ErikProductions commented Jan 5, 2024

Hi there!

Smarthinq LGE Sensors v.0.36.0
Core 2023.12.4
Supervisor 2023.12.0
OS 11.2

Region: Spain

It' s still now working, neither the app nor the integration. I have reinstalled the app, accepted terms and updated password.

image

Update: I have set the location in the LG ThinQ App, an now the app works properly. The integration still doesn't, though.

@ollo69
Copy link
Owner

ollo69 commented Jan 5, 2024

@ALL,

I see here a lot of different issue reported all here, I think that this is just creating confusion.
The issue we are trying to address here is related to integration that was working past months and now do not work anymore, if this is not the case please open a new issue.

To find a solution for the specific case, that cause error like:

  • LG API return invalid homes information: ''
  • LG API return invalid devices information: ''

I tried to use different API with last release, but this seems that do not fix the problem.
Because I don't have this error my side, the only way to find a solution is to capture the traffic from LG app based on instruction provided in readme.

If someone with this issue can do this and share the captured traffic, I will analyze to find the proper call. If nobody can do this, the only alternative solution is that someone share the LG credential (via e-mail of course) and I will try to capture the traffic for you.

I do not see any other possible option.

@ollo69 ollo69 added the help wanted Extra attention is needed label Jan 5, 2024
@oksibutch
Copy link

what you email, im send you my account info

@ollo69
Copy link
Owner

ollo69 commented Jan 5, 2024

what you email, im send you my account info

Send to --- (deleted).
I need user, pwd, country and region (I suggest to temporary change pwd for test).
Not sure if app will require 2 phase authentication, it this case it could require to put the mobile number to have back authentication code.
For now just start with credential.

@ollo69
Copy link
Owner

ollo69 commented Jan 5, 2024

@oksibutch,

I successfully captured some traffic from LG app using your account. Now (today or tomorrow) I will make some tests with integration. Please do not change your pwd until I finish with my tests.

Thanks for your support👍

@oksibutch
Copy link

@ollo69 thx for you! you do a great job

@ollo69
Copy link
Owner

ollo69 commented Jan 5, 2024

Please try last release, problem should be fixed.

@ErikProductions
Copy link

Please try last release, problem should be fixed.
imagen
Same for me. I have even tried deleting and installing the integration.

@Andreweburg
Copy link

Please try last release, problem should be fixed.

Great thnx. It seems to me that it works with v0.36.1 🎉🎉
Wow.

@ollo69
Copy link
Owner

ollo69 commented Jan 5, 2024

@ErikProductions,

this is a different problem (seems you cannot connect to the LG server), please open a new issue.

@ollo69 ollo69 removed the help wanted Extra attention is needed label Jan 5, 2024
@ollo69
Copy link
Owner

ollo69 commented Jan 5, 2024

@oksibutch,

thanks again to for your support. Now you can change your LG account password if you like and if issue is solved also for you.

@edwardtich1
Copy link

it works with v0.36.1

@edwardtich1
Copy link

Many thanks to the author and helped everyone!

@ErikProductions
Copy link

Many thanks to the author and helped everyone!

Would you mind telling me what region you are on?
I can't get it to work. (Spain)

@Andreweburg
Copy link

Many thanks to the author and helped everyone!

Would you mind telling me what region you are on? I can't get it to work. (Spain)

Try new version v0.36.1 🤔

@ErikProductions
Copy link

Many thanks to the author and helped everyone!

Would you mind telling me what region you are on? I can't get it to work. (Spain)

Try new version v0.36.1 🤔

I have already tried it. :(

@edwardtich1
Copy link

Огромное спасибо автору и всем помог!

Не подскажете ли вы, в каком вы регионе? Я не могу заставить его работать. (Испания)

Попробуйте новую версию v0.36.1 🤔

Я уже пробовал. :(

click download again in HACS
reboot HA
everything should work

@wantsoftat
Copy link

Thank you, version v0.36.1 fixed everything

@ErikProductions
Copy link

My Pi-Hole was blocking LG Thinq xD. Now it's working, thanks @ollo69

@ollo69
Copy link
Owner

ollo69 commented Jan 5, 2024

I think that this issue now is solved, I close this.

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

No branches or pull requests