hubitat

LGTV with webOS

Hubitat driver to control LG TV devices using webOS websockets.

Tested devices:

Installation

There are two ways to install the drivers: using Hubitat Package Manager (HPM) or manually importing the driver code.

HPM is an app that allows you to easily install and update custom drivers and apps on your Hubitat hub. To use HPM, you need to have it installed on your hub first.

Once you have HPM installed, follow these steps to install the “LGTV with webOS” driver:

  1. In the Hubitat interface, go to Apps and select Hubitat Package Manager.
  2. Select Install, then Search by Keywords.
  3. Enter LGTV in the search box and click Next.
  4. Select LGTV with webOS by Dan Danache and click Next.
  5. Follow the install instructions.

Manual Installation

If you prefer not to use HPM, you can manually install the drivers by importing the driver code from GitHub:

  1. In the Hubitat interface, go to Drivers Code.
  2. Click Add driver, then select Import from the hamburger menu in the top right.
  3. Enter https://raw.githubusercontent.com/dan-danache/hubitat/main/lgtv-drivers/lgtv-with-webos.groovy it in the URL field.
  4. Click Import, then click OK and the code should load in the editor.
  5. Click Save in the top right.

For more information on installing custom drivers, refer to the Official Documentation.

Create Devices

Follow these steps to create a new LG TV device:

Configure IP address

  1. Open your router’s admin interface and set a static DHCP lease for your TV devices to ensure they always have the same IP addresses on your LAN.

  2. Ensure the TV and the Hubitat hub are on the same subnet for Wake-On-LAN functionality to work.

Configure TV

  1. Ensure you are near your TV device, as this cannot be done remotely.
  2. Power on the TV and open the TV settings.
  3. Find and disable the Always Ready option (for OLED screens).
  4. Enable the Network IP Control option.
  5. Keep TV on for the following steps.

Add device

  1. In the Hubitat interface, go to Devices.
  2. Click Add device, then select Virtual.
  3. Select LGTV with webOS from the drivers list, then click Next.
  4. Name your device (e.g., Livingroom TV), select a room, then click Next.
  5. Click View device details to go to the device page.
  6. Select the Preferences tab.
  7. Enter the TV IP address, then click Save.
  8. Approve the notification that appears on your TV screen.
  9. A toast notification should appear briefly on your TV screen saying Well done! Configuration is now complete.
  10. Select the Commands tab, then refresh the browser page to reload the attributes list.
  11. If the Current States section does not populate with multiple attributes, check the Hubitat logs for clues. Debug messages are displayed for 30 minutes, then the log level automatically switches to Info.

TV Attributes

Device Data

Control options

The following commands are available:

Power control

Sound volume control

Live TV channel control

Screen control

App control

Notifications

Notes

Wake On LAN

When the TV is first paired with the Hubitat, the driver will attempt to auto-enable the Wake-On-LAN (WOL) settings on your TV.

Detect TV start

When the TV is turned on using its remote, it does not broadcast any message to the LAN. To overcome this, the driver pings the TV’s IP address at the frequency set in the Preferences tab. The default ping interval is 5 minutes, so it can take up to 5 minutes for the driver to detect that the TV was turned on.

Have fun!


Buy Me A Coffee