LG Smart ThinQ

yes, its the mqttServer property that has to be changed manually:

"mqttServer":"ssl://a3phael99lf879-ats.iot.eu-west-1.amazonaws.com:8883"

Hi all,

I used to have this working, but since yesterday that I upgraded my Raspberry Pi from Buster to Bullseye, I’m not able to get this working. I have installed again all packages needed on Python. But i get the followin error.

I will really appreciate if anyone could give me any tip to solve it.

Thanks

COUNTRY_CODE=ES LANGUAGE_CODE=es-ES poetry run python -m thinq_mqtt.py
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/pi/Desktop/thinq2-python-master/thinq_mqtt.py", line 75, in <module>
    devices = thinq.mqtt.thinq_client.get_devices()
  File "/usr/lib/python3.9/uplink/builder.py", line 101, in __call__
    return execution.start(
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 97, in start
    return self._io.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 122, in execute
    return self._io.execute(executable)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 122, in execute
    return self._io.execute(executable)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 122, in execute
    return self._io.execute(executable)
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 31, in execute
    return executable.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 36, in execute
    return execution.before_request(self._request)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 56, in before_request
    return self.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 105, in execute
    return execution.send(
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 73, in send
    return self._io.invoke(self._client.send, (request,), {}, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 116, in invoke
    return self._io.invoke(func, args, kwargs, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 116, in invoke
    return self._io.invoke(func, args, kwargs, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 116, in invoke
    return self._io.invoke(func, args, kwargs, callback)
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 21, in invoke
    return callback.on_success(response)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 96, in on_success
    return self._context.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 123, in execute
    return execution.after_response(self._request, self._response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 62, in after_response
    return self.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 65, in execute
    return execution.sleep(
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 76, in sleep
    return self._io.sleep(duration, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 119, in sleep
    return self._io.sleep(duration, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 119, in sleep
    return self._io.sleep(duration, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 119, in sleep
    return self._io.sleep(duration, callback)
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 25, in sleep
    return callback.on_success()
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 52, in on_success
    return self._context.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 36, in execute
    return execution.before_request(self._request)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 56, in before_request
    return self.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 105, in execute
    return execution.send(
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 73, in send
    return self._io.invoke(self._client.send, (request,), {}, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 116, in invoke
    return self._io.invoke(func, args, kwargs, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 116, in invoke
    return self._io.invoke(func, args, kwargs, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 116, in invoke
    return self._io.invoke(func, args, kwargs, callback)
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 21, in invoke
    return callback.on_success(response)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 96, in on_success
    return self._context.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 123, in execute
    return execution.after_response(self._request, self._response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 62, in after_response
    return self.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 221, in execute
    return execution.finish(self._response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 79, in finish
    return self._io.finish(response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 125, in finish
    return self._io.finish(response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 125, in finish
    return self._io.finish(response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 143, in finish
    return self._invoke(
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 133, in _invoke
    return self._io.invoke(func, args, kwargs, FinishingCallback(self._io))
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 19, in invoke
    return callback.on_failure(type(error), error, tb)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 108, in on_failure
    return self._io.fail(exc_type, exc_val, exc_tb)
  File "/usr/lib/python3.9/uplink/clients/io/interfaces.py", line 303, in fail
    compat.reraise(exc_type, exc_val, exc_tb)
  File "/usr/lib/python3.9/six.py", line 719, in reraise
    raise value
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 16, in invoke
    response = func(*arg, **kwargs)
  File "/usr/lib/python3.9/uplink/clients/requests_.py", line 53, in apply_callback
    return callback(response)
  File "/usr/lib/python3.9/uplink/hooks.py", line 20, in wrapper
    return hook(*args, **kwargs)
  File "/usr/lib/python3.9/uplink/returns.py", line 39, in __call__
    return self._strategy(*args, **kwargs)
  File "/usr/lib/python3.9/uplink/converters/interfaces.py", line 6, in __call__
    return self.convert(*args, **kwargs)
  File "/usr/lib/python3.9/uplink/converters/marshmallow_.py", line 59, in convert
    return self._extract_data(self._schema.load(json))
  File "/usr/lib/python3.9/marshmallow/schema.py", line 719, in load
    return self._do_load(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 856, in _do_load
    result = self._deserialize(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 661, in _deserialize
    value = self._call_and_store(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 493, in _call_and_store
    value = getter_func(data)
  File "/usr/lib/python3.9/marshmallow/schema.py", line 658, in <lambda>
    getter = lambda val: field_obj.deserialize(
  File "/usr/lib/python3.9/marshmallow/fields.py", line 365, in deserialize
    output = self._deserialize(value, attr, data, **kwargs)
  File "/usr/lib/python3.9/marshmallow/fields.py", line 651, in _deserialize
    return self._load(value, data, partial=partial)
  File "/usr/lib/python3.9/marshmallow/fields.py", line 634, in _load
    valid_data = self.schema.load(value, unknown=self.unknown, partial=partial)
  File "/usr/lib/python3.9/marshmallow_dataclass/__init__.py", line 639, in load
    all_loaded = super().load(data, many=many, **kwargs)
  File "/usr/lib/python3.9/marshmallow/schema.py", line 719, in load
    return self._do_load(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 844, in _do_load
    processed_data = self._invoke_load_processors(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 1090, in _invoke_load_processors
    data = self._invoke_processors(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 1220, in _invoke_processors
    data = processor(data, many=many, **kwargs)
  File "/home/pi/Desktop/thinq2-python-master/thinq2/model/thinq.py", line 85, in filter_items
    items = [i for i in data["item"] if i["platformType"] == "thinq2"]
TypeError: string indices must be integers

Hi all again,

I’ve tryed with a clean install from github. I’ve been asked to put the URL but then i get this error. Does anyone know how to solve it?

Thank you very much,

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/pi/Desktop/Thinq2/thinq2-python-master/example.py", line 58, in <module>
    devices = thinq.mqtt.thinq_client.get_devices()
  File "/usr/lib/python3.9/uplink/builder.py", line 101, in __call__
    return execution.start(
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 97, in start
    return self._io.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 122, in execute
    return self._io.execute(executable)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 122, in execute
    return self._io.execute(executable)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 122, in execute
    return self._io.execute(executable)
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 31, in execute
    return executable.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 36, in execute
    return execution.before_request(self._request)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 56, in before_request
    return self.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 105, in execute
    return execution.send(
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 73, in send
    return self._io.invoke(self._client.send, (request,), {}, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 116, in invoke
    return self._io.invoke(func, args, kwargs, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 116, in invoke
    return self._io.invoke(func, args, kwargs, callback)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 116, in invoke
    return self._io.invoke(func, args, kwargs, callback)
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 21, in invoke
    return callback.on_success(response)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 96, in on_success
    return self._context.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 123, in execute
    return execution.after_response(self._request, self._response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 62, in after_response
    return self.execute()
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 93, in execute
    return self.state.execute(self)
  File "/usr/lib/python3.9/uplink/clients/io/state.py", line 221, in execute
    return execution.finish(self._response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 79, in finish
    return self._io.finish(response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 125, in finish
    return self._io.finish(response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 125, in finish
    return self._io.finish(response)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 143, in finish
    return self._invoke(
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 133, in _invoke
    return self._io.invoke(func, args, kwargs, FinishingCallback(self._io))
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 19, in invoke
    return callback.on_failure(type(error), error, tb)
  File "/usr/lib/python3.9/uplink/clients/io/execution.py", line 108, in on_failure
    return self._io.fail(exc_type, exc_val, exc_tb)
  File "/usr/lib/python3.9/uplink/clients/io/interfaces.py", line 303, in fail
    compat.reraise(exc_type, exc_val, exc_tb)
  File "/usr/lib/python3.9/six.py", line 719, in reraise
    raise value
  File "/usr/lib/python3.9/uplink/clients/io/blocking_strategy.py", line 16, in invoke
    response = func(*arg, **kwargs)
  File "/usr/lib/python3.9/uplink/clients/requests_.py", line 53, in apply_callback
    return callback(response)
  File "/usr/lib/python3.9/uplink/hooks.py", line 20, in wrapper
    return hook(*args, **kwargs)
  File "/usr/lib/python3.9/uplink/returns.py", line 39, in __call__
    return self._strategy(*args, **kwargs)
  File "/usr/lib/python3.9/uplink/converters/interfaces.py", line 6, in __call__
    return self.convert(*args, **kwargs)
  File "/usr/lib/python3.9/uplink/converters/marshmallow_.py", line 59, in convert
    return self._extract_data(self._schema.load(json))
  File "/usr/lib/python3.9/marshmallow/schema.py", line 719, in load
    return self._do_load(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 856, in _do_load
    result = self._deserialize(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 661, in _deserialize
    value = self._call_and_store(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 493, in _call_and_store
    value = getter_func(data)
  File "/usr/lib/python3.9/marshmallow/schema.py", line 658, in <lambda>
    getter = lambda val: field_obj.deserialize(
  File "/usr/lib/python3.9/marshmallow/fields.py", line 365, in deserialize
    output = self._deserialize(value, attr, data, **kwargs)
  File "/usr/lib/python3.9/marshmallow/fields.py", line 651, in _deserialize
    return self._load(value, data, partial=partial)
  File "/usr/lib/python3.9/marshmallow/fields.py", line 634, in _load
    valid_data = self.schema.load(value, unknown=self.unknown, partial=partial)
  File "/usr/lib/python3.9/marshmallow_dataclass/__init__.py", line 639, in load
    all_loaded = super().load(data, many=many, **kwargs)
  File "/usr/lib/python3.9/marshmallow/schema.py", line 719, in load
    return self._do_load(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 856, in _do_load
    result = self._deserialize(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 661, in _deserialize
    value = self._call_and_store(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 493, in _call_and_store
    value = getter_func(data)
  File "/usr/lib/python3.9/marshmallow/schema.py", line 658, in <lambda>
    getter = lambda val: field_obj.deserialize(
  File "/usr/lib/python3.9/marshmallow/fields.py", line 365, in deserialize
    output = self._deserialize(value, attr, data, **kwargs)
  File "/usr/lib/python3.9/marshmallow/fields.py", line 768, in _deserialize
    result.append(self.inner.deserialize(each, **kwargs))
  File "/usr/lib/python3.9/marshmallow/fields.py", line 365, in deserialize
    output = self._deserialize(value, attr, data, **kwargs)
  File "/usr/lib/python3.9/marshmallow/fields.py", line 651, in _deserialize
    return self._load(value, data, partial=partial)
  File "/usr/lib/python3.9/marshmallow/fields.py", line 634, in _load
    valid_data = self.schema.load(value, unknown=self.unknown, partial=partial)
  File "/usr/lib/python3.9/marshmallow_dataclass/__init__.py", line 639, in load
    all_loaded = super().load(data, many=many, **kwargs)
  File "/usr/lib/python3.9/marshmallow/schema.py", line 719, in load
    return self._do_load(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 892, in _do_load
    result = self._invoke_load_processors(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 1090, in _invoke_load_processors
    data = self._invoke_processors(
  File "/usr/lib/python3.9/marshmallow/schema.py", line 1218, in _invoke_processors
    data = processor(data, original_data, many=many, **kwargs)
  File "/home/pi/Desktop/Thinq2/thinq2-python-master/thinq2/model/thinq.py", line 72, in polymorphism
    device_schema = device_types.get(item.device_type, Device).Schema()
AttributeError: 'dict' object has no attribute 'device_type'

Hi, Is there a way to observe what is happening? I have managed to get it somhow working with my AC and get some data in MQTT but would like to try observing what happening in the logs as sometimes the reaction time is quite long and some values like temperature do not change as they should.

i was using Flip’s thinq2-python script for almost a year now and it was working good until yesterday…Now i get no mqtt info anymore.I think something is changed by LG.I see that my Thinq android app changed-updated recently…Anyone has the same problem?

running

poetry run python3 thinq_mqtt.py

i get my devices alright

UserID: xxxxxxxxxx@gmail.com
User #: US200919xxxxxxx

Devices:

2b79afbe-a61a-1d7a-b3be-402fxxxxxxxxx: Dryer (model RC90V9_WW)
b67ac1fd-9ec5-190e-91f9-402fxxxxxxxxx: Washer (model F_V__Y___W.A__QEUK)

Listening for device events. Use Ctrl-C/SIGINT to quit.

but no mqtt updates whatsoever

I just checked and my washdryer still works - I’ve got the updated iOS-App from LG too…

Dec 18 10:20:44 openhab bash[861]: rinse : NO_RINSE
Dec 18 10:20:44 openhab bash[861]: soilWash : NO_SOILWASH
Dec 18 10:20:44 openhab bash[861]: spin : NO_SPIN
Dec 18 10:20:44 openhab bash[861]: standby : STANDBY_OFF
Dec 18 10:20:44 openhab bash[861]: state : INITIAL
Dec 18 10:20:44 openhab bash[861]: steam : STEAM_OFF
Dec 18 10:20:44 openhab bash[861]: temp : NO_TEMP
Dec 18 10:20:44 openhab bash[861]: turboShot : TURBOSHOT_OFF
Dec 18 10:20:44 openhab bash[861]: deviceId : d10c76a0-1615-1692-a016-60ab14703937
Dec 18 10:20:44 openhab bash[861]: type : monitoring

Can you please try again, just to be sure it wasn’t a problem on LG’s side?

@mgw hi mate ,great job with Thinq ,i have a washer and a dryer.I have a problem with “remainingtime” of the dryer.It shows the minutes right but it cuts the hours.For example if remainingTime is 2 hours and 55 min so 10.500 seconds it shows only 3.300 which is 55 min.See below a screen shot

my washer’s remainingTime is accurate like the LGThinq app.I am from Greece connected at a european server and eng lanquage .Any ideas how to fix that?

There’s an outstanding Pull Request which fixes this.

I manually applied the fix to my local copy (after pulling it from github)

1 Like

nice to here that!Can u tell me how can i apply it to my local copy?Or is it better to wait for it to be merged into the main code?

That Pull Request has been awaiting merging for 3 months now… :frowning:

To apply it yourself, look at the list of changes, and make the same change to your local files. This is just basic text file editing.

1 Like

mate i am far from being a coder and using github…just a copy/paster here :slight_smile: so if there is an easy way to guide me or i will wait for the fix…

I have merged the provided PR

1 Like

Just installed Thinq-MQTT-Proxy and its working well - thanks very much @mgw
I got around the install process failing with a JAVA_HOME error by prefixing java with the full path to java 8

/usr/lib/jvm/zulu-8-amd64/jre/bin/java

on my debian PC based system. I also needed to add this to the thinq-mqtt-proxy.service file located in /etc/systemd/system

Actually, I’ve already developed an AddOn for LG Smart Thinq (only works for Air Conditioners for now) for the both version 1 and 2 of LG API. I started the review process trying to contribute with this amazing OpenHab project. Let’s see if in the next months it’s already officially available.

4 Likes

Hmm, cannot see your pull request. Could you share the link/PR number.

Hi, @hmerk. I’m still finalizing the README and some more unit tests, just to be consistent with the guide. So, I think still today or tomorrow I will open the PR and share here with you guys.

3 Likes

Hi, Any news about this? Have you done an Openhab Add-on (Binding?) This would be amazing

Please follow this topic, binding is running here :wink:

1 Like

Awsome job @mgw on the script for reading data into MQTT. I keep using my old IR blaster to control my LG A/C unit. It is so unfortunate that still to this day we don’t have a way to control it with Openhab using Wi-Fi. Do you know if there is any ongoing development for this?

Best regards,
Luciano

Please use @nemer implementation as he is actively maintaining the plugin. The link is two posts above.