In development: LG SmartThinQ component

Do you have some test files, like example.py that was included in sampso repository?

Hi is anyone having an issue since the last major HA update and this integration?

I can access and use with HA but both Google Assistant and The Thinq app both report that ‘it is being used by another user’ and they can no longer control my 2 AC units.

Hi everyone
I have similar issues accessing LG ACs via ThinQ App (it is being used by another user). Logging out and back in ThinQ app helps sometimes.
Sometimes the error is on all devices, sometimes only on a part of my 4 AC devices.

My Home Assistant Integration is only a about 2 weeks old - in the first days I didn’t have issues in accessing with another user account via ThinQ app.

Thanks!

What am I missing? Why can I not figure out what my login URL and redirect URL’s are when using the Lovelace configuration wizard?

I’ve been banging my head against the wall on this and assume I’ve missed a huge piece on either the repository wiki or here!

What’s the problem?

Just to add, this used to happen if I used HA to turn the AC on or off etc and it was temporary but now it is constant. And following your post I tried logging in/out but it is still stating ‘Another User is using this product. Please try later’

The problem is, I have no idea what values go into the redirect URL field. It asks me for a value and I don’t know what the value is or should be. I don’t see any documentation about how one can arrive to that answer.

When you login at the LG site, eventually you get redirected to a blank page. You need to copy and paste the URL of that page into the redirect URL field.

I am getting Error wideq.core.APIError: (‘0111’, ‘제품 응답 지연’) all the time after a day of use.
Should I install wideq to make this component work?
I tried (with pip), but it says there is no setup file.

Assuming you use ollo69’s smartthinq_sensors component, there is no need to install wideq as it is bundled with the component.

Thank you for a reply.
But I use sampsyo’s component. I constantly have troubles with it.
Do you recommend ollo69’s smartthinq_sensors component?

I have used both. Try ollo69’s.

I’m still lost. I’ve created accounts on sso.lg, developer site, and through the app. I have no clue which one this integration requires.

You need to use the app login.

Is there some magic to knowing what the app login URL is? The app, from what I see, does not share where I’m actually authenticating.

I’m clearly missing something as others have made this work, but I don’t see how they figured it out. The documentation mentions nothing about URL’s, redirects, or blank pages. It does say not to use facebook, google, etc.

I’ve figured it out. I’ll document the easy, but not obvious to me, process.

I am stuck as well. I get a wideq.core.TokenError. and don’t know how to fix it. Any ideas?

  • created an LG smarttinq user (without google login)
  • Installed the custom_component via hasc (Added sampsyo/hass-smartthinq repository)
  • pulled wideq qit in the custom_component directory and ran $ python3 example.py -c NL -l en-US
  • pasted returned url back and got wideq_state.json
  • got refresh_token from wideq_state.json and put it in configuration.yaml:
smartthinq:
    token: 3197fca03da4c0ab-redacted-0e29aedf7c200899f348d8c7
    region: NL
    language: en-US
  • after restart I get:

Error during setup of component smartthinq
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 193, in _async_setup_component
result = await asyncio.wait_for(task, SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 442, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/smartthinq/init.py”, line 69, in setup
client = wideq.Client.from_token(refresh_token, region, language)
File “/usr/local/lib/python3.7/site-packages/wideq/client.py”, line 210, in from_token
client.refresh()
File “/usr/local/lib/python3.7/site-packages/wideq/client.py”, line 192, in refresh
self._auth = self.auth.refresh()
File “/usr/local/lib/python3.7/site-packages/wideq/core.py”, line 371, in refresh
self.refresh_token)
File “/usr/local/lib/python3.7/site-packages/wideq/core.py”, line 299, in refresh_auth
raise TokenError()
wideq.core.TokenError

Tried the whole routine again same result. Am I getting the wrong token?
running Python3 example.py -c NL -l en-US again using the stored .json file results in a TokenError due to error 0102 NotLoggedInError.

Figured it out - LG does not seem to like mixing country and language

I need to control AC. That is why I use sampsyo’s component.
Finally I installed wideq with
pip3 install wideq

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting wideq
Downloading https://files.pythonhosted.org/packages/e8/ad/ed9d507097f628afec4097cc4d0ed2c8b4834274f5abe98aa470a1e767ec/wideq-1.4.0-py3-none-any.whl (65kB)
100% |████████████████████████████████| 71kB 1.1MB/s
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from wideq) (2.21.0)
Installing collected packages: wideq
Successfully installed wideq-1.4.0

But still I have the wideq.core.NotConnectedError: (‘0106’, ‘장치가 접속중이 아닙니다.’).

Copied example.py to /home/pi/.local/lib/python3.7/site-packages/wideq
Now I have wideq_state.json
Will see if it works in a day or two…