LG Smart ThinQ

.poetry is in /home/pi on my system. Does poetry keep track of where the file is installed - /etc/openhab2/scripts/thinq2-python on your system by the looks of it

In my system-file I set the PATH to the .poetry/bin-directory and the WorkingDirectory points to the script-directory

1 Like

Based on this thread MY GOD - Anyone attempted an LG ThinQ integration? - Developers - Hubitat, @dcmeglio was able to attach to the MQTT servers provided by LQ and receive all the updates of the devices in the real time - see the code GitHub - dcmeglio/hubitat-thinq
Maybe this can help in creating OpenHab plugin.

1 Like

I have spent some time to adapt this code into proxy application which can read information about devices from Thinq’s MQTT topics and forward them to local MQTT server. It is WiP version, for sure a lot a work is still needed, but at least it works for me.
You can find sources here GitHub - mgwoj/Thinq-MQTT-Proxy

I am sharing this initial version, as it may be useful to others; but for next 2 weeks I will not have much time to answer any questions.

3 Likes

Hi Michal.
This sounds very good.
Can you only get Information from the client or also send commands?
Greetings,
Markus

I have focused on retrieving status so far. I guess it should be possible to send commands, but I haven’t evaluated that path yet.

Hi Michal,
I was trying this today for my aircon.
I have an local MQTT server with requires user and password to login.
Where and how would I put user and password in the state.json file?
Thanks,
John

I’d like to try this out as well, but my MQTT setup is also configured to require authentication. Are authenticated connections not supported?

Hi,

I tried setting username password as : “pubMqttServer”: “tcp://user:pass@192.168.1.10:1883”,

but getting this error

WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" Not authorized to connect (5)
        at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:28)
        at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:1040)
        at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:151)
        at java.base/java.lang.Thread.run(Thread.java:834)

Not sure if this is local MQTT error or remote one.

Amin

Authenticated connections are not supported. I am open for any PR which can provide such functionality.
My recommendation at this moment is to setup second, non-secure MQTT server and verify your configuration. If that works, please find a way how to enhance this code to support secured server.

In Mqtt.groovy file add following lines for local mqtt authentication after line no 43.

options.setUserName("username");                                              
options.setPassword("password".toCharArray());

Then rebuild the project. This is quick and dirty fix for now

1 Like

Hi,

I m not receiving any events when I change status of Dishwasher. Is Thinq-MQTT-Proxy working for anyone? There are no errors in log. And initial run gets the details of my dishwasher.

Regards,

Amin

I have done one fix for dishwasher, similar to washing machine. Please let me know if it solves the problem.

New commit adds support for MQTT authentication via new entries to state.json

  • pubUserName
  • pubPassword

Hi,

Same result no events dectected. Username / password change is working.

Thanks

Please try to increase logging level or do some debugging. If you receive notifications via LQ Thinq app, you should see them in the log too. As I do not have LG dishwasher, I cannot help more.

Hi Michal,

Not getting anything in logs. Can you let me know where is the remote Mqtt subscription happening in code? I went through code but could not get where subscription of LG remote MqTT is happening.

I can see this code

 void subscribe(String sub, int qos, def driver) {
        client.subscribe(sub, qos, (topic, msg) -> {
            driver.parse(msg)
        })
    }

I m not getting where this is called from.

Thanks in advance!

PS: ignore got where this is called from. Remote subscription is working. Looks like it is breaking while sending it to local MQTT.

Hi Michal,

The error was in Dishwasher processStateData method. Looks like there is some issue in parsing. I commented all and sent only data points which I need. And after this events are published correctly.

Thanks for your help!

Is there any example to show the data in the current structure in generic mqtt channel?

I tried jsonpath like this JSONPATH:$.[?(@.name == ‘course’)] but not getting correct data.

Thanks!

You need to increase logging level in the def parse(message) methods for every device. message object contains the JSON from external MQTT sever.