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

LGE Washer: Invalid Login info! #3

Closed katerry closed 4 years ago

katerry commented 4 years ago

I am receiving the following error in the log after I submit the access token:

Log Details (ERROR) Logger: custom_components.smartthinq_washer.config_flow Source: custom_components/smartthinq_washer/config_flow.py:67 First occurred: 10:23:30 PM (2 occurrences) Last logged: 10:25:06 PM

LGE Washer: Invalid Login info!

ollo69 commented 4 years ago

Are you sure that your token is correct? Did you put the right value for region and language associated to your account?

katerry commented 4 years ago

I am certain. Region US Language en-US. I am able to login just fine and once I submit the redirection URL I get a access token but one I submit it I get Invalid SmartThinQ credentials.

towerhand commented 4 years ago

I left the token empty on the first window when setting up the integration, then followed the directions on the next steps to get a new token and it worked for me.

ollo69 commented 4 years ago

This is strange and hard to investigate. Can you try, just for check, to save your generated token, than close the browser, re-open it and perform the configuration using the token previously saved?

katerry commented 4 years ago

I am not sure what the issue is. I followed your instructions but no change. I even reset the password and confirmed that when I sign into the APP they work. When I sing into the Smartthinq login URL I just get a blank screen. Is that normal?

ollo69 commented 4 years ago

Blank screen is normal, that login only redirect you to a page from where you can take a refresh token. It is possible that the hardware where Home Assistant run have some internet connection limit or that some firewall are enabled?

katerry commented 4 years ago

I use pIhole but I just disabled it and tested again with the same result.

katerry commented 4 years ago

I am sure that the credential work because when I use wideq I get the following output:

image

ollo69 commented 4 years ago

Can you retry with my last commit? I increased timeout, maybe I set it it too low. Should work because wideq call are the same you are using.

katerry commented 4 years ago

Just retried with the same result. Here is the build I am using: image

ollo69 commented 4 years ago

The PC from where you are launching the test is the same where you run HA? Can you attach here in a zip with the wideq version that you are using for test, just to be sure that there are no difference?

katerry commented 4 years ago

I run HA using a raspberry pi 3 under HASSIO. I am running wideq under Ubuntu on my pc. The wideq zip is from the following link:

https://github.com/sampsyo/wideq/archive/master.zip

ollo69 commented 4 years ago

Ah, ok HASSIO is the problem, it have some limitation and I think do not support request. You should check this post or maybe search other info on the web to see if it is possible to enable it. I revert timeout as original. Please report here if you discover some solutions.

kenmaples commented 4 years ago

I am also running into this issue on Home Assistant (used to be called HASSIO). Does this code base support the thinq API v2?

towerhand commented 4 years ago

I’m running the latest version of Home Assistant, installed hassio VM container on proxmox and this custom integration is working for me. Installed it via HACS with a new token.

ollo69 commented 4 years ago

Can I close this issue? I have no way for the moment to manage the component working on HASSIO.

katerry commented 4 years ago

Thanks for your effort. FYI I created an X86 Docker Home Assistant and added HACS and your custom component with the same result so this issue is not limited to HASSIO. Maybe LG is setting up new accounts different? I just setup my Washer and Dryer last month.

ollo69 commented 4 years ago

Thanks, for closing issue. In any case I will do some test with an HASSIO installation to better understand if is the issue is in the component or related to LG account. I will keep you informed.

ollo69 commented 4 years ago

Hi, I just finish to make a test now using HASSOS, I installed it from scratch, added HACS and then istalled the component. It works without any issue. The point is that, if you are able to connect with the test program, you should also be able to connect with the component because they use the sami API call. I reopen this issue, need to understand where is the problem.

katerry commented 4 years ago

I can email you my redirect URL If you would like.

ollo69 commented 4 years ago

This could help, but wait, before I want to do other tests. I will ask you if I will don't find anything.

Thx.

kenmaples commented 4 years ago

There has been a good deal of conversation around the new API on the thread from the original source of wideq - https://github.com/sampsyo/wideq/issues/46

ollo69 commented 4 years ago

Ok, i will analyze better this API v2, but I understand that katerry run test application with API v1 and is able to connect to the washer, am I right? Who is already succesfully using API v2?

ollo69 commented 4 years ago

I did some test, creating a new LG account with language en-US. It was failing, but because there are no device associated. My suspect is that some error is preventing process to end, but at this point I need to try with your token. If you can please e-mail me your redirect URL at "aolivero@gmail.com".

Thx.

katerry commented 4 years ago

I just emailed you my redirect.

daveonkels commented 4 years ago

I'm still in the same boat - fully auth'd but no devices being returned. Sending you my redirect as well @ollo69

AbsoluteMidnight commented 4 years ago

Hello! I have the same problem, i get "Invalid SmartThinQ credentials." following the UI. I tried editing configuration.yaml too, but after restarting Hassio warns me i have a new device in integrations page, but asks me to configure it and the link gets me to the same UI with the same error message.

ollo69 commented 4 years ago

Hi,

I have some news. Seems that in some case there is a problem with TLS version, so I set to V1.0. This is probably related to the version of python so behavior of test program ran on different server may change. In any case I executed tests with both tokens:

To install this version please select the version "master" because I still not released a official version.

Waiting for your feedback.

kenmaples commented 4 years ago

I know that my devices are on the newer API, but though I would still report in.

I just tested with master and still get the invalid login: Log Details (ERROR) Logger: custom_components.smartthinq_washer.config_flow Source: custom_components/smartthinq_washer/config_flow.py:84 First occurred: 11:05:31 AM (1 occurrences) Last logged: 11:05:31 AM

LGE Washer: Invalid Login info!

ollo69 commented 4 years ago

Can you make the test using the last version from "master" repository and not the last release. You should probably have an additional error in the log. Can you confirm that API v2 released here are working for you?

kenmaples commented 4 years ago

Perhaps I am doing something wrong, but I pulled master again and setup the integration again. Log reports the same.

I can confirm with https://github.com/gladhorn/wideq I am able to list my devices (washer & dryer).

ollo69 commented 4 years ago

You should see another error before... but don't care.

MattL0 commented 4 years ago

2AE24137-A956-4478-9169-9D6E2B905873 8C7253C9-BE86-4E8E-85A9-F3CD4C915797 I have managed to get the values from the v2 api to Homeseer like that (see the two last posts from me ) https://forums.homeseer.com/forum/lighting-primary-technology-plug-ins/lighting-primary-technology-discussion/lg-smartthinq-xboxmeister/1338868-plans-for-lg-washer-dryers

My nodered flow have been update since that,.... so I also get the remaining time in minutes . Please do not care about Jeedom mqtt ..forgot to remove it from there

AbsoluteMidnight commented 4 years ago

Hi again, i reply here to the questions you asked me in the commit (sorry if i posted there).

are you sure you are running last version (how you install it)?

I guess so, i installed it using HACS who warned me about a new version. Then i also modified the wideq.py with the fix.

what is your environment (Harsware, OS, version of HA...)

I'm using Hassio (0.107.7) on a Raspberry pi4, with: os_name | Linux os_version | 4.19.106-v8 python_version | 3.7.7

what info do you fill in the setuo screen?

Region: IT Language: it-IT Token: empty field

are you able to create the new token?

Yes, the UI opened the LG login page, i logged in and got redirected. With that URL the UI were able to fill the token field and after that i received the "Invalid SmartThinQ credentials." error.

If you need anything else, i'm here :) thank you!

ollo69 commented 4 years ago

Do you receave the error immediatly or it take some time? Can you zip and attach here your log file? If you don't care and you can send me (via e-mail) the redirect URL I can perform some additional test...

AbsoluteMidnight commented 4 years ago

Do you receave the error immediatly or it take some time?

I would say about 3 seconds, but my internet connection is not so fast, so maybe it can slow it down a bit.

Can you zip and attach here your log file?

I don't know if there is a bigger log file, in the one i can see in HA i just read:

"Logger: custom_components.smartthinq_washer.config_flow Source: custom_components/smartthinq_washer/config_flow.py:84 First occurred: 16:23:25 (2 occurrences) Last logged: 16:48:52

LGE Washer: Invalid Login info!"

Where is the file, so i can get it? (Sorry, i'm just starting with this stuff)

If you don't care and you can send me (via e-mail) the redirect URL I can perform some additional test...

Yes, of course. Do i find your e-mail address in your profile here on github?

Thanks again!

ollo69 commented 4 years ago

Write to aolivero@gmail.com. For the log file, in HA config directory you should have a file called homeassistant.log. If you find it,, you can send it attached to the e-mail.

ollo69 commented 4 years ago

I tested your token. It work properly, but do not retrieve any device, for this reason send you back the error. I have to correct the message in this case. Are you sure that you have devices registered with ThinQ app?

AbsoluteMidnight commented 4 years ago

Are you sure that you have devices registered with ThinQ app?

Yes, i added it at the beginning of February, i can see in my account on LG website. Maybe it doesn't use the same database?

AbsoluteMidnight commented 4 years ago

Are you sure that you have devices registered with ThinQ app?

photo_2020-04-01_18-58-26

ollo69 commented 4 years ago

I think that this is something related to the APIv2. Probably they are moving to new account, and old API provide back empty list. I Have to work on this....

AbsoluteMidnight commented 4 years ago

I think that this is something related to the APIv2. Probably they are moving to new account, and old API provide back empty list. I Have to work on this....

OK, solved! Don't know how it's possible. I logged out from the app and logged in again and the washer wasn't there, so i added it again and now the component finds it.

ollo69 commented 4 years ago

Interesting... maybe other with same issue can try same step. I will write this on redme and I will fix the code to not give error if no device are available.

tayanov commented 4 years ago

I have login incorrect too. Need use APIv2. With v2 i see washer. with v1 not.

ollo69 commented 4 years ago

Working on APIv2, it take some time. Stay tuned...

ollo69 commented 4 years ago

I have implemented API v2 based on available projects on the web, unforturtunatly it is not possible (at least at moment) read the device states. With my account I'm able to read the devices list, but state command is not implemented at all. I'm just able to see, with the device list json received during initial connection, a generic "deviceState". During initial setup you can select API to use, please make some tests and post here your feed-back and possible suggestion. In any case i'm not conviced that this APIv2 are really required. Also IFTT still use old login page (and so old API). First test is to not login using social media account, if you are using this kind of login.

P.S. the implemented code review will make simple add new devices management.

daveonkels commented 4 years ago

@ollo69 - I spoke too soon in my last comment on #2 . I recreated my account using a non-social media login and thought I was successful with your most recent v1 API but could never get a device returned. I just tested out your v2 API version and it worked which tells me there must be something different about the way new accounts are being created. Not sure if the age of the washer matters but the device I have was purchased < 6 months ago.

lgwasher
ollo69 commented 4 years ago

So now you have a device but you don't have the state for this, right? Hope that some additional info come to be able to get device status also with APIv2....

daveonkels commented 4 years ago

Correct - test ran the washer and can confirm that no status data is flowing through. If it's helpful I can get you my token and we can coordinate a time where I start a cycle on the machine.

kenmaples commented 4 years ago

Using api2, I am now able to pull the washer. My washer does not receive updates, and my dryer does not show up. Both as expected at this point.