LG AC Wired Controller integration via ESPHome/ESP32

Hey all,

The past weeks I spent some time reverse-engineering the LG PREMTB001 wall controller and then designed my own ESPHome component to control my LG HVAC (heat pump) indoor unit. This is compatible with LG AC units like the LG PC12SQ but should also work with many other indoor units.

The hardware is an Espressif ESP32-WROOM-32E devkit module on a custom PCB in an Adafruit Raspberry Pi case.

The main advantage of this compared to the ThinQ integration is that it lets you use a HA temperature sensor to override the unitā€™s room temperature thermistor. It also doesnā€™t depend on LGā€™s cloud service, supports older units without Wifi, and the unit doesnā€™t make annoying sounds when settings are changed by this controller.

Source code, hardware schematic, and a lot more information here: GitHub - JanM321/esphome-lg-controller: Wired controller for LG HVAC units using ESPHome and ESP32

I hope someone finds this useful :slight_smile:

8 Likes

Thanks for the effort on this!
I do have a LG S12ET ā€œstandardā€ unit which does not have wifi. I have opened up the indoor unit and checked the PCB. It does have mounting holes on the PCB for a CN-REMO connector but it is unpopulated - no connector installed. I wonder if i could just take out the pcb, solder a header to CN-REMO and use it. My board also has a populated CN-LINK header which seems to be used for LGā€™s
wifi module - however i havent been able to find detailed info about this nor about which module is used.
There seems to be very little info about CN_LINK.

The ā€œstandard plusā€ units which have wifi (P12EN / P12SQ for example) seem to be nearly the same. However i cant find a picture of their pcbā€™s - so i dont know if they have the wifi onboard or actually connected to CN_LINK (or some other connector?).

I do have a LG S12ET ā€œstandardā€ unit which does not have wifi. I have opened up the indoor unit and checked the PCB. It does have mounting holes on the PCB for a CN-REMO connector but it is unpopulated - no connector installed.

Interesting. Iā€™d have expected all units to have a JST-XH connector for this at least.

The ā€œstandard plusā€ units which have wifi (P12EN / P12SQ for example) seem to be nearly the same. However i cant find a picture of their pcbā€™s - so i dont know if they have the wifi onboard or actually connected to CN_LINK (or some other connector?).

Iā€™m not sure about this but I think my units came with a Wifi module connected to CN-LINK. I havenā€™t really looked at the pcb etc in detail so unfortunately I donā€™t know what it looks like (and opening the unit to check is a painā€¦). The wifi module works pretty well too, but I really wanted to use an external temperature sensor (especially for heating mode) so thatā€™s why I went the CN-REMO route.

Iā€™ve checked alot of PCBs now (i have a EAX35907210 / EBR359365) and even the same PCB no. comes up on google picture search with different connectors installed/missing. So there seem to be alot of variations even for the same part no. However all appear to have a connector installed for CN-LINK, so this seems to be common. Best would be to reverse engineer that port/its protocol but without wifi module there is no way for me to do it.
It appears LG has a 6-pin wifi module which seems to fit numerous applicances (aircon, dish washer, etc) so if one was able to reverse engineer the proto it should be possible to control many devices based on their ThinQ cloud.

Iā€™ve put a scope up on the CN-REMO port (or rather the holes of the missing connector). It appears that pin 1 and 3 provide 12V AC (yes, AC not DC!). The port in the middle seems to be something different. I suspected that its the signal but i dont seem to be able to get it to show properly on my scope. No idea if its LIN or something different (my siglent has a LIN decoder but nothing shows up). Iā€™ll try to investigate this further.

The port in the middle seems to be something different. I suspected that its the signal but i dont seem to be able to get it to show properly on my scope. No idea if its LIN or something different (my siglent has a LIN decoder but nothing shows up). Iā€™ll try to investigate this further.

LG doesnā€™t use the actual LIN protocol, my hardware just uses a LIN transceiver because it makes it easy to send/receive data over a single 12V wire. LG uses a very slow 104 bps 8N1 serial protocol. I donā€™t know if the unit will start sending when itā€™s powered on or if you have to send something to it first. The LG wired controller and my own start sending after about 10 seconds, the unit sends its first message a bit later, up to 30-60 seconds or so IIRC.

LG doesnā€™t use the actual LIN protocol

Ahh, missed that, sorry. Well, then it makes sense i cant decode anything. But i dont see any ā€œusableā€ signal either or its very weird.
Iā€™ve checked some docs further and actually found a youtube video of someone disassembling a PC12 with wifi. I now know that the wifi module is mounted in a small white plastic case next to the LED display on the left of it. I still dont know which one but i assume its some of the LCW0XX type, probalby LCW003 (thats mentioned in the smart thinq manual for their ACs).
All of the LCW0XX modules have basically only 4 pins (5v/12v, GND, TX, RX) and according to datasheets all use UART for communication. And its indeed connected to CN_LINK on the main PCB.
So i am not sure if i will go ahead with the CN_REMO approach or rather try to go via CN_LINK and UART.
Found some more pictures and now know the pin layout of the CN_LINK connector, if its 8-pin:
(latch facing upwards):
GND none +V none COM1 COM2 none none

Dont know about RX/TX order yet, but thats not much of a problem. The CN_LINK connector on my pcb is 6-pin, so i have to find the layout of that.

But then i am not sure if i can get much further because i dont have the wifi module so i cant decode and find out what its doing.
Maybe iā€™ll try to catch one cheap on ebay.

Is there any news regarding this? Iā€™m about to buy a LG
S12ET. Would be really nice to hook this to Home Assistant.

(I want to buy the version with WIFi, does this make any diffrence?)

The Wifi version makes sense so you can always use the (unofficial) Home Assistant LG ThinQ integration.

The wired controller PCB I posted here will probably also work, but itā€™s a bit more effort to set up.

Yes, I just read about the Home Assistant LG ThinQ integration. Looks Ok but I prefer local control.

I have lots of ESPHome experience, do you have a spare PCB laying around by any chance?

You have any news on this?

I recently received my PCB boards and connected everything. Works like a charm. The external temperature sensor provides a much smoother operation and less on/off all the time. Very happy with it! I have 2 S12ET indoor units and was lucky that the boards could just fit in the indoor unit so you canā€™t see anything of them at all!

I still have 3 boards left, I want to keep 1 or 2 as a spare. The costs turned out to be a bit higher than anticipated in the end, so I donā€™t want to risk having to order some again in a while if one stops working. But I definitely have 1 left!

Really top work @JanM321

2 Likes

Hi, i have a multi split unit with 5 units

3 x pq12st
2 x wall ground UQ12f

i have bad response when i use the app so iā€™m looking for another solution

Could this help me out when i can connect it locally?

Could this help me out when i can connect it locally?

Iā€™m not completely sure about the floor console units, but if they have a connector for a wired controller such as the LG PREMTB001/PREMTB100 then I expect it to work.

The wired controller doesnā€™t support all of the same settings as the Wifi controller because not all settings are sent to it. See the GitHub README for a list of things that are currently supported.

Are you able to access the CN-REMO port without disassembling the indoor unit?

It depends on your unit. My units had a short green extension cable plugged into the CN-REMO port so I only had to open the bottom cover.

In newer modles I know that they put an extention cable. Itā€™s not my case, so I need to figure out how to get to the board to check the port since I have a 2011 unit.
Maybe someone here has had the same experience. I have MS09AH.N40 indor units.

What a wonderful job, I have lg vrf System with concealed indoor units that controlled by wall wired remote, is it ok to install the esp board in parallel with the main remote? I want to control the ac from home assistant while still being able to control it from the wall wired remote.

Thanks.

is it ok to install the esp board in parallel with the main remote? I want to control the ac from home assistant while still being able to control it from the wall wired remote.

Itā€™s possible to connect multiple controllers, but the ESPHome controller will currently ignore messages from other controllers so it probably wonā€™t work well.

The easiest option would be to put your LG remote in ā€˜slaveā€™ mode and then fix the ESPHome controller to process ā€˜slaveā€™ messages too.

I opened an issue for this: Support connecting multiple controllers Ā· Issue #34 Ā· JanM321/esphome-lg-controller Ā· GitHub

1 Like

I Am a noob in coding, I tried to copy the esphome codes but i keep getting errors, can you post your full code please,

Thanks.

I Am a noob in coding, I tried to copy the esphome codes but i keep getting errors, can you post your full code please,

What kind of errors are you getting? My code is all in the GitHub repository and if you follow the steps in the README it should just work (many people have set this up without issues).