Contribution - LG ThinQ Binding

Great Widget, i have tried it, but i’m currently still on Habpanel and preparing migration to the new OH3 display. Have done some Widget changes too and seems to work.(But it’s not weather for air conditioner :slight_smile: ).
Energy monitoring and enable/Disable Energy save would be cool, but this is already sufficient for my use.
Have you already found out what the different “Operation Mode” numbers mean?

guys what model of LG airconditioners do u have?I am planning to change my home’s 3 old units so i am thinking to go LG so i can intergrate to my openhab.I allready use my LG washer and dryer with mgw’s thinq-proxy .

@Constantinos_Contis, Dryer and Washer are almost supported, but still under development without commands available yet, only to read channels. You can try and give me some feedback.
About ACs, I think any model you buy (since the model supports LG ThinQ integration) is gonna work. In my house I have “LG Voice Art Cool Dual Inverter” and “LG Voice Dual Inverter” models.

1 Like

Operation Mode, OK… this part is a little bit complicated to explain.
Each model of AC has a specific operation mode set depending of its capability, etc. For exemple… the recently models have an operation mode called “AI”, but others don’t. Because this, LG created a kind of metadata that explain the capability os the devices. Then, after you discovered your device, the Bingind will first get this capability metadata. This files says the operations that your model supports. For example, look at this part:

"Value":{
      "support.airState.opMode":{
         "data_type":"enum",
         "value_mapping":{
            "0":"@NON",
            "1":"@AC_MAIN_OPERATION_MODE_COOL_W",
            "2":"@AC_MAIN_OPERATION_MODE_DRY_W",
            "3":"@AC_MAIN_OPERATION_MODE_FAN_W",
            "5":"@AC_MAIN_OPERATION_MODE_HEAT_W",
            "7":"@AC_MAIN_OPERATION_MODE_ACO_W"
         }
      },

When LG API send the monitoring data to the binding, it sends 0,1,2,3,5 or 7 (for this specific model of mine). The binding knows that 1 is “Cool” mode, because its associated with @AC_MAIN_OPERATION_MODE_COOL_W that will never changes, but the numbers (mode keys) can change. In other model, for example, 5 could be @AC_MAIN_OPERATION_MODE_AI_W and not @AC_MAIN_OPERATION_MODE_HEAT_W as mine.
Luckely, the Binding can create a relation between the specific key and modes “descriptions” dinamically becase OpenHab gives support on that. In the OpenHab UI, you will never see the codes 1,2,…, but the descriptions “Cool”, “Fan”, etc. Look at my UI:


As you can see, even Operation Mode been a Number, OpenHab UI shows me “Cool”. And when you try to select another option:

You will never see the number, but the related values that the Binding relate when discover the model’s capability.
Well, but… as you are trying to map the device in HabPanel, it doesn’t have this dynamic state support (I think). Than you must create a selection option by yourself, relating the descriptions with the “numbers”. Because in the end, when you send a command, you must send the Number of the Operation.
You can do that looking into the *-cap.json file in the $OPENHAB_USERDATA/thinq directory. There you can see the metadata of your model and can get the relation as I showed you above.

1 Like

Hi, guys. As the binding for Washer&Drier is almost stable, I’m wanting to try send some commands, if any is available.
Can you tell me if you can send some commands to your device through the LG Thinq App? If so, what kind of?

Start/stop, pick program, some program settings (spin speed, temperature etc).
I hardly ever use the app though.

Hi,

I really would like to use your binding because it’s exactly what I was looking for. I have 4AC units at home to automate. However I can’t connect to my LG account as my language and country are not supported in your binding. Is it possible to include this please? I’m from Belgium so the country code should be “BE” and the language “nl” (dutch).

Error:
2022-03-10 20:00:44.866 [ERROR] [internal.api.OauthLgEmpAuthenticator] - Error login into account. The reason is:{
“error” : {
“request” : “/emp/v2.0/account/session/xxxxxxx@xxxxxxx.xx”,
“code” : “MS.001.03”,
“message” : “BE”
}
}

Many thanks!

Of course I can. I gonna do this tonight. Try to visit my repo again tomorrow.
Regards,

i have a washer and a dryer ,country Greece and Lanquage english,how can i test the binding?Will the latest jar work with my region?

Nope. I’m planing to release today a new version with optional text fields that you can enter based on your country/language account configuration. I will let you know in this topic when it’s done

2 Likes

@Constantinos_Contis, you can download the new version (.jar) from my personal repository and install as already instructed in this topic. Then, in the configuration of the bridge, put “Other” in the language and country combo boxes, and fill out “Manual Language …” and “Manual Country …” input texts with yours. You can follow the ISO here (ISO-3166 Country Codes and ISO-639 Language Codes). Just remember that for language, *you must fill with composite language, ie, language-country. eg:

  • Brasilian Portuguese: pt-BR
  • Luxembourg German: de-LU
  • German (Standard): de-DE

In your case, i think country gonna be GR and language en-US (if you registered your account in the LG with American English). But to be honest, I think that language is not so important to LG API’s integration, but the country is essencial.

Try it out and let me know !

Cheers !

1 Like

thnx mate works just fine!washer and dryer detected…many thnx

You are welcome ! Enjoy the binding. If you have some problem, let me know.

1 Like

what the “Pooling Discovery Interval (>300)” setting do?Is it optional?After openhab reboot bridge come online but washer and dryer not.I had to refresh bridge for both come online again…

It is absolutely correct that washer and dryer are not always online. After a washing cycle, the washer switches itself of and openHAB state will change to OFFLINE - Disconnected. (Same in LG APP)
Same should apply to the dryer.

both devices were online the time that i checked so thats not it.But in general yes my washer goes offline after some time.My dryer at the other hand is always online…

In that case, we need a debug log…

The interval is related to the time the bridge wait until go again to the LG API to see if there is some new device registered available to the OpenHab discovery process. There is a default time internal (300 sec). If will fill in this field something less than this the biding will consider 300 sec.

This is because LG is clear when ask developers to do not hit in their API so frequent, and this is reasonable because this would take more resource of them.

About the status… when the Bridge goes online, it asks the related things to try to go online also. It’s a strange situation you are reporting. I suggest you to try send the steps to reproduce the same scenario and, preferable, showing the debug log.

BTW, when you say “bridge come online but washer and dryer not” whats is the current status of the thigs ? “Offline”, “Offline - Disconnected” ( in this case, you have to position the mouse in the top of “Offline” tag and you can see the detailed off the status) or “Error: …” ?

it was saying “Offline” and under that “BRIDGE Offline” but the bridge was online.I only pressed the “Save” at top right and the thing came Online immediately.

OK, Thanks. I will try to simulate this.