LG TV via Serial
The LG TV via Serial integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] lets you control LG TVs by connecting to their RS-232 serial port. By connecting the TV to your Home Assistant server using a serial (RS-232) cable, an ESPHome-based serial proxy, or a USB-to-serial adapter, you get local control of the TV.
Controlling a TV via RS-232 is more reliable and responsive than using the TV’s network or IR interfaces, and it works even when the TV is in standby. It also allows you to control TVs that do not have smart features or network connectivity.
Supported devices
The following devices have been tested with the integration:
- LG OLED55B7A
In general, LG TVs and commercial displays that expose an RS-232C control port (DE-9 connector or, on some sets, a 3.5 mm service jack) are supported.
Most LG TVs sold starting roughly 2008, as well as LG commercial signage displays, include this port. Both the modern (xb) and legacy (kb) input-selection commands are supported, so older sets work too.
Unsupported devices
- LG TVs without a physical RS-232C port. Many entry-level TVs from 2018 onwards dropped the serial port. For those, use the LG webOS Smart TV integration instead.
Prerequisites
- A physical serial connection between your TV and the system running Home Assistant. This can be a direct serial (RS-232) cable, a USB-to-serial adapter, or an ESPHome-based serial proxy.
- LG TVs use a null-modem (cross-over) cable: the TX and RX lines must be swapped.
-
RS-232C Control must be enabled on the TV. On many LG models this option lives in a hidden service (
InStart) menu. Consult your TV’s documentation.
Configuration
To add the LG TV via Serial device to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select LG TV via Serial.
-
Follow the instructions on screen to complete the setup.
The serial port the TV is connected to. This can be a local device path or a remote serial proxy URL. For example, /dev/ttyUSB0 (USB adapter), socket://192.168.1.100:2000 (network proxy), or socket://esphome-device.local:6638 (ESPHome).
Supported functionality
The integration adds a single media player entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] for the TV.
Media player
For supported TVs, you can use Home Assistant to:
- Turn the TV on and off.
- Change the volume and step it up or down.
- Mute and unmute the TV.
- Select the input source.
Data updates
LG TVs do not report changes on their own over RS-232, so Home Assistant pollsData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] the TV every 5 seconds for its power state, input source, volume, and mute state. Changes made with the TV’s own remote are picked up at the next poll.
While the TV is in standby it only answers the power query. Other attributes, such as volume and input source, are populated once the TV is on.
Automation examples
The real power of this integration is tying the TV into the rest of your home.
You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.
Turn the TV off when everyone leaves home
automation:
- alias: "Turn off the living room TV when away"
triggers:
- trigger: state
entity_id: zone.home
to: "0"
actions:
- action: media_player.turn_off
target:
entity_id: media_player.lg_tv
Switch to the HDMI input when starting movie night
automation:
- alias: "Movie night switches the TV to HDMI 1"
triggers:
- trigger: state
entity_id: input_boolean.movie_night
to: "on"
actions:
- action: media_player.turn_on
target:
entity_id: media_player.lg_tv
- action: media_player.select_source
target:
entity_id: media_player.lg_tv
data:
source: "HDMI 1"
Known limitations
- Many LG TVs ignore the power-on command over RS-232 while the set is in standby. If turning the TV on does not work, you might have to disable a power saving mode.
- Different LG models support different subsets of the RS-232 command set, so some input sources may not be selectable on every TV.
- If the TV is configured to route audio to an external output (such as optical or HDMI ARC) instead of the TV speakers, the volume controls are not shown for the media player.
Troubleshooting
Can’t set up the device
Symptom: “Failed to connect”
When trying to set up the integration, the form shows the message “Failed to connect”.
Description
Home Assistant could not communicate with the TV over the serial port.
Resolution
To resolve this issue, try the following steps:
- Make sure the TV is powered on. The TV must be on for the initial connection.
- Make sure RS-232C Control is enabled in the TV’s service menu.
- Verify the cable is a null-modem (cross-over) cable and is fully seated. LG’s RS-232 jack is recessed, so push the plug in until it clicks.
- Confirm the correct serial port was selected, and that no other software is using it.
- If you use multiple daisy-chained TVs, confirm the set ID matches the one configured on the TV.
The TV becomes unavailable
If the serial connection is lost, the entity becomes unavailable and Home Assistant automatically reconnects. Check the cable and, for network serial proxies, the network connection between Home Assistant and the proxy.
Removing the integration
This integration follows standard integration removal. No extra steps are required.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three dots
menu. Then, select Delete.