Contribution - LG ThinQ Binding

Hi @nemer

I Installed new version but i got the same channels as before, except fan speed.

Problems saw so far:
Operation mode cannot by changed and also contains Cool, Fan, Dry instead of Cool, Heat, Ai

Channels missing:
Water In temperature
Water Out temperature
DHW temperature
Room Air temperature
DHW switch

I think it may look like an AC but should have it’s own configuration

This should be a persistence cache. I simulated the same capability file you provided and the channel Operation Model options are “Cool, Heat and AI”:


I suggest yout to remove the thing and try to add it again and, in the last case, restart OH.
If you still can’t change the Operation Modes, provide me the logs at the moment you tried to change it.

About the other channels, I didn’t add them and, as I don’t have this device, I don’t know about what this channels means. If you give me some brief description about them and the domain values, I can try to research and include.

Regards

Indeed a restart fix the Operations Modes

But still cannot change mode

heatpump.txt (2.9 KB)

Very strange… error 9006 means Access Denied from LG API. Can you change your Heat Pump’s mode from LG App ? If so, if you change the mode from LG App, the Operation Mode Channel in the Binding is updated as well ?

Yes from mobile App everything is working.
On Off also works from openhab.

When I change mode from app I see logs changing in openhab but the mapping seems to be wrong
As I see the correct mapping is AI=3, Heat=4, Cool=0 from airState.opMode
But now it’s AI=4, Heat=5, Cool=1 from support.airState.opMode I suppose

Just turned it ON manually, selected a program and pressed remote start on the washer. After a period of time it entered Standby and Standby Mode Item changed to ON. I sent OFF to the Standby Mode Item and this was dropped into the log

2022-11-04 10:56:10.595 [ERROR] [es.LGThinQAbstractApiV2ClientService] - Error returned by LG Server API. The reason is:{"resultCode":"9006","result":{"data":""}}
2022-11-04 10:56:10.596 [ERROR] [nternal.handler.LGThinQWasherHandler] - Error executing Command OFF to the channel stand-by. Thing goes offline until retry
org.openhab.binding.lgthinq.internal.errors.LGThinqApiException: Error returned by LG Server API. The reason is:{"resultCode":"9006","result":{"data":""}}
at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiV2ClientService.handleGenericErrorResult(LGThinQAbstractApiV2ClientService.java:74) ~[?:?]
at org.openhab.binding.lgthinq.lgservices.LGThinQWMApiV2ClientServiceImpl.wakeUp(LGThinQWMApiV2ClientServiceImpl.java:83) ~[?:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQWasherHandler.processCommand(LGThinQWasherHandler.java:249) ~[?:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.lambda$0(LGThinQAbstractDeviceHandler.java:408) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
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) [?:?]

According to app washer is “In sleep more” and front panel is blank apart from remote start icon showing. App has a wake up button which works. I’ve attached datatrace

thinq-e4ce4562-d254-11ae-b1d8-402f86e594f8-datatrace.json (2.4 KB)

and also the cap

thinq-e4ce4562-d254-11ae-b1d8-402f86e594f8-cap.json (78.7 KB)

Going forward when using delay start the washer cycle time is calculated and this is reflected in the remaining time channel. Using the app it is possible remotely to set a delay and start the cycle which allows the time to be calculated, then during the wait time the cycle can be stopped and the delay reset to zero. Then the cycle started again. This would be a desirable level of extra control as my machine with a single large sheet in it went from a program time of 3:14 to 1:18 after its time calculation. The calculated program time seems to vary based upon the loaded laundry weight, and is fine tuned as the cycle progresses.

Hello @nemer
On March you added the country code de-LU for me and it works like a charm. Now i have done an update and the country code seems to have been removed. I get the error:

{country=The value LU does not match allowed parameter options. Allowed options are: [ParameterOption [value=“US”, label=“United States”], ParameterOption [value=“UK”, label=“United Kingdom”], ParameterOption [value=“BR”, label=“Brazil”], ParameterOption [value=“PL”, label=“Poland”], ParameterOption [value=“PT”, label=“Portugal”], ParameterOption [value=“DE”, label=“Germany”], ParameterOption [value=“DK”, label=“Denmark”]], language=The value de-LU does not match allowed parameter options. Allowed options are: [ParameterOption [value=“en-US”, label=“American English”], ParameterOption [value=“en-GB”, label=“British English”], ParameterOption [value=“pt-BR”, label=“Brazilian Portuguese”], ParameterOption [value=“pl-PL”, label=“Polish”], ParameterOption [value=“pt-PT”, label=“Portugal Portuguese”], ParameterOption [value=“de-DE”, label=“German (Standard)”], ParameterOption [value=“da-DK”, label=“Danish”]]}

Could you add it for me again? or can i add it myself?
Thank you

See this post, please:

Thank you @nemer , this is a good idea.
I currently have no “other” as I installed the binding from the default web console.

So I would like to try your new version. I have downloaded this:

I have copied it into my add-on folder, but as I never have done this(update), what should I do next? Uninstall official binding?

Thank you again for this great binding.
Or is it planned that the public version of the binding gets updated with the “other” feature?

It most likely you are using a very old version.
This is the last version installed locally:


I’m uploading the last version again, just to confirm I haven’t been made some mistake…

Please, try to download and install the binding again. If it still doesn’t work, probably is some problem in your installations process. In this case, I suggest you to check the logs for the binding deploy process.

Hi @nemer , thank you for your big support. I have removed the previous binding I had.
Have copied the new jar in the add-ons folder.
Have run a “Fix Permission”
Have done a reboot
Had a long time no bonding at all…now finaly after a lot of retry i have again the binding i had previously.
Result of: bundle:list -s | grep openhab
gives me

316 x Active   x  80 x 3.3.0.202202090650     x org.openhab.binding.lgthinq

Any suggestion what i can do to get the newer version?
In the addon folder i have a file called org.openhab.binding.lgthinq-3.3.0-SNAPSHOT.kar
Should i remove it?

Sorry for disturbing with that :frowning:

About to buy a 4split airco and looking for openHab 3.0 integration.
Stumbled upon this topic and looks great, thank you in advance for the hard work.

Does this binding still rely on the cloud or is there a way to do it all locally?
I hate cloud services but there is almost no way around it.

Try to do the following steps:

  1. upgrade de system/openhab to the latest stable release (using openhab-config)
  2. put the binding in debug mode.
  3. touch the binding file in the OH_BIDING folder and look to the logs. In my case:
cd /srv/openhab-addons
touch ./org.openhab.binding.lgthinq-3.3.0-SNAPSHOT.jar

If you see nothing in your logs under lgthinq domain, I really don’t know what’s happening in your environment. Probably you should try to save you config files and try a new install from the scratch.

1 Like

@Kostas_Injeyan, I found a bug int the operation’s modes mapping for V2 API. I gonna fix it and let you know.

I hate as well. But… there’s no way to access the Thinq devices directly/locally. The firmware installed on it will always try to access LG API domain. So… the binding has to rely on the cloud to have access to the devices related to your account.
But… the LG Cloud works very well, at lest in my country. Since you have good internet and signal to your LG devices, I think you will not have problems with the cloud.

@nemer

Hi. I was wondering if you were able to fix this issue. I tried the latest snapshot and I am still getting the same error as before (original comment: Contribution - LG ThinQ Binding - #301 by BoomerT)

HANDLER_INITIALIZING_ERROR

Unexpected error. Course not present in capability schema

How to define things declaratively? I have the Bridge up and running and can add devices there as things via UI, but would need to add those via things file instead (due to version control/backup purposes). What parameters does the Thing require? I have tried guessing different property names but haven’t beeen able to figure out.

Here’s a working Bridge definition and under that some attempts for the things that do not work.

Bridge lgthinq:bridge:df7c4e9d43 "LG ThingQ Bridge" [ country="--", manualCountry="FI", language="--", manualLanguage="fi-FI", username="xyz@xyz.com", password="zyx" ] 
{
    // Thing 201 WashingMachine "Washing machine" [deviceId="7971c6e1-044a-1a55-9cb4-805b65a18bfc"]
    Thing 202 Dryer "Dryer" [UID="7971c6e8-044a-1a55-9cb4-805b65a16bfc"]
}

You are running an older version. I Think it’s already fixes since WM support is working for other users. Can you try to update the binding, remove & add again your device and see if it’s fixed for you.

I really don’t know because it’s not related directly with the binding, but with the OpenHab’s core storage.
Hence, If you are intending only to backup your configuration files, I suggest you to take a look at /srv/openhab-userdata/jsondb directory that contains json database files related to the configurations done in the UI. I think you don’t need (since OH3) to create things declaratively anymore since the json database is already a “declarative base”.

How come other bindings can provide such details about how to configure Things? E.g., with Hue, the documentation says you need to include lightId in the properties of the thing: Philips Hue - Bindings | openHAB