I’m running HA locally in a container while I get used to it and set things up, this means lots of restarting. The SmartThinq integration connected the first time I gave it the refresh token, but never again… until I ran example.py again this evening.
Same refresh token; I never changed it in my config, but now it’s connected. Just had to restart the server to re-connect.
Also something to note, it seems for at least their mirror AC collection, when you turn it off, the wifi also shuts down. Not a great user experience.
Here’s something else.
After some period of time, I’m seeing this in the logs:
Traceback (most recent call last):
File "/usr/src/app/homeassistant/core.py", line 1115, in _event_to_service_call
await service_handler.func(service_call)
File "/usr/src/app/homeassistant/components/climate/__init__.py", line 439, in async_on_off_service
await climate.async_turn_on()
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/climate/smartthinq.py", line 164, in turn_on
self._ac.set_on(True)
File "/wideq/wideq.py", line 874, in set_on
self._set_control('Operation', op_value)
File "/wideq/wideq.py", line 706, in _set_control
{key: value},
File "/wideq/wideq.py", line 357, in set_device_controls
'data': '',
File "/wideq/wideq.py", line 281, in post
return lgedm_post(url, data, self.auth.access_token, self.session_id)
File "/wideq/wideq.py", line 122, in lgedm_post
raise APIError(code, message)
wideq.APIError: ('0106', '장치가 접속중이 아닙니다.')
And the units no longer respond. To note, I have the LG Mirrior mini-splits.
Ok one more datapoint; we’ll get that track back when the unit (or all units) are off and non-responding. Once I turned the unit back on, I could control it again and the trace no longer occurred.
I own an LG washer/dryer that I currently control through SmartThinQ app.
For now I just want to be able to start and stop a given wash cycle and maybe have HA notify me when it ends.
I try to make this working for my refrigerator.
There is no platform for refrigerator, so i changed the smartthinq.py, but I can’t set up this platform.
Error during setup of component refrigerator
Traceback (most recent call last):
File "/usr/src/app/homeassistant/setup.py", line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/refrigerator.py", line 63, in setup
client = wideq.Client.from_token(refresh_token)
File "/config/wideq/wideq.py", line 598, in from_token
client.refresh()
File "/config/wideq/wideq.py", line 584, in refresh
self._auth = self.auth.refresh()
File "/config/wideq/wideq.py", line 306, in refresh
self.refresh_token)
File "/config/wideq/wideq.py", line 244, in refresh_auth
refresh_token)
TypeError: must be str, not NoneType
If i change the token to str type, it occures token error.
I also use ac components(smartthinq for climate), it works perfect. I don’t know what’s different.
Checked your fork @simlaf and by the replies here it looks really promising. Just bought a LG F4J7TY2W Washer/Dryer Combo that I will use to check your fork.
Will share my results here and will be happy to help anyone with the setup if I succeed.
Hi Guys, I’m also receiving the error when i paste in my redirect URL.
The korean error message translates to “session creation failed”
edit: when i switched my account to a US account the example.py script worked fine - i think the issue is linked using a different server for authentication? (i’m in Australia so it uses oauth2_backend_url=https://kr.lgeapi.com/)
Is there a way to fix this? i cant seem to register my product correctly on the US account
Traceback (most recent call last):
File "example.py", line 180, in <module>
example(sys.argv[1:])
File "example.py", line 166, in example
example_command(client, args)
File "example.py", line 146, in example_command
func(client, *args[1:])
File "example.py", line 34, in mon
device = client.get_device(device_id)
File "/srv/homeassistant/wideq/wideq.py", line 475, in get_device
for device in self.devices:
File "/srv/homeassistant/wideq/wideq.py", line 467, in devices
self._devices = self.session.get_devices()
File "/srv/homeassistant/wideq/wideq.py", line 458, in session
self._session, self._devices = self.auth.start_session()
File "/srv/homeassistant/wideq/wideq.py", line 256, in start_session
session_info = login(self.gateway.api_root, self.access_token)
File "/srv/homeassistant/wideq/wideq.py", line 179, in login
return lgedm_post(url, data)
File "/srv/homeassistant/wideq/wideq.py", line 124, in lgedm_post
raise APIError(code, message)
wideq.APIError: (9003, '세션생성실패')
more testing indicates that there is a bug for non-US users.
If i register my device against a US account I can get the refresh token however when I register it against my Australian account the session creation fails.
The challenge is that the device only works properly when registered against my Australia based account, when I register against the US, the smart thinq app cannot connect to the device
Is anyone else outside of US/Americas facing this issue?
@sharkpunch I edited COUNTRY and LANGUAGE in the first part of the wideq.py file to (I live, and have registered in Denmark; you can see in the app, I have English DK registered):
I can’t remember if this changed the link that came out to show country=DK (or AU for you, I guess) somewhere in the url. If not, then I changed this manually, and it worked.
Was able to pull device status for my LG F4J7TY2W washer/dryer @simlaf I’m based in Norway so had to set locales in wideq.py to “NO” and “no-NO” which got me a korean OAuth process - but it worked:
Hope this will be possible to install with Hassio soon. As far as I can understand, we need to have WideQ as a Pypi package? Outputs below from my home-assistant.log.
home-assistant.log
2018-10-29 23:02:59 INFO (SyncWorker_17) [homeassistant.util.package] Attempting install of wideq
2018-10-29 23:03:12 ERROR (SyncWorker_17) [homeassistant.util.package] Unable to install package wideq: Could not find a version that satisfies the requirement wideq (from versions: )
No matching distribution found for wideq
You are using pip version 18.0, however version 18.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
2018-10-29 23:03:12 ERROR (MainThread) [homeassistant.requirements] Not initializing climate.smartthinq because could not install requirement wideq
2018-10-29 23:03:12 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform climate.smartthinq: Could not install all requirements.
2018-10-29 23:03:12 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event config_entry_discovered[L]>
2018-10-29 23:03:12 INFO (MainThread) [homeassistant.loader] Loaded persistent_notification from homeassistant.components.persistent_notification
2018-10-29 23:03:12 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following components and platforms could$
Hey Guys.
I developed AC, REFREGERATOR, WASHER&DRYER, TUMBLE DRYER component.
I made it for KOREAN ONLY, so if you want to use, you may change some code for your country.
I don’t know how to link github with block, so I just link url