LG Smartthinq Air Conditioning

Hi,
At this moment, I’m so busy with my work ( business or some thing like that ) So, if you could, please wait few days for my reply with image or video ( I will try my best )
Thanks.

Dear Vunguyen 7819.

Many thanks for answering my question and your willingness to pick up this question later.
As soon as you have some spare time, could you please send me a message?
I will try to give a complete overview of the steps I have performed.

Kind regards,

Robin

I’ve had delays getting my unit installed, but it looks like it should be done next week… I will then take a deep dive into this and provide assistance where I can.

Looking forward to get my units also added to HA :slight_smile: Somewhere I do not seem to be able to get the Wideq custom component working properly… I can not get it installed using HACS and have to copy the folder manually into my NAS. Furthermore I lack the knowledge of running Python in HASSIO. I can get the wideq refresh token by running it on my pc, but I am afraid this is insufficient…

@Robin_De_Becker I saw you using Hassio, so maybe that post can not help you because I dont know how to connect ssh with Hassio. So If you dont mind, you can read the post below just for your information in the future.
1st step:

  •   Read carefully all step at this link https://github.com/sampsyo/hass-smartthinq
    
  • Repair wideq folder in your custom_components folder

  • PuTTy or CMD for running command.

  • WinSCP for copy, paste, open folder.


    2nd Step: located to your wideq folder on HA

  • Cd /home/homeassistant/.homeassistant/custom_components/wideq ( The blue one is my address, please use your )

  • Running example.py: sudo python3 example.py -c US -l en-US after that, you will get the link in the image below. Copy that link, open by your browser.

image

  • After logging by your LG thinq account, you will get the link like this one. Copy that link and paste to your PuTTy or CMD
    image
    After paste the URL, CMD will show all your device in LG account. If you got error, please check my previous post.
    image
    Back to WinSCP, refresh
    image
    If everything right you will get the file name: wideq_state.json Open that file and follow next step on sampsyo link.
    Good luck.

@vunguyen7819,

I have followed all the steps a described by both you and Samsyo and was able to generate the json file. Also the device information showed up. However the sensor.lg does not show up in my entity list. Do I have to install an additional integration?

Could you please confirm that the information in my configuration.yalm file is correct?

smartthinq:
token: 39d426d7bf824d60ef3fb9bb1e886b459534021cb763cf71ec0bf3a74a912ee970f8ec9b9b
region: BE
language: en-BE

Many thanks for all the support.

Kind regards,

Robin

I will assume that you had install smartthinq ( first step of sampsyo )
Open file home-assistant.log for checking the error. Maybe some error will show in that file, some AC model in different country have different function so they will not work with sampsyo code, you need to remove some line of his code for your AC can work.
image

Dear vunguyen7819,

Many thanks for the support. I have verified the home-assistant.log, but could only find the warning below:

2020-11-19 23:47:51 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for smartthinq which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

Apparently there are two versions of wideq that can be used.
Could you please inform me which version you are using?

Many thanks.

Kind regards,

Robin

Did you try this Entity?


If you tried this and nothing happen, so sorry, I can’t help you next. Maybe other user can help you.

FYI: I’m using wideq version of sampsyo.

Dear vunguyen7819,

Many thanks for all your support.
I have gone over the entire process again.
Now I have received a more detailed error message:

Logger: homeassistant.setup
Source: custom_components/smartthinq/init.py:69
First occurred: 1:41:46 PM (1 occurrences)
Last logged: 1:41:46 PM

Error during setup of component smartthinq
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 213, in _async_setup_component
result = await task
File “/usr/local/lib/python3.8/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.8/site-packages/wideq/client.py”, line 210, in from_token
client.refresh()
File “/usr/local/lib/python3.8/site-packages/wideq/client.py”, line 192, in refresh
self._auth = self.auth.refresh()
File “/usr/local/lib/python3.8/site-packages/wideq/core.py”, line 370, in refresh
new_access_token = refresh_auth(self.gateway.oauth_root,
File “/usr/local/lib/python3.8/site-packages/wideq/core.py”, line 299, in refresh_auth
raise TokenError()
wideq.core.TokenError

I assume this has to do with the lines of code you had to erase.
Could you please inform me in which file which lines of code had to be erased?

Many thanks.

Kind regards,

Robin

You have error with token.
“wideq.core.TokenError”
I have no idea why this happen when I’m using my old LG account ( country = VN ) so I remove all my device and move them to another brand new US LG account. Remove the old json file, do all step again with my new US account and i dont see token error again.
About the edit file. I don’t remember where I had edit, but I just follow the error, the file will show you where the error is.
Check this post if you got some error like me.

Dear vunguyen7819,

I have created a new US LG account and added the AC to this account.
Afterwards I have created a new json file and uploaded it into the custom-components folder.
In my configuration.yalm file the country, language and token have been updated.
When restarting HA I get no error message, but the AC is still not in the entity list.
I really have no clue anymore what is wrong, since I have been doing the exact same steps as previously, but no error message appears at all.

Might it be usefull to try it with the wideq of Gladhorn?

Many thanks for your support.

Kind regards,

Robin

So sorry, I have no idea with this situation. I had tried wideq of gladhorn but never using their json file. Maybe I will try in the future when somethings happen.
Just double check, did your smartthinq folder and wideq folder same location like me?
image
image

FYI, here is one of my edit file. Please dont edit those lines if you dont get the error like this:
File “/home/homeassistant/.homeassistant/custom_components/smartthinq/climate.py”, line 245…
( sorry I dont remember exactly )

Dear vunguyen7819,

Many thanks for all your support.
I am afraid this is a APIv2 issue.
The only thing left for me is to try it with the WideQ of Gladhorn.
If this does not solve it, then I can only wait for an update.

Kind regards,

Robin

Hello,
just wanted to share my experience with WideQ as well as get some help.
I’ve cloned: git clone https://github.com/gladhorn/wideq.git
When i run the example command I get the whole list of my LG devices

d27XX3f0-7XXX-11X3-8XXf-0XX1XXX89XXf: Bedroom (AC RAC_056905_CY)
d27XXX30-7XX9-1XX3-8XX3-20XXXXbacb10: MP Room (AC RAC_056905_WW)
d27XXXX0XXX9-XXX3-XXXc-74XXXXXX7d7d: CK Office (AC RAC_056905_WW)
1XXXXXXba-XXX9-1XXX-9XXX-6XXXX4fXXXXd: Refrigerator (REFRIGERATOR 2REF11EII_P_2)
8XXXX28-b3eb-XXXX-XXXX-44XXXXXXXXX6: Living Room (AC RAC_056905_WW)
dXXXXX94-dXXX-17ee-XXXX-4XXXXb94bXXX: HeatPump (AC AWHP_019101_WW)
9XXXX085-aXX-1XXX-bXXX-44XXXX1d5XXX: Kitchen (AC RAC_056905_WW)

so far so good. when I install the sampsyo/hass-smartthinq in order to get my Devices on HA, I am only able to get: MP Room , CK Office, and Bedroom.

Rest of the devices I am unable to get on my entity.

For the Refrigerator to make it work, I need to install SmartThinQ LGE Sensors from ollo69

Living Room, HeatPump, and Kitchen are not able to be added at all.

Any suggestion?

Thanks

Dear CK, might it be possible that the AC that are not recognised are the most recent ones?
There are 2 versions of the API of Smartthinq, and the newer devices use the second version. WideQ is not yet fully compatible with the second version of the API (same issue as mine right above your issue).
If this is the case, I am afraid the only solution for our issue is to have some patience until one of the following updates implements the second version of the API.

Kind regards,

Robin

@XalaTheShepard
thanks a lot for the reply.
there is a possibility not sure, to be honest, but I am guessing so.

my question is when I use the wideq from gladhorn I get the full list as shown above but not able to use them on my HA using sampsyo integration.

thanks

Dear CK,

The WideQ component only creates the token for linking the Smartthinq custom component to your LG account.
The issue with the second version of the API is related to the Smartthinq custom component that is not yet fully compatible with the second version of the API (same situation as my issue above).
I also see my two AC in the WideQ component, but because they only work with the second version of the API, I am unable to add my AC to the Smartthinq custom component (which currently only works with the first version of the API).
Only solution for this issue is waiting for an update of the Smartthinq custom component to be compatible with the second version of the API.

Kind regards,

Robin

Robin,

thanks a lot. seems that’s the only solution for now.

Thanks once again.