Contribution - LG ThinQ Binding

Hmm. That’s the issue. I believe that different countries have different sites. In my case I created account through LG app. Hence I have no idea what language/country to set up in the binding as there is nothing in the app in my case but to select language Polish/English.

Do you tried the binding ? Based on the experience from other users, regardless the country/language you put, the authentication process will return an error (if the country is wrong), but in the OH3 log, will appear something like this:

 ==> /var/log/openhab/openhab.log <==
2022-02-08 00:42:06.657 [ERROR] [internal.api.OauthLgEmpAuthenticator] - Error login into account. The reason is:{
  "error" : {
    "request" : "/emp/v2.0/account/session/...myemail...@gmail.com",
    "code" : "MS.001.03",
    "message" : "DK"
  }
}

Where “DK” is the “correct” country. Let me know if your country/language is missing into Binding configuration.

Here it is

2022-02-08 19:51:26.331 [ERROR] [internal.api.OauthLgEmpAuthenticator] - Error login into account. The reason is:{
  "error" : {
    "request" : "/emp/v2.0/account/session/***@gmail.com",
    "code" : "MS.001.03",
    "message" : "PL"
  }
}

Seems like this will be country Poland and language Polish (PL)

I pushed in the PR a new version with Polish support. Please, check it out. In time, what kind of Thinq device are you trying to handle ?

My device is washer-dryer, similar to the device described in the manual that I’ve attached above. My device is precisely LG Vivace V900 10,5/7 kg Steam+ 1400rpm ThinQ Model: F4DV910H2
Bought in 2020, not available anymore.

Link please :slight_smile:

Please, don’t forget after registry your WM, it will not have any channel working, right ? Is just to produce an output file containing monitoring data I need to map values into the Channels. Then, after Online status, please get the file: $OH3_USERDATA/thinq/thinq-*-datatrace.json and attach here. Thanks

Please don‘t publish it under that link. With your latest commit, you added the binary to your PR.

Ops… sorry. I will get rid of it and put in my personal area.

Installed the new binding. And now the bridge got online… But it reported and error… Even though, it actually found my washing maschine automaticly :smiley:

( I have the washing maschine in the inbox now. I have not added yet).

Will provide the json as soon as I find the file.

2022-02-08 21:42:56.012 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'lgthinq:bridge:4bb559ca4d' changed from UNINITIALIZED to INITIALIZING
2022-02-08 21:42:56.019 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'lgthinq:bridge:4bb559ca4d' changed from INITIALIZING to UNKNOWN
2022-02-08 21:42:59.791 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'lgthinq:bridge:4bb559ca4d' changed from UNKNOWN to ONLINE
==> /var/log/openhab/openhab.log <==
2022-02-08 21:43:00.832 [ERROR] [al.discovery.LGThinqDiscoveryService] - Error trying to get device capabilities in discovery service. Fallback to the defaults values
java.lang.ClassCastException: Cannot cast org.openhab.binding.lgthinq.lgservices.model.washer.WMCapability to org.openhab.binding.lgthinq.lgservices.model.ac.ACCapability
	at java.lang.Class.cast(Class.java:3605) ~[?:?]
	at org.openhab.binding.lgthinq.lgservices.model.CapabilityFactory.create(CapabilityFactory.java:52) ~[bundleFile:?]
	at org.openhab.binding.lgthinq.lgservices.LGThinqApiClientServiceImpl.getCapability(LGThinqApiClientServiceImpl.java:211) ~[bundleFile:?]
	at org.openhab.binding.lgthinq.internal.discovery.LGThinqDiscoveryService.addLgDeviceDiscovery(LGThinqDiscoveryService.java:128) [bundleFile:?]
	at org.openhab.binding.lgthinq.internal.handler.LGThinqBridgeHandler$LGDevicePollingRunnable.doConnectedRun(LGThinqBridgeHandler.java:209) [bundleFile:?]
	at org.openhab.binding.lgthinq.internal.handler.LGThinqBridgeHandler$PollingRunnable.run(LGThinqBridgeHandler.java:140) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
	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) [?:?]
2022-02-08 21:43:00.840 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'lgthinq:201:4bb559ca4d:592bd2a4-d3e7-16e9-a69f-44cb8b2e0c43' to inbox.
==> /var/log/openhab/events.log <==
2022-02-08 21:43:00.839 [INFO ] [openhab.event.InboxAddedEvent       ] - Discovery Result with UID 'lgthinq:201:4bb559ca4d:592bd2a4-d3e7-16e9-a69f-44cb8b2e0c43' has been added.

Here is the json data for my WM. (renamed the file to .txt to be able to upload here).

I cant get the bridge to discover my Dryer… How to do that?

thinq-592bd2a4-d3e7-16e9-a69f-44cb8b2e0c43-cap.json.txt (77.7 KB)

It’s not this file. First, you need to put the binding in debug mode, if isn’t , datatrace will not be created. To do so, proceed in this way:

  1. Stop the openhab service:
sudo service openhab stop
  1. Wait while, then start openhab in console mode (if ask for openhab password, the default is habopen):
sudo openhab-cli start --debug
  1. inside the text console, enable debug mode of the binding:
log:set DEBUG org.openhab.binding.lgthinq
  1. you can use the own console to tail the log:
log:tail
  1. disable and enable the bridge through UI interface and go again to the $OH3_USERDATA/thinq/. The file thinq-*-datatrace.json must be there.

By the way, I fixed the typecast error and pushed a new version. You can try this new one.

Great! The bridge works now. OH found my device and I added it as new thing. The added thing shows one channel for Power switch, however OH shows error in communication.

COMMUNICATION_ERROR

Erros list account devices from LG Server API

Arrgh forgot to disable/enable the brigde after debug mode :frowning:

Here you go…

thinq-592bd2a4-d3e7-16e9-a69f-44cb8b2e0c43-datatrace.json.txt (2.4 KB)

Great, Kim ! Tx ! It’s what i was looking for :slight_smile:.

It’s matter. The bridge and Thing must be running Online without error. It’s means the WM Thing is connected to LG API. If you have some error, please, send me here the stacktrace to troubleshoot.

For now, I gonna dig into this file to map the values to the channels. I think till tomorrow I can release an update with channels mapped for read and after, we can try to send some commands.

Cheers.

Nemer.

2 Likes

I dont see any errors, except for tke polling interval value… But thats just an info, going back to default.

Just let me know when you´re ready, and I´ll be here to test :slight_smile:

A small Sidenote…
I noticed the LG Thinq App also discovers and control my LG OLED TV. There is already a LG WebOS binding for openHAB. But would the ThinQ binding be any better?

I noticed the LG Thinq App also discovers and control my LG OLED TV. There is already a LG WebOS binding for openHAB. But would the ThinQ binding be any better?

Depends what you want. LG WebOS is more responsive, because it connects direct to your TV without pass through LG API Server. It means… you don’t need internet or have delay to control your TV with WebOS Binding. The only advantage I see is that with LG Thinq API you can control your device though internet (i.e. remotely) but, if you have your OpenHab connected with MyOpenHab cloud, then… the effect is the same.
In my house all TV’s are LG and supports WebOS. I’ve never felt n need os features that I didn’t find in the LG WebOS Binding.

To sum it up, IMO I don’t think it’s worth to use LG Thinq to control LG TVs.

That makes sense… I also use the WebOS binding… I just wondered if the ThinQ would be better… But like you said, there is no reason to :slight_smile:

I’ve mapped channels: Power and State.

The better is to delete the thing and recreate it again, because some property keys was changed. If you guys could test (plays your Washers and following the Thing) and tell me if is everything OK.

Cheers,

Nemer.

Files uploaded here