Contribution - LG Thinq [WasherDryer] [WIP]

This topic is to discuss and evolve the Washer & Dryer devices implemented by LG Thinq Binding
This topic is related to:

Hi @nemer,
I’ve joined this thread as I’m interested in automating my ThinQ Washer start.
Note: Refrigerator based suggestion moved to other thread

And I’m interesting to do it :smiley: . You help me a lot and now I have all I need to fully integrate Washer V1. But, tell me more about the fault conditions you want to monitor.

I’m working hard to finish the refactoring by this weekend and hopefully next week you will have a new version to test.

Kevin, can you move this point (refrigerator fault condition) them to the topic

Then we can continue this feature from there.
Sorry about that, but it’s just to organize myself better about the device´s needs.

1 Like

I have a LG Washer and Dryer if you want more help.

Dryer model: DLEX4200B
Washer model: WM4100HBA

I’m looking for someone that has Thinq V1 Washer. But, from the model I can’t know if it’s V1 or V2. You have to install my binding, registry your device and in the configuration of the Thing, you can see the properties information. Something like this:

If your platform_type is thinq1, then you can help me with some tests.

I’ve got a v1 washer/dryer if that’s helpful? TBH I did trying the binding before and was getting problems with it disappearing/erroring but at the time didn’t have the time to troubleshoot it (the info was scattered all over the thread and the native app “finished” notifications worked okay; although there are other major issues with showing outstanding remaining times they have not fixed properly in years - every few updates it works properly and then they either break it again or it shows a previous washes’ time until you wait 10-15 seconds for it to update with the current one - extremely confusing if you are not aware of it and just a terrible terrible approach!).
I will happily help you if you like as OpenHAB should be able to be better than the LG app.

1 Like

I uploaded the latest release with some refactoring and RemoteStart and WakeUp commands for WasherDryer Thinq V2.
How does this new feature work ?

  • When you program your washer to remoteStart, a new channel named LaunchRemoteStart is dynamic created in the devices channel.
  • To start your WM, send command “START” to the item associated to this channel.
  • If your machine is in Sleep Mode (Stard By channel state to ON), then before sending remote start command, you must switch off this channel.

Let me know if it works !

Cheers.

Hi Nemer,
I have Washer V1 working with your binding (very old version: 3.3.0.202206021838).

I’m going to install your latest version of binding later today and let you know if it still works.

I don’t think the new features will work on V1 WM. I was focuses only on the V2 devices. But I’m working now on V1.
WM V1 has a quite different approach to communicate with LG API Server. It uses a kind of bynary/byte format. It will give me some more effort to implement.

I uploaded the latest release with WakeUp command for WasherDryer Thinq V1.

In order to try it, you must:

  1. Update with the latest binding in my personal repository
  2. Put your WM in StandBy mode (put in Remote Start and wait the auto stand-by)
  3. See that the channel (Stand By) goes to ON
  4. Switch it to OFF

After switch to off, the WM will wake up (I hope).
Let me know if it works. If some error happens or the WM doesn’t wake up, please, attach here the log.

1 Like

I’ve tried this latest version with Washing machine (V1) and unfortunatelly it is not working properly.
I mean it even doesn’t start the communication with the server and Washer thing remains OFFLINE (no matter if the machine is ON or OFF).

I got this exception in log:

2023-02-28 14:21:04.601 [ERROR] [al.handler.LGThinQWasherDryerHandler] - Error updating thing Pracka/d62951d0-48cb-11ec-a3bd-7440be1b160a from LG API. Thing goes OFFLINE until next retry.
org.openhab.binding.lgthinq.internal.errors.LGThinqApiException: Error starting device monitor in LG API for the device:d62951d0-48cb-11ec-a3bd-7440be1b160a
        at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.getSnapshotDeviceAdapter(LGThinQAbstractDeviceHandler.java:373) ~[?:?]
        at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.updateThingStateFromLG(LGThinQAbstractDeviceHandler.java:268) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
        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: org.openhab.binding.lgthinq.internal.errors.LGThinqApiException: Status error executing endpoint. resultCode must be 0000, but was:null
        at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiV2ClientService.handleGenericErrorResult(LGThinQAbstractApiV2ClientService.java:99) ~[?:?]
        at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiClientService.startMonitor(LGThinQAbstractApiClientService.java:406) ~[?:?]
        at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.getSnapshotDeviceAdapter(LGThinQAbstractDeviceHandler.java:357) ~[?:?]
        ... 7 more

I’m confused by seeing the LGThinQAbstractApiV2ClientService. It looks like the binding has not correctly recognized the V1 device?
When I put the previous version (3.3.0.202206021838) the WM is working correctly again.

Here is also the *cap.json file:
thinq-d62951d0-48cb-11ec-a3bd-7440be1b160a-cap.json (79.3 KB)

Sorry, it was a bug in the refactoring process. A provided a new version to you try again.

1 Like

I’ve tried and now it looks better, but still not good.

I got no exception, just the warning

2023-02-28 15:57:15.241 [WARN ] [al.handler.LGThinQWasherDryerHandler] - LG API returns null monitoring data for the thing Pracka/d62951d0-48cb-11ec-a3bd-7440be1b160a. No data available yet ?

This repeated several times, untill I switched ON the WM. Then nothing more related to LG binding is logged. But also no updates of items is done.

Washer state or washer power remains on their previous values.

When WM is turned OFF then few more warnings mentioned above are logged and then this LGThinqApiExhaustionException after which the thing goes OFFLINE.

2023-02-28 16:05:46.835 [ERROR] [al.handler.LGThinQWasherDryerHandler] - The thing Pracka/d62951d0-48cb-11ec-a3bd-7440be1b160a reach maximum retries for monitor data. Thing goes OFFLINE until next retry.
org.openhab.binding.lgthinq.internal.errors.LGThinqApiExhaustionException: Exhausted trying to get monitor data for the device:d62951d0-48cb-11ec-a3bd-7440be1b160a
        at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.getSnapshotDeviceAdapter(LGThinQAbstractDeviceHandler.java:402) ~[?:?]
        at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.updateThingStateFromLG(LGThinQAbstractDeviceHandler.java:268) ~[?:?]

I guess you would like to see some debug logs, right?

Hummm interesting. Can you put the binding in debug log level, test again, and provide the entire log for me?

I enabled the DEBUG and tried once more. It complains that the monitored data are unreadable.

Here is the datatrace.json and debug log.

2023-02-28-djal-washer-datatrace.json (226 Bytes)
2023-02-28-djal-washer-debug.log (23.0 KB)

1 Like

I Found the issue. Thank you to provide detailed information that helped me a lot.
I will try to fix it by tomorrow and let you know when it’s done.

1 Like

@djal, I delivered a new version, try it out and let me know ! I hope that:

  1. Stop de errors and you can view the channels updated as previous version
  2. If your WM is in StandBy state, you can switch it OFF by the channel.

Important, I recently updated the branch to 3.4.3. Then, download the file:
org.openhab.binding.lgthinq-3.4.3-SNAPSHOT.jar
instead of
org.openhab.binding.lgthinq-3.3.0-SNAPSHOT.jar

3.3.0 is deprecated in the OH3 repositories

Regards

1 Like

Nice work @nemer, thanks for your effort.

Now the channels are updated correctly. I tried to verify the remote start and standby channels.

I activated remote start on WM, but remote start item stayed in OFF state.
When the WM entered the standby mode after some time, the standby channel also was not updated and remained in OFF state.

In debug log there was nothing except this entry which appeared just after switching the WM to the remote start (it was logged just once)

2023-03-02 17:50:46.321 [WARN ] [al.handler.LGThinQWasherDryerHandler] - LG API returns null monitoring data for the thing Pracka/d62951d0-48cb-11ec-a3bd-7440be1b160a. No data available yet ?

and the datatrace contained

{"deviceId":"d62951d0-48cb-11ec-a3bd-7440be1b160a","deviceState":"E","format":"B64","returnCode":"0000","returnData":"AQI0AjQCAAMHBAEAAAAAQgAAAwAAKABkAAADAA==","stateCode":"S","workId":"n-d62951d0-48cb-11ec-a3bd-7440be1b160a"}

After WM entered the standby mode the datatrace file changed to:

{"deviceId":"d62951d0-48cb-11ec-a3bd-7440be1b160a","deviceState":"E","format":"B64","returnCode":"0000","returnData":"AQI0AjQAAAAAAAAAAAAAAgAAAwAAKABkAAADAQ==","stateCode":"S","workId":"n-d62951d0-48cb-11ec-a3bd-7440be1b160a"}

I checked also the LG Thinq app and there the Standby mode was visible and it was also possible to wake the WM up back to ON state.

Let me know if you need more info or more test data from me.

Ok… I’m looking into this…