LG Smart ThinQ

Hey Michal,

I m getting the value

{
"name":"course",
"value":"auto"

}

As all values are are sent as different events to same topic, it gets overwritten in openhab. I added the conditional jsonpath but it did not work.

I m using OH 3 UI to configure generic mqtt thing and then adding different channels. Any better way to configure in OH 3?

Thanks

You can try this

    void sendEvent(LinkedHashMap<String, Object> eventMap) {
        log.info(eventMap)
        interfaces.pubMqtt.send("thinq/" + deviceNetworkId.replace("thinq:", "") + "/event/" + eventMap.name, eventMap.value)
    }

Let me try this.

Thanks!

Thanks! The solution worked fine. Just did one change. Sent entire object in value. This way more values can be sent together if required.

Now I will try to configure AC. I have added AC driver, have to do some testing.

Are you exploring to send commands to devices ? Any hint i can try out

Thanks

Here is the response from the author of the original implementation

Yes, it would be possible to control devices. However, I had not coded this. I got as far as writing a method called sendCommand but I never finished the implementation.

2 Likes

Hi, I’m new to this and try to set up my air-conditioned to get per mqtt to openhab. I Have set up a raspberry, installed. I have installed Java 8 and Apache Maven 3.8.1.
I have done a git clone GitHub - mgwoj/Thinq-MQTT-Proxy followed by cd Thinq-MQTT-Proxy
Then copied the file with : cp state-example.json state.json
I have modified state.jason with my settings, but now what should i do?
Description says: java -jar ./target/thinq-mqtt-proxy.jar init
but I have no thinq-mqtt-proxy.jar where is it? where should i get it?

Thank you for help

Have you followed steps from sections?

  • Prerequisites
  • Building

Hi,
Yes i Installed Java and Maven (3.8.1 not 3.6.3)
The problem is probably the i could not do “mvn clean package”
It gives me this error:
[INFO] Scanning for projects…
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.463 s
[INFO] Finished at: 2021-04-16T20:23:16+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/pi). Please verify you invoked Maven from the correct directory. → [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

Please run the error messages carefully.

Please run mvn command in the folder where pom.xml is located

Thank you, that was the solution. Sorry never user Maven before.
I now got:
Starting Thinq Mqtt Proxy…
ThinQ Found 4 devices
Devices identified…

What should happen next?

It looks that you have 4 devices, which is great. It means that communication with LQ servers works. Assuming that you have provided connection details for your local MQTT server (as described in the documentation), you should start receiving messages to your local topic, like thinq/washer/event/doorLock. You can use MQTT Explorer to check what is arriving.

Thats all right, i have 4 devices. I know MQTT Explorer and use it for other mqtt messages but i do not get anything from LG.
Am i doing something wrong in the json?
I have this:

“region”: “de-DE”,
“countryCode”: “DE”,
“pubMqttServer”: “tcp://192.xxx.xxx.xx:1883”,
“langCode”: “de-DE”,
“certSource”: “Use Cloud Service”,
“pubClientId”: “thinq”

My devices are 4 times air conditioner, maybe thy are not supported? In the drivers’ folder there is no Specific data for Air conditioner

ACs are not supported at this moment. As I do not own any, I can only provide suggestion how to add support:

  1. Copy i.e. ThinQ_Washer as ThinQ_AC
  2. Modify ThinQ_Integration::initialize to create instance of AC device
  3. Add entries to supportedDeviceTypes and deviceTypeConstants fields in ThinQ_Integration
  4. Check if ThinQ_Integration::getDeviceSnapshot gets any data
  5. Check what arrives to Device::parse
  6. If you receive data, you should modify ThinQ_AC to parse values to meaningful data

Thank you, I will try.
I added in ThinQ_Integration::initialize this:

case deviceTypeConstants.AC:
driverName= new ThinQ_AC()
break

I added AC in supportedDeviceTypes and deviceTypeConstants fields but how to know witch number i should add? (101, 201, …?)

I have found this maybe it could help?:

Sorry for the many questions but i only have some limited programming skills. How to check if ThinQ_Integration::getDeviceSnapshot gets any data ?

Just wanted to chime in to say this worked for me perfectly. I’m now able to send washer/dryer status to openhab via MQTT.

Thanks!!!

To find a code for the device you can debug and put break point in ThinQ_Integration::initialize.
The same for ThinQ_Integration::getDeviceSnapshot

This sound easier than it is. I was now editing on Raspberry Pi with nano. Tried to get all the stuff working on Windows but do not get it. Installing Eclipse on raspberry did also not work. I could give you access to my LG account for finding out the code if you would be so kind?
Or any hint how I could debug that easily :–)

It looks that your devices are in version 1 (V1). My recommendation is to remove them from your account and re-add using the LQ Thinq app. They should appear as V2 devices after this operation.
You can do this for one device at this moment to prove this approach.

I have a washer dryer machine and it works perfect :ok_hand:

Thanks a lot for the great job :exclamation:

What did I do wrong?

Starting Thinq Mqtt Proxy...
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
        at org.codehaus.groovy.runtime.dgmimpl.arrays.ObjectArrayGetAtMetaMethod.invoke(ObjectArrayGetAtMetaMethod.java:41)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.invoke(PojoMetaMethodSite.java:51)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
        at ThinQ_Integration.getOAuthDetailsFromUrl(ThinQ_Integration.groovy:628)
        at ThinQ_Integration.prefDevices(ThinQ_Integration.groovy:251)
        at ThinQ_Integration$prefDevices.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
        at ThinqMqttProxy.doRun(ThinqMqttProxy.groovy:40)
        at ThinqMqttProxy.main(ThinqMqttProxy.groovy:15)