[NO LONGER MAINTAINED] MY GOD - Anyone attempted an LG ThinQ integration?

And are you in the US ?

Can I get a small code example where it fails? It doesn't need to do anything meaningful.
The usual "no promises whatsoever" disclaimer applies.

2 Likes

@jbilodea

Yes, USA! The ThinIq app, according to LG Technical Support was first developed for Android users and subsequently ported to iOS with known issues they are working on. Luckily I had an old Android phone from a development project years ago, that I could load the ThinIq app The android app paired the LG Washer and Drier first try, much easier than the iOS app. The iPhone X ThinIq app did not work for the washer and drier and I have an active LG support ticket they are working on to analyze the iOS debug output from the ThinIq app.

It was LG's recommendation to try the Android client, even through my LG refrigerator registered as expected using the iPhone ThinIq app in 5/2019.

Who knows, anyhow, all three LG devices are registered to the ThinIq client, but only the LG refrigerator is not reporting accurate data from the HE app. But the ThinIq iOS app shows the correct temps of the refrigerator so I know it is connected to ThinIq!

Good to know, I'm using IOS. My wife used the washer and the dryer for the first time. Both machines are connected to the app but I received a notification only from the dryer when it completed, not from the washer. I'm thinking about chatting with LG about that.

1 Like

Sure can! I'll throw something together this weekend. Basically though it has to do with using MQTTS where the server's cert is self-signed or otherwise invalid. On the httpGet methods there is an ignoreSSLIssues option but no such similar option for MQTT.

The json is neither C nor F it's an enumerative value that I have to convert to C/F. When you went through the initial setup the logs would have shown something like "MODEL JSON PLEASE POST TO THREAD" can you post that line? It will help me track down why it is unable to convert you device attributes.

@gopher.ny here's a pretty basic sample using the Mosquitto test server. Their server, when you connect to port 8887, has an intentionally expired certificate. Unfortunately in the world of IOT bad certs are the norm :frowning: which is why they offer a test serve for this exact scenario. What would be awesome is, if interfaces.mqtt.connect offered a way to say "ignore SSL errors" just like exists for the http*() methods where you can specify ignoreSSLIssues to... well ignore SSL issues! If you use port 8883 for a valid, but self-signed cert.

metadata {
    definition (name: "MQTTSSLErrorSample", namespace: "dcm", author: "dmeglio") {
		capability "Initialize"
    }
}

def initialize() {
    try
    {
        interfaces.mqtt.connect("ssl://test.mosquitto.org:8887", "xyzclientid", "username", "password", cleanSession: false)
    }
    catch (e) {
       log.debug e
    }
}

def installed() {
initialize()
}

def mqttClientStatus(String message) {
    log.debug message
}

def parse(String message) {
    log.warn message
}
1 Like

Did a little research. Tech moves fast. It’s not because your fridge is new. It’s because it’s old even though it’s from 2019! If you send that model json I can fix it. You’re the first person with an old style mqtt fridge so I didn’t have access to that json to map the fields. It’s fixable if I can get a copy of it

1 Like

Thanks @dman2306,

If you can get this LG refrigerator (Model LMXS30796D-00) to work in your ThiniQ Integration app that would be awesome!!!! Our brand new LG Drier ( Model: DLEX7900BE) and LG Washer (Model: WT7900HBA) are reporting perfectly all the currentStates...

Here are the 3 LG devices that are created when I setup the app.

MODEL JSON -- PLEASE POST IN THREAD https://objectstore.lgthinq.com/fdc1d9e0-8241-4f8c-bc3a-16f5a4625ee8?Expires=1615097291&Signature=ny1n1Yu7ueev4uknqB0xauiAdfydVf2Ur8QUFHGx02zSrungmu3F8UZP7hBdqxMdnpKB0yKRySf2pwtH-HpHNZowzKyUSNAIDbI32KY9WrQyyzJ58WuMfH0M5eMyjW759m~SZMR-GfUZHUJ6Fm4G38yHfVnrazLMngj0wz-4TFigmuwrxxmkXJ1Ge7CWvDrBroqGmPsaAiRx8sgmtHFf4cIM-LkHSMOtOpRdVQTskjgI27f8LicS3PmyVncpyvdWQv0At7F~Aqc2U3aO9NeasWq26Kh7KrLP9KSby6yyB9XldrhkXSt~8BFrSaPuf84UJB788pdKesTulbneZjtu7A__&Key-Pair-Id=APKAI74R6YENXPGRIWLQ

[app:1026](http://10.0.0.80/logs#app1026)2021-01-16 05:51:28.962 am [debug](http://10.0.0.80/installedapp/configure/1026)ThinQ Integration getModelJson(https://objectcontent.lgthinq.com/984ea019-6ed4-4138-b0ad-a093501acc7a?hdnts=exp=1668761472~hmac=bba051f8aa240e0346b9bd766c90d757d60e137c7f1ecf3d68bfe6e33e698313)

MODEL JSON -- PLEASE POST IN THREAD https://objectcontent.lgthinq.com/984ea019-6ed4-4138-b0ad-a093501acc7a?hdnts=exp=1668761472~hmac=bba051f8aa240e0346b9bd766c90d757d60e137c7f1ecf3d68bfe6e33e698313

[app:1026](http://10.0.0.80/logs#app1026)2021-01-16 05:51:28.748 am [debug](http://10.0.0.80/installedapp/configure/1026)ThinQ Integration getModelJson(https://aic.lgthinq.com:46030/api/webContents/modelJSON?modelName=1REF12EIIFA__&countryCode=WW&contentsId=JS0214074703379713&authKey=thinq)

MODEL JSON -- PLEASE POST IN THREAD https://aic.lgthinq.com:46030/api/webContents/modelJSON?modelName=1REF12EIIFA__&countryCode=WW&contentsId=JS0214074703379713&authKey=thinq

[app:1026](http://10.0.0.80/logs#app1026)2021-01-16 05:51:28.738 am [info](http://10.0.0.80/installedapp/configure/1026)ThinQ Integration Found 3 devices

I did notice one error line in the debug log during setup, not sure that is an issue affecting the device.

[app:1026](http://10.0.0.80/logs#app1026)2021-01-16 05:51:23.847 am [debug](http://10.0.0.80/installedapp/configure/1026)ThinQ Integration lgAPIPost(https://aic-service.lgthinq.com:46030/v1/service/users/client, null)

[app:1026](http://10.0.0.80/logs#app1026)2021-01-16 05:51:23.112 am [debug](http://10.0.0.80/installedapp/configure/1026)ThinQ Integration getAccessToken([refresh_token:862eee95dacaa646e51c65d484a1fc97ee878e48290259aec4a484e0ca37458ed134cd85653da28d659948de50db784c, grant_type:refresh_token])

[==>] [app:1026](http://10.0.0.80/logs#app1026)2021-01-16 05:51:23.109 am [error](http://10.0.0.80/installedapp/configure/1026)ThinQ Integration lgAPIPost(https://aic-service.lgthinq.com:46030/v1/service/users/client, null) - groovyx.net.http.HttpResponseException: 400 - [resultCode:0102, result:]

[app:1026](http://10.0.0.80/logs#app1026)2021-01-16 05:51:22.449 am [debug](http://10.0.0.80/installedapp/configure/1026)ThinQ Integration getStandardHeaders() - headers: [Accept:application/json, x-client-id:a09b0aeedb3346a2bb3e7dcf2687d712c54008ca2bdd49e5936209b69ec5801d, x-country-code:US, x-language-code:en-US, x-message-id:VJMcbWuRSy2XMqMupH30kA, x-api-key:VGhpblEyLjAgU0VSVklDRQ==, x-service-code:SVC202, x-service-phase:OP, x-thinq-app-level:PRD, x-thinq-app-os:ANDROID, x-thinq-app-type:NUTS, x-thinq-app-ver:3.0.1700, Host:aic-service.lgthinq.com:46030, x-emp-token:5fcf047b3a53d6cfef8c8303bec341e700c2adf13d70e408dfa0f4c6d90a1ae2e3f9ddca6f473fd727c8997d75a6e177, x-user-no:US1905255403695]

[app:1026](http://10.0.0.80/logs#app1026)2021-01-16 05:51:22.445 am [debug](http://10.0.0.80/installedapp/configure/1026)ThinQ Integration lgAPIPost(https://aic-service.lgthinq.com:46030/v1/service/users/client, null)

[app:1026](http://10.0.0.80/logs#app1026)2021-01-16 05:51:22.442 am [debug](http://10.0.0.80/installedapp/configure/1026)ThinQ Integration register()

The LG refrigerator's json string never changes the returned value(s) for each poll. Initially, when I observed the returned JSON in the debug with no returned fields for the device, I checked your DTH and temporarily modified the json parse section to map it into the correct fields as expected. But then I quickly realized the temperature values never changed and the values were not correct for either F->C or C->F.

2021-01-16 05:26:26.880 am infoSuccessfully connected to RTI: [returnCd:0000, returnMsg:OK, stateCode:S, workId:n-695966d0-13a2-11e9-bf05-0051eddb96de, deviceState:E, timestamp:0]

dev:15062021-01-16 05:45:00.598 am debugLG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

dev:15062021-01-16 05:44:00.625 am debugLG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

dev:15062021-01-16 05:43:00.636 am debugLG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

dev:15062021-01-16 05:42:00.671 am debugLG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

dev:15062021-01-16 05:41:00.572 am debugLG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

dev:15062021-01-16 05:40:00.637 am debugLG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

dev:15062021-01-16 05:39:00.655 am debugLG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

dev:15062021-01-16 05:38:00.640 am debugLG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

Cool, that's what I needed! Out of curiousity, if you open on of the doors, does the DoorOpenState:CLOSE change to OPEN in the logs? Just want to make sure you're getting status updates evben though they aren't on the device page (yet). I'll take a look this weekend.

Great!

Yes, you are right. I did not see this door state update before in all the log posts for the app. I AM getting device updates, as the DoorOpenState did change when I keep the door open... Yahoo. I am connected!

@dman2306: If you want (since I have some time today), I can fork your DTH code for this device and make the changes in the "LG ThinQ Fridge" to map the json as you do other LG models. I will push the updated version back to your master repository for your inclusion in a next regular update and testing. Either way works for me, just didn't want to eat up your valuable time if I am the only one with this model of LG....

I look forward to your app invoking HE's TTS to tell me to, 'Back away from the refrigerator, close the door, have some self control Kurt..' when I go on a uncontrolled snack binge outside of regular meal time... HA!

Debug Output

[dev:1506](http://10.0.0.80/logs/past#dev1506)2021-01-16 11:31:00.651 am [debug](http://10.0.0.80/device/edit/1506)LG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

==> [dev:1506](http://10.0.0.80/logs/past#dev1506)2021-01-16 11:30:01.095 am [debug](http://10.0.0.80/device/edit/1506)LG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:OPEN, TempUnit:˚F])

[dev:1506](http://10.0.0.80/logs/past#dev1506)2021-01-16 11:29:00.623 am [debug](http://10.0.0.80/device/edit/1506)LG Refrigerator processStateData([TempRefrigerator:13, TempFreezer:8, IcePlus:@CP_OFF_EN_W, FreshAirFilter:@RE_STATE_FRESH_AIR_FILTER_MODE_AUTO_W, SmartSavingMode:@RE_TERM_DELAY_DEFROST_CAPABILITY_W, WaterFilterUsedMonth:0, DoorOpenState:CLOSE, TempUnit:˚F])

ThinQ App

Thanks, I'm actually already playing with it. I don't think it'll be a ton of work to get this resolved.

1 Like

If you get a minute, could you confirm this at least reports the door open/close and other values (everything except temp?) GitHub - dcmeglio/hubitat-thinq at fridge-fixes

I have to figure out the temp conversion for your fridge but wanted to at least make sure this was working to communicate.

I assume we are still dead in the water in canada when we get this certificate error? I just tried the integration got the same error

As I understood, @gopher.ny will try something. I'd love if somebody could find a fix since I can't.

1 Like

Yeah. The cert error would require either LG to fix the cert (doubtful they care) or HE to add an option to ignore invalid certs. If they add that feature I’ll definitely fix it but as @gopher.ny said, they make no promises.

I wrote to Hubitat Support to request that change. You should write too, if they get many requests maybe they will do something.

An update for anyone receiving certificate errors, I found the pattern, there is something different between the C5 and C7. The app runs just fine on a C5 but seems to have SSL Certificate errors on a C7. I've shared code that reproduces the problem on a C7 but works on a C5 with the HE team, but no promises on when/if they will fix it. Unfortunately, for the time being, this app does not work on a C7. If anyone DOES have it working on a C7 I'd love to know!

1 Like

interesting.. so there is hope!

The problem is that the underlining certs (/.../lib/security/cacerts) used by the integrated JVM are expired.

The problem is very simple to resolve, they just need to update the JVM or upgrade the list of certs keytool

But this can only be done my the HE Team: @mike.maxwell | @bravenel | @bcopeland

The certificate is no longer trusted, not expired. Use ATS endpoints for AWS MQTT as per How AWS IoT Core is Helping Customers Navigate the Upcoming Distrust of Symantec Certificate Authorities | The Internet of Things on AWS – Official Blog. C5s have older JDK, where certificate in question is still trusted, so it works on C5s, but not on C7s.

2 Likes