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

No devices are shown/listed #117

Open
jbmorgado opened this issue Aug 4, 2020 · 12 comments
Open

No devices are shown/listed #117

jbmorgado opened this issue Aug 4, 2020 · 12 comments

Comments

@jbmorgado
Copy link

jbmorgado commented Aug 4, 2020

I tried a new setup.

  • Deleted the old account using Google for authentication (first I removed all devices).
  • Created a new account using email/pass
  • Got the authentication token
  • I tried with only one device added in my LG account, and then with 3 (they are all AC units).

Still, I can't get any device listed:

bash-5.0# python3 example.py -c PT -l en-US ls -v
2020-08-04 19:01:37 DEBUG [wideq.example] State file found '/root/temp/wideq/wideq_state.json'
2020-08-04 19:01:37 DEBUG [wideq.example] State file found '/root/temp/wideq/wideq_state.json'
2020-08-04 19:01:38 DEBUG [wideq.example] Wrote state file '/root/temp/wideq/wideq_state.json'
2020-08-04 19:01:38 DEBUG [wideq.example] Wrote state file '/root/temp/wideq/wideq_state.json'
@barbetb
Copy link

barbetb commented Aug 9, 2020

I have exactly the same problem. Authentication worked with regular Lg account. No devices are shown.

Also when I use the headers and tokens in postman, I get bad request returned. Has the api changed?

@lvlie
Copy link

lvlie commented Aug 11, 2020

I think you are probably running into the issue that this is trying to fix:
#100

Basically: newer units and/or newer accounts can only use v2 of the API, that wideq doesnt support yet. Edit: see also #108

@JasperE84
Copy link

Having the same problem while trying to setup my newly installed LG AC on a new LG account.

@jacekpaszkowski
Copy link

Same here :( Hope there will be a working version soon

@lvlie
Copy link

lvlie commented Aug 17, 2020

I did get wideq to show my devices with branch api2_merged from this fork: https://github.com/gladhorn/wideq.git
However, I cannot get the custom integration to pick this up. I have both git repo's checked out to my custom_components dir, but the wideq one is probably in the wrong location?

@jacekpaszkowski
Copy link

@lvlie yes, i confirm that wideq version from that repo lists my devices. I'll try to use it in HA

@JasperE84
Copy link

JasperE84 commented Aug 17, 2020

@lvlie yes, i confirm that wideq version from that repo lists my devices. I'll try to use it in HA

That doesn't seem to work, I tried forcing the wideq from gladhorn, resulted in:

Traceback (most recent call last):
  File "/home/ha/homeassistant/lib/python3.7/site-packages/homeassistant/setup.py", line 191, in _async_setup_component
    result = await task
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/username/.homeassistant/custom_components/smartthinq/__init__.py", line 79, in setup
    client = wideq.Client.from_token(refresh_token, region, language)
  File "/home/username/.homeassistant/custom_components/wideq_fork/wideq/client.py", line 215, in from_token
    client._auth = core.Auth(client.gateway, None, refresh_token)

core.Auth def in gladhorns repo:

class Auth(object):
    def __init__(self, gateway, oauth_url, access_token, refresh_token):

Looks like its missing a parameter, just adding another 'None' in there doesn't work.

Edit:
Replacing the client = wideq.Client.from_token(refresh_token, region, language) line with a wideq.Client.load(state), hardcoding the wideq_state.json contents in the state var, also doesn't fix it, throws a NotLoggedIn exception. Solving that with a forced client.refresh() shows the next missing implementation (edm_post) and so on. Gladhorn's fork doesn't seem finished for home assistant integration.

@jacekpaszkowski
Copy link

@JasperE84 thank you for your test. It seems that The code od not ready for HA. But at least it is possible to interact with V2 API.
Could you tell me how you managed to override wideq in HA. I have my HA on RPi.

@JasperE84
Copy link

Check

@JasperE84 thank you for your test. It seems that The code od not ready for HA. But at least it is possible to interact with V2 API.
Could you tell me how you managed to override wideq in HA. I have my HA on RPi.

Check out https://askubuntu.com/a/471168/568023

@barbetb
Copy link

barbetb commented Aug 17, 2020

So with the gladhorn fork I can list my AC, but not give any instructions to the AC.

@JasperE84
Copy link

JasperE84 commented Aug 17, 2020

On the cmdline yes, only listing will work. In home assistent nothing will work. The Thinq custom component will crash upon loading in hass. (After sensor/components are found and registered I think it tried setting up sensor data monitoring which failed because of a missing edmpost method.)
Fingers crossed @sampsyo, maybe with help from @ollo69, will get the lg API v2 to work and implemented.

@brunomgsousa
Copy link

Hi, I have an old account with 2 old Mural AC's and all works good, but today a installed a new AC at my home and i added this new device on my account. The new AC is not listed in the wideq only the old's 2 AC's. Is possible that in the same account 2 devices use the v1API and the new use v2 API ? Tks in advance.

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

6 participants