LG WebOS - Stopped Working

Brought home brand new OLED C2 to replace OLED C8. Yes burn-in is a real thing.

I went to add the NEW LG and initially it was found in the designer (windows). While setting up the TV, ran the firmware update. because i needed to delete my old TV and forgot, I started over. I tried to add the TV again, and get no response on the TV (like usually it would say a mobile device is trying to connect), within the designer i get “unable to connect to the remote server”.

Read on another blog LG mad a change to block unsecured websockets.

LG WebOS better integration - Apps - Homey Community Forum
“A connection to port 3000 (ws://) was blocked. Connections to port 3001 (wss://) are successful and I was able to register, send requests and subscribe to events.”

Running 03.30.67 software version on the TV (latest version)
Web OS 7.3.0-2403 (mullet-mebbin)

Note that other apps (download for ios to test were able to connect)

Bump.

Update: the TV responds to WOL magic packet. Port scanner found port 3000 blocked, confirmed secure port 3001 open, https://IP:3001 returned “hello world”.

Bill, any thoughts on a patch?

if for some reason Bill can’t/won’t make a patch available, it would be pretty easy to create a port forwarder if you have an intermediate system at your disposal. Something running a light-weight linux distro would be optimal, like an RPI or NAS, but any always-on system could be made to work. You would point THR to it, then it would forward the unfiltered packets to TCP 3001 on the TV.

This is going to require a patch. THR is using a fixed value of 3000.

No luck trying to port forward in my router or UniFi access points.

Will revert back to
PowerOn: Wake on Lan plug-in (working)
PowerOff: Global Cache (waiting on Amazon delivery)

Anyone able to interface webOS with Global Cache? Netflix?

Not sure how you set up your router / APs (I also use Ubiquiti products) but If the source and destination are on the same subnet, I think the traffic would go directly to the host vs through the firewall.

what you might try as a test is setting up a python script on a PC (or Mac, whichever you use) on the same segment to listen on port 3000 and then just forward to 3001 on your TV.

Here’s an example: GitHub - supernifty/port-forwarder: Simple Python scripts to listen, log and forward network traffic (I’ve not tried it myself; YMMV)

@LJR, thanks. Downloaded, installed python 3.11, script didn’t run (threw errors on ‘thread’ call). Turns out it is a Python 2 script. Installed python 2.7, got to run…no luck. While running the forwarder, I launched new instance of THR, new project, add device, “unable to connect to remote server”. Guess just need to wait until Bill is able to fix.

Well if you’re not against getting a little more creative with a solution that will give you A LOT of versatility, I just checked and Node Red has an integration module for LG TVs: node-red-contrib-lgtv (node) - Node-RED

I have been successfully using Node Red for years to overcome all sort of limitations/obstacles with THR and it has helped also to offload polling and state management from the THR client (with help from MQTT which THR supports very nicely).

If you are open to giving it a shot, reach out to me and let me know what features you would want support for. I can then help by writing a basic custom plugin that would talk to Node Red as the middle-man, or how to leverage MQTT in Node Red and THR.

I’m attaching a sample of how I integrated Node Red with my Bluesound Node.

Node Red - Bluesound.txt (7.1 KB)

@LJR, Ok, installed Node-Red, got up and running on my laptop. downloaded node-red package, tried to import the json file, no luck. throws a flag on import. “Input not a JSON Array”. I was able to import your Bluesound file.

What i’m looking for:
Power On (currently handling with a WOL plugin in THR)
Power Off (discrete)
Input Select:
HDMI2
Netflix
disney+
Paramount+
Hulu
etc.

Hopefully this gets you on track (this is not tested and my ability to troubleshoot will be limited, but perhaps others have a LG TV and could help on the plugin/Node Red development side.

  1. change extrnsion from .txt to .zip
  2. extract files
  3. Import .json flow
    a) conflgure your TVOS device
  4. use *.plugin in THR
    a) be sure to supply correct IP of the system where Node Red is installed

LGTV_PoC.txt (1.6 KB)

got it. imports for both work. could you send me a simple. hrp file with a button for power on and one for power off. i should be able to take from there.

1 Like

I have a brand new LG G3. Everything work,s fine, with the existing official plugin, except for Power on. I solved it, with codeset 1 from Global cachè tower, and then use IR for ON. I then think it will be possible to get a label, from the plug in. It will show when the TV is ON.

I have downloaded your POC and added the plugin. I updated the IP address both in the plugin and in the NodeRedTVOS. What TvosNodeRed.? Command should I use? MediaCommand? I tried TvosNodeRed.switch with value = On and it did not work.

Anything else should I do?

How did you get his plug in working? I changed the IP address and set up a mediaCommand. Could not get it to work.

I was unable to get the plug in working. I ended up going the global cache WF2SL route.

Solution link:

Global Cache WF2SL

The only downside is that it operates at the serial command level, and not the webOS level. So no direct commands for say Netflix, or AmazonPrime.

For me the official LG smart TV plug in, by Bill, is now working totally. Both discrete ON and OFf, The trick was to turn on “ let mobile device be used as remote”. Actually I can also go directly to the apps. Netflix, Live TV and the other in the “List” command. I have a LG G3 2023.

Have you done any firmware updates? Which firmware are you running? Can you do a port scan?

If you type the tv IP into browser with port 3000, what does it return?

Http://:3000

I am not a programmer but I typed

192.168.50.151:3000 and got the response “Hi world” so I assume the port is open. When I did the same with :3001 it failed.

The firmware are 03.11.30

So I’ve found a work-around with the Hubitat.

Follow these instructions to add the LG WebOS TV to the hubitat:
dan-danache/hubitat

Make sure to enable “Simulate TV Remote” in the preferences (once the device is created), this will create a child device, but you wont need to do anything with it.

Add the hubitat (if you dont already have it), and if you do, syncronize. you need to add the LG WebOS TV device to the maker API to expose that device to the home remote. make sure you have Allow access via remote/cloud in the Maker API app in the Hubitat.

In that same window you’ll find the access token and the Hub ID (which is in the cloud URL)

Then in the Home Remote, click on the LG WebOS (the name you gave the device) and add “Command” to the Capabilities list.

Then add a button, EventTrigger, Action, Collection, DataSetter. Bind to LGWebOSDevice.Command

Value = ‘command’

From ChatGPT:

A) Every Maker API command your LG device exposes (ID 432)

No-parameter commands

Use the value exactly as shown:

  • on
  • off
  • refresh
  • initialize
  • mute
  • unmute
  • volumeUp
  • volumeDown
  • channelUp
  • channelDown
  • play
  • pause
  • stop
  • screenOn
  • screenOff
  • screenSaverOn
  • screenSaverOff
  • take (snapshot / image capture)
  • getAllActivities
  • getCurrentActivity

1-parameter commands

Format: commandName/PARAM

  • Set volume (0–100): setVolume/15
  • Set channel: setChannel/5
  • Ping interval (minutes, 0 disables): setPingInterval/5
  • Sound output (one of the enums below): setSoundOutput/external_arc
  • Start an activity/app (exact activity name or appId): startActivity/Netflix
  • Open a web page (URL-encode the URL):
    startWebPage/https%3A%2F%2Fexample.com
  • Play a video URL (URL-encode the URL):
    startVideo/https%3A%2F%2Fexample.com%2Fvideo.mp4
  • Speak text (URL-encode spaces etc.):
    speak/Hello%20world

2-parameter commands

Device notification: deviceNotification/TEXT/TYPE

You can safely use Toast or Alert for TYPE (avoid the longer strings with spaces):

  • Toast example:
    deviceNotification/Hello%20there/Toast
  • Alert example:
    deviceNotification/Important%21/Alert

5-parameter command (picture settings)

setPicture/BRIGHTNESS/CONTRAST/COLOR/BACKLIGHT/MODE

You can provide all 5, or just the first N params (Hubitat typically lets you omit trailing params):

  • Brightness only: setPicture/50
  • Brightness + contrast: setPicture/50/90
  • Full example: setPicture/50/95/55/88/sports

Picture modes:
cinema, eco, expert1, expert2, game, normal, photo, sports, technicolor, vivid, hdrEffect, filmMaker, hdrCinema

Sound outputs:
tv_speaker, external_arc, external_optical, bt_soundbar, mobile_phone, lineout, headphone, tv_speaker_bluetooth

B) Every “remote button” possible (via pushRemoteButtons/...)

How to send one button

pushRemoteButtons/BUTTON

Example:

  • pushRemoteButtons/HOME

How to send sequences + delays

Use spaces encoded as %20:

  • pushRemoteButtons/HOME%20WAIT:500%20RIGHT%20RIGHT%20ENTER

WAIT:xxx is milliseconds.

Full list of supported BUTTON names

You can use any of these inside pushRemoteButtons/...:

Directional / OK:

  • LEFT, RIGHT, UP, DOWN, ENTER

Navigation / system:

  • HOME, BACK, EXIT, MENU, QMENU, INFO, GUIDE, PROGRAM, INPUT_HUB, MYAPPS, RECENT, LIST
  • POWER, MUTE

Playback:

  • PLAY, PAUSE, STOP, REWIND, FASTFORWARD, RECORD

Channel / volume (remote-style buttons):

  • CHANNELUP, CHANNELDOWN, VOLUMEUP, VOLUMEDOWN

Color buttons:

  • RED, GREEN, YELLOW, BLUE

App buttons:

  • NETFLIX, AMAZON

Other:

  • ASTERISK, DASH, CC, AD, SAP
  • ASPECT_RATIO, SCREEN_REMOTE
  • LIVE_ZOOM, MAGNIFIER_ZOOM
  • TELETEXT, TEXTOPTION
  • Digits: 0 1 2 3 4 5 6 7 8 9
  • 3D_MODE

I’ll try and put together a sample .hrp file.

1 Like