Skip to content

LG TV Serial Binding ​

This binding controls LG TVs, monitors and projectors that have an RS-232C control port.

See below for a list of supported channels.

Supported Things ​

Supports one TV, monitor or projector per Thing, also corresponding to a unique serial port. The protocol supports daisy-chaining of serial devices.

This binding supports the following Thing types:

Thing IDDescription
lgtvGeneric LG TV Thing. This Thing should be used when there is no proper Thing defined for your device.
lgtv-LV-seriesThis Thing supports the LED LCD TV models LV and LW except *LV255C, *LV355B, *LV355C
lgtv-LVx55-seriesThis Thing supports the *LV255C, *LV355B, *LV355C models
lgtv-LK-seriesThis Thing supports the LCD TV models LK
lgtv-PW-seriesThis Thing supports the PLASMA TV models PW
lgtv-M6503CThis Thing supports the M6503C monitor

The LG serial command set appears to be similar on many models ([1], [5]), but not all commands will work on all models.

The control port on most TVs is a male DE-9 connector that requires a "Null modem" cable to connect to a serial port or USB to serial adapter.

Some TVs have a 3.5 mm phone jack for the control port instead of a DE-9 connector, and may thus require the use of an adapter cable.

The 3.5 mm phone jack may work with a generic 3.5 mm TRS phone plug to DE-9 cable or possibly LG part # EAD62707901 or EAD62707902 (3.5 mm TRRS to DE-9).

The control port may be marked "Service Only".

Tested and developed with:

  • LG 55UF772V with a generic 3.5 mm TRS phone plug to DE-9 cable
  • LG 47LK520 with a serial hat on a Raspberry Pi

Discovery ​

No discovery supported; manual configuration is required.

Thing Configuration ​

The Thing has the following configuration parameters:

Parameter LabelParameter IDDescriptionAccepted values
Serial PortportSerial port to use for connecting to TV/monitor/projector.Serial port name
Refresh IntervalrefreshIntervalInterval at which updates are pulled from the TV (in seconds).10-65535; default 120
Set IDsetIdSet ID configured in the TV. If 0, will send the commands to every chained TV.0-99; default 1

It is necessary to specify the serial port used for communication. On Linux systems, this will usually be either /dev/ttyS0, /dev/ttyUSB0 or /dev/ttyACM0 (or a higher number than 0 if multiple devices are present). On Windows it will be COM1, COM2, etc.

The Set ID can also be specified when using daisy-chaining. This allows you to have a Thing that will handle a particular device (with Set ID other than 0), and another to send commands to all devices (with Set equals 0). However, the item values for the Thing with Set ID 0 will never display the right values as it receives responses from many devices.

Channels ​

The following channels are common to most TVs, taken from [4].

Channel IDCommandItem TypeDescription
aspect-ratiok cStringAdjust screen format, at least 4:3, 16:9 formats
powerk aSwitchTurns the device on or off
volumek fDimmerSets the volume, values are from 0 to 100
volume-mutek eSwitchSet mute on or off

As for others, please refer to the documentation of your device in the section named "Controlling the multiple product", "External control" or any section that refers to RS-232. If your device documentation doesn't give such information, you can refer to the LG protocol references below and use the "Generic LG TV" Thing which should contain all the different possible channels/commands.

Note: Devices might not respond or return an error to some command when the device is powered off which can put items in an incorrect state until the device is turned on. For instance, getting the volume status when the device is off makes no sense.

All channel type ids ​

Here is the list of all the LG TV commands added to the binding, in channel type id alphabetic order:

Channel IDCommandItem TypeDescription
3dx tStringTo change the 3D mode
3d-extendedx vStringTo change the 3D options
aspect-ratiok cStringTo adjust the screen format
auto-sleepf gSwitchTo set the Auto Sleep function
auto-volumed uSwitchTo set the Auto Volume adjustment function
speakerd vSwitchTo turn the speaker on or off
backlightm gDimmerTo adjust screen backlight
balancek tDimmerTo adjust balance, from 0 to 100
bassk sDimmerTo adjust bass, from 0 to 100
brightnessk hDimmerTo adjust screen brightness, from 0 to 100
colork iDimmerTo adjust screen color, from 0 to 100
color-temperaturek uStringTo adjust the screen color temperature
color-temperature2x uDimmerTo adjust color temperature, from 0 to 100
contrastk gDimmerTo adjust screen contrast, from 0 to 100
dpmf jSwitchTo set the DPM (Display Power Management) function
energy-savingj qStringTo control the energy saving function
fan-fault-checkd wSwitchTo read the Fan fault status of the device
elapsed-timed lStringTo read the elapsed time
h-positionf qDimmerTo set the Horizontal position, from 0 to 100
inputk bStringTo select the current input source for the device
input2x bStringTo select the current input source for the device
ism-methodj pStringTo avoid having a fixed image remain on screen
ir-key-codem cStringTo send an IR remote key code
lamp-fault-checkd pSwitchTo read the lamp fault status of the device
powerk aSwitchTo turn the device on or off
osd-selectk lSwitchTo select OSD (On Screen Display) on or off
osd-languagef iStringTo set the OSD language
natural-moded jSwitchTo assign the Tile Natural mode for Tiling function
picture-moded xStringTo adjust the picture mode
power-indicatorf oSwitchTo set the LED for Power Indicator
power-savingf lSwitchTo set the Power saving mode
screen-mutek dStringTo select screen mute on or off
serial-numberf yStringTo read the serial numbers
software-versionf zStringTo read the software version
sharpnessk kDimmerTo adjust screen sharpness, from 0 to 100
sleep-timef fStringTo set the sleep timer
sound-moded yStringTo adjust the Sound mode
speakerd vSwitchTo turn the speaker on or off
temperature-valued nStringTo read the inside temperature value
tiled dStringTo change the Tile mode
tile-h-positiond eDimmerTo set the Horizontal position, from 0 to 100
tile-h-sized gDimmerTo set the Horizontal size, from 0 to 100
tile-id-setd iDimmerTo assign the Tile ID for Tiling function, 0 to 25
tile-v-positiond fDimmerTo set the Vertical position, from 0 to 100
tile-v-sized hDimmerTo set the Vertical size, from 0 to 100
tintk jDimmerTo adjust screen tint, from 0 to 100
treblek rDimmerTo adjust treble, from 0 to 100
volumek fDimmerTo adjust volume, from 0 to 100
volume-mutek eSwitchTo set mute on or off
v-positionf rDimmerTo set the Vertical position, from 0 to 100
raw (advanced)StringTo send a raw command directly to the device(s)

Not added or linked commands ​

The following commands/channels are not currently implemented in the binding but the commands could be sent via the raw channel.

Channel IDCommandDescription
abnormal-statek zTo read the power off status when in Stand-by mode
auto-configurationj uTo adjust picture position and minimize image shaking automatically. Works only in RGB(PC) mode.
power-on-delayf hTo set the schedule delay when the power is turned on (Unit: second)
remote-lockk mTo turn the Remote Lock on or off. Locks the remote control and the local keys.
resetf kTo execute the Picture, Screen and Factory Reset functions
scheduled-inputf uTo select input source for the TV depending on day
timef aTo set the current time
on-timer-on-offf bTo set the days for the On Timer
off-timer-on-offf cTo set the days for the Off Timer
on-timer-timef dTo set the On Timer
off-timer-timef eTo set the Off Timer
h-sizef sTo set the Horizontal size, from 0 to 100
v-sizef tTo set the Vertical size, from 0 to 100

Using raw channel via rules Example ​

rules

// Rule to toggle the Remote Control Lock mode using a virtual switch item
rule "LGTV Remote Lock toggle"
when
    Item LgRemoteLock received command
then
    // Send raw command to toggle Remote Lock
    // command: km, setId: 01, data: 01/00 (on/off)
    if (receivedCommand == ON) {
        Generic_LG_TV_Raw.sendCommand("km 01 01")
    } else {
        Generic_LG_TV_Raw.sendCommand("km 01 00")
    }
end

LG protocol references ​

[1] Manual for M6503C monitor https://gscs-b2c.lge.com/downloadFile?fileId=KROWM000237239.pdf

[2] https://sites.google.com/site/brendanrobert/projects/bits-and-pieces/lg-tv-hacks

[3] https://code.google.com/archive/p/lg-tv-command/source/default/source

[4] https://github.com/suan/libLGTV_serial

[5] Manual for LV series, LK series, PW series and PZ series https://gscs-b2c.lge.com/downloadFile?fileId=ujpO8yH69djwNZzwuavqpQ

[6] Manual for LD series, LE series, LX series and PK series https://gscs-b2c.lge.com/downloadFile?fileId=76If0tKDLOUizuoXikllgQ