Wired controller for LG Air Conditioners using an ESP32 microcontroller and ESPHome. It can be used to control an indoor unit from Home Assistant.
This has some advantages compared to the LG ThinQ integration:
If your indoor unit supports the LG PREMTB100 and/or LG PREMTA200 controller, it will very likely be compatible.
The wiki has a list of LG AC units that have been tested with this controller.
It's possible to connect multiple controllers to a single indoor unit, but one of them must be set as 'master' and the others as 'slave'. Since February 2024, this ESPHome controller has experimental support for this. I'm not using this myself, so there might be some issues with this (please report them).
The room temperature sensor is ignored for 'slave' controllers, so if you want to use this controller with an LG controller and use a Home Assistant temperature sensor, the LG controller must be set as 'slave'.
There seem to be two different protocols that LG AC units and wall controllers use to communicate:
The controller hardware is identical because both use a very slow serial connection (104 bps) over a three-wire cable (Red = 12V, Yellow = Signal, Black = GND). In fact, some LG controllers support both protocols: my LG PREMTB001 controller first tries the 13-byte protocol and if it doesn't receive a response it will switch to the 6-byte protocol. My LG PREMTB100 (newer controller) only supports the 13-byte protocol as far as I can tell.
Wired controllers must be connected to the CN-REMO socket on the indoor unit's PCB (green 3 pin JST-XH connector). Fortunately my wall units came with a short extension cable already plugged into that port so I only had to open up the bottom part of the unit to connect my controller.
Wired controllers using the new protocol only send and receive settings and current temperature. The HVAC unit itself decides when to start/stop active cooling/heating etc based on this. It's possible to use a Home Assistant template sensor as temperature sensor to influence this behavior (see below).
See protocol.md for information about the protocol based on reverse engineering the PREMTB001 and PREMTB100 controllers.
Features currently available in Home Assistant:
The LG ThinQ app and wireless remote can still be used to change these settings and other settings. They'll be synchronized with this controller.
Unfortunately not all settings are exposed to the wired controller, but if you're interested in a feature and it's supported by the PREMTB100 or PREMTA200 controller, please open an issue and we can consider adding it.
You need at least the following parts for each indoor unit:
The hardware-tiny/
PCB can be ordered from JLCPCB (see instructions here). The hardware/
PCB I ordered from PCBWay.
❗ Update November 2023: This section is for my original PCB in the hardware/ directory. Florian Brede has designed a smaller and cheaper PCB that can be ordered from JLCPCB. It's in the hardware-tiny/ directory.
See hardware/ for schematic and list of materials. This part was based on the excellent work and research by @Flameeyes:
The hardware needs four main components: 1) Microcontroller. Similar to their setup, I used an Espressif ESP32-DevKitC-32E board (it has the ESP32-WROOM-32E module). A devkit module is nice for this because it doesn't need any external components. My PCB has two female pin headers connecting it to the board. This also makes it easy to replace or upgrade if needed. 2) Transceiver. This is needed because the AC has a single (12V) signal wire but the microcontroller has separate (lower-voltage) RX/TX pins. I used a TI TLIN1027DRQ1 LIN transceiver. LIN transceivers are typically used in the automotive industry but work well for this too. As explained by Flameeyes, it's important to use a LIN transceiver without the "TXD-Dominant Timeout" feature because LG's very slow ~104 bps serial connection can trigger that timeout and this will corrupt the signal. 3) Voltage regulator. This is needed because the AC supplies 12V but the microcontroller requires 3.3V. I replaced the voltage regulator part with a Traco Power TSRN 1-2433 step-down switching regulator because it doesn't require any external components such as capacitors or inductors. (In hindsight, the Traco Power TSR 1-2433 might have been better because it's cheaper and has better availability.) 4) Connector. To connect the PCB to the AC. I used a screw terminal for this.
My PCB also has some capacitors, resistors and diodes that are based on the TLIN1027DRQ1 data sheet. I'm not sure if these are really necessary but I included them to be safe and it works well. I used SMT components if available because I had the PCBs assembled by PCBWay. Update november 2023: the hardware-tiny/ PCB can be ordered from JLCPCB.
Note: an alternative for the LIN transceiver is the opto-isolator design used here:
I used the following steps to build the ESPHome firmware, flash it on the device, and add the controller in Home Assistant:
esphome
directory.source venv/bin/activate
).template.yaml
to (for example) lg-livingroom.yaml
and edit the lines marked with XXX
.esphome run lg-livingroom.yaml
to build the firmware and upload it to the device.If you just want to connect to the device to view the debug logs, use esphome logs lg-livingroom.yaml
.
This project is licensed under the 0BSD License. See the LICENSE file for details. This basically means you can use it however you want. Attribution is not required but would be greatly appreciated.