[RELEASE] lgtv-bridge: LG Smart TV (WebOS) Integration [BETA]

I know that there are quite a few SmartApps and releases out there for managing the latest WebOS-based LG smart TVs, but none of them quite worked for me. This is my first attempt at creating any sort of SmartThings integration so it’s very rough around the edges. Anyway, this release really only achieves a couple of things:

  • Power On/Off of an LG smart TV
  • Power status tracking of an LG smart TV, reflected in the status of a virtual switch

It relies on three components:

  • A container running some node.js code which both accepts URL-based requests to control the TV, and monitors the power status of the TV using ICMP (pings). Sadly, I can’t see a way to put this functionality into a SmartApp so it has to remain separate.
  • A virtual switch device in SmartThings.
  • A WebCoRE piston to provide the intelligent link between the container and the virtual switch.

See https://github.com/sOckhamSter/lgtv-bridge for the full readme.

There are plenty of ways to tidy this up and make this more useful, so volunteers are welcome…

1 Like

Hello sOckhamSter,

I’m really interested to put my lg smart tv webos 4.0 working with smartthings, but I don’t know what to do.
I only have the app working in my network lan and lg tv in my lan too.
So at this point I don’t know where and how to install your lgtv-brige.
Can you please explain me? I’m really noob but I really would like to put this working!
Thank you!

Hi, this release isn’t a beginner-friendly implementation really because it assumes a certain level of existing knowledge. Your first thing to investigate is something called Docker and running containers - the lgtv-bridge software is a Docker container, which is to say that’s it’s a bit of software that needs an always-on server running the Docker software. I’d suggest you have a play with Docker and familiarise yourself with that, the easiest way to use Docker in my opinion is on a Synology NAS - it’s click-and-go in most cases, but it can equally run on most computers if you have something lying around to leave on all the time. Once you understand Docker, you are ready to install the lgtv-bridge container. I created it as a container to make it easier to use than if you just decided to run the scripts on node.js manually, but if you would rather do that you can just do that by downloading them from GitHub. Again, that’s even less of a beginner-friendly method. Sadly, I haven’t found a way to get the TV and SmartThings to talk directly to each other without this man-in-the-middle container to do the proper work.

1 Like

Updated to fix a few bugs:

  • Fixed a number of container crashes when the code encounters errors
  • Updated the WebCoRE piston to work a little more efficiently

A note to those running the container on a Windows host, the wake-on-lan functionality within the container does not work unless the container runs in host network mode, which is not possible on Windows. For SmartThings users, the workaround is to change the piston (line 55) to call a “Wake LAN device” command directly on the TV instead of a GET request to the container to do it.

Hi

I’m trying to get this to work using docker/portainer on an openmediavault server but when I click deploy container I get the error “invalid reference format”

Any ideas?

I haven’t yet set this up, but I plan on trying to get this to work with my LG OLED65CXAUA TV. I will be installing docker on a Windows PC. So to turn on the TV, I need to use a “Wake LAN device” task in WebCoRE. Is that added in place of the GET command? So no actual command to the TV is needed, just the wake-on-lan magic packet?

On a different note, I am assuming that a simple GET command directly to the TV to turn the TV on and off wasn’t a possibility? That would be some much easier. I am using GET commands to control my old Pioneer AV receiver and that has been very reliable. I am currently using a setup with a Broadlink IR bridge to send an IR command to the TV and the LG set seems to respond to the Vizio IR code I have programmed into the Broadlink.