Contribution - LG ThinQ Binding

If you have a valid LG Account, you can configure the LG Thinq Bridge of this binding and it will discovery your devices related to your account. Thus, you can add it as a new Thing and in the end, the device will go in ERROR, but is expected since the device is not supported by the binding, but will produce a *-cap.json file in your OH_USER/thinq directory and you can post here to me to start to develop the implementation.

Hi Nemer, did you had a chance to see my request my of July 19th? Please let me know if ther is any way I can help you? Thank you. Best regards

Sorry @Nirtsep. I missed it. I gonna try to work on it today.

I think this is the file you need
thinq-31bb1bf0-b1e7-17bb-9338-acf1088fa92e-cap.json (67.1 KB)

It seems that it is recognized as AC and it got basic items…

Hello Nemer, I wanted to ask nicely if you still find time to integrated it? Or have you already integrated it?

Just to mention that it works on my side, configured with “fr”, “fr-FR”. My washing machine discovered and values flow to channels but…I’ve got the following error :

2022-09-20 18:16:55.631 [ERROR] [nternal.handler.LGThinQWasherHandler] - Error updating channels dynamic options descriptions based on capabilities of the device. Fallback to default values.
org.openhab.binding.lgthinq.internal.errors.LGThinqApiException: Error reading IO interface
        at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiClientService.getCapability(LGThinQAbstractApiClientService.java:253) ~[bundleFile:?]
        at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.getCapabilities(LGThinQAbstractDeviceHandler.java:186) ~[bundleFile:?]
        at org.openhab.binding.lgthinq.internal.handler.LGThinQWasherHandler.updateChannelDynStateDescription(LGThinQWasherHandler.java:99) ~[bundleFile:?]
        at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.initializeThing(LGThinQAbstractDeviceHandler.java:201) [bundleFile:?]
        at org.openhab.binding.lgthinq.internal.handler.LGThinQWasherHandler.initialize(LGThinQWasherHandler.java:94) [bundleFile:?]
        at jdk.internal.reflect.GeneratedMethodAccessor85.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
        at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 start byte 0xb0
 at [Source: (File); line: 293, column: 33]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2337) ~[bundleFile:2.12.6]
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:710) ~[bundleFile:2.12.6]
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidInitial(UTF8StreamJsonParser.java:3607) ~[bundleFile:2.12.6]
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidChar(UTF8StreamJsonParser.java:3603) ~[bundleFile:2.12.6]
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishString2(UTF8StreamJsonParser.java:2545) ~[bundleFile:2.12.6]
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishAndReturnString(UTF8StreamJsonParser.java:2471) ~[bundleFile:2.12.6]
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.getText(UTF8StreamJsonParser.java:302) ~[bundleFile:2.12.6]
        at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.deserialize(UntypedObjectDeserializer.java:741) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.mapObject(UntypedObjectDeserializer.java:942) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.deserialize(UntypedObjectDeserializer.java:718) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.mapObject(UntypedObjectDeserializer.java:973) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.deserialize(UntypedObjectDeserializer.java:718) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.deserialize(UntypedObjectDeserializer.java:701) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:609) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:437) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:32) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4593) ~[bundleFile:2.12.6.1]
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3433) ~[bundleFile:2.12.6.1]
        at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiClientService.getCapability(LGThinQAbstractApiClientService.java:249) ~[bundleFile:?]
        ... 13 more

here is my json device file CAP FILE

Hi, I’ve tryed the binding, the bridge is online, but after discovering and adding the WM i get in the log:
LG API report error processing the request -> resultCode=[0009], message=[Device/Group mismatch or device/model doesn't exist in your account.]
This is the -cap.json file:
thinq-b8985c50-1330-11eb-977d-203dbd436435-cap.json (94.6 KB)

Have you ever changed the account definitions in the Bridge after discovery the device ? This is likely you are trying to access definitions/data from a other’s account device. I suggest to you to remove all the things and bridge related to this binding, remove the <OH_USER_DATA>/thinq directory as well and:

  1. Add the thinq bridge based on the account that your device is presented
  2. Check the discovery tab to find out your device

Another point is that LG decides to cleanup account’s duplicity. It was common when you registry a google e-mail (for example) with a regular LG password account and after, you registry again based on Google’s OAuth authentication. Even having the same e-mail, for LG these was 2 different account.
LG sent email for the customers matching this scenario clamming to decide the official account and delete the other. Check if it’s your case as well.

No, I havent changed anything after the bridge was online.
Before the bridge went online I’ve changed several times countty and language.

I removed the WM and bridge things and the <OH_USER_DATA>/thinq directory, added the bridge, but that time it didnt went online, i saw in the log:

Thing ‘lgthinq:bridge:thinq’ changed from UNKNOWN to OFFLINE (CONFIGURATION_ERROR): Error Handling Token Configuration File.

Then I removed the bridge again and created manually <OH_USER_DATA>/thinq empty directory and used the fix permissions from openhabian menu, this time when I create the bridge thing, it went online and disovered the WM, it went online, offline, but again

LG API report error processing the request → resultCode=[0009], message=[Device/Group mismatch or device/model doesn’t exist in your account.]

I removed the WM and bridge things againd, added the bridge and added the discovered WM, but this time with the autogenerated ID, now it went online, just when the WM turns off i get

The thing LAVATRICE/b8985c50-1330-11eb-977d-203dbd436435 reach maximum retries for monitor data. Thing goes OFFLINE until next retry.
Thing ‘lgthinq:201:thinq:b8985c50-1330-11eb-977d-203dbd436435’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Exhausted trying to get monitor data for the device:b8985c50-1330-11eb-977d-203dbd436435

Maybe this is the expected behavior.

I dont understand relationship between thing ID and the API error, but now when I turn ON the WM it comes online again.

Thank you.

@nemer, I’m finally getting around to looking at this. If you haven’t already done so, would you be able to add Canada (CA) to the country list? I have the 3.3 snapshot from June, and I’m unclear if there’s a newer version (or where to find it). This thread has gotten quite long and hard to search through. :wink:

Thanks!

Hello @nemer
Did you manage to check this Contribution - LG ThinQ Binding - #312 by Kostas_Injeyan ?

Thanks in advance

There’s no need to add new Countries. I introduced, some versions ago, a new feature to include yourself the country/language codes, if it’s not in the list. See this link:

Yes, I saw ! This device uses the same schema as the AC ! I started to change the binding to include this support, but i had to stop because of some deep works I was done. I hope next days I have more time to finish it and other features in the pipeline. Sorry about that, guys !

1 Like

Ohhh my ! You got a bug ! Actually, the binding uses the thingId as the “deviceId”. If you change the autogenerated ID (that is, in fact, the lg’s device id) the binding will not find the device anymore in your account.
Thanks for share it ! I will fix !

It turns out that I didn’t have the most recent version of the binding, so I didn’t have the “Other” option for country.

My LG Washtower is coming up as two unsupported devices, which I suspected would be the case. It shows up in the LG ThinQ app as one device, but with completely separate controls for the washer and dryer (each with their own power states).

image

Here are the cap files:

thinq-f3ffaf70-5108-1fcc-840e-1c3929513928-cap.json.txt (86.5 KB)
thinq-29b0b9bd-be8d-1147-a46f-1c392951393c-cap.json.txt (53.3 KB)

Thanks for your efforts!

Are this 2 cap files related to a only one device ? (WashTower)
Looking to the files, appears to me to be supported by the last version of the binding. But, in this case, will come up as a Washer Thing and the other as a Dryer thing, but not as an unique device/Thing
Can you donwload/install the last version of the binding to confirm it ?

Regards.

Yes, they’re both for the same device. The Washtower is odd since it’s a single unit, but the washer and dryer work independently. For the purposes of openHAB, I think it would just show up as a separate washer and dryer.

This is the binding I downloaded, with a June 9 timestamp. Is there a newer one? If so, I can’t find it in this thread.

Hi Nemer, I just wanted to remind you of my request. When and if you have time of course. Thank you. Best regards

OK, guys. After some time, new version of the binding is available at: openhab-thinq-stuff/org.openhab.binding.lgthinq-3.3.0-SNAPSHOT.jar at main · nemerdaud/openhab-thinq-stuff · GitHub with new AC features:

  • AirClean mode
  • AutoDry mode
  • EnergySaving mode

Binding Fixes:

@Nirtsep , can you check if works for you as well ?

Regards.