The LG agent brings your LG TV into Homylon. It switches the TV on and off, sets the volume and the input, starts apps, pauses or resumes what is playing, and shows messages from your rules on the screen. It works with most LG webOS TVs from 2018 and later, through the TV's own Network IP Control on your home network. You need to check that for the TV you have. No extra hardware is needed. The TV may even sit on another network than the agent, for example a separate network for your media.
You only give the agent two things that the TV shows you: its keycode and its address. Everything else the agent finds out by itself. It learns the TV's network (MAC) addresses so it can switch the TV on from standby, and when the TV gets a new address the agent finds it again. Switch the TV on once with its own remote while the agent runs, so it can learn.
In your scenes the TV is used like this:
define agent homylonlg address 127.0.0.1 port 55230 protocol udp tv livingtv tv livingtv on volume 20 (input: hdmi2) when remote homylonremote button button1 = clicked then tv livingtv (volume: "+2")
Messages on the TV. A notification can go to the TV as well as to people. It shows at the bottom of the screen for a few seconds while you keep watching. With urgent it is a box that stays until you press OK on the remote:
send notification @"Someone is at the front door" to emma, livingtv send urgent notification @"Water in the cellar!" to livingtv
The first message makes the TV ask on screen whether to allow Homylon: accept it with the remote, and it does not ask again. A TV that is off stays off: the message is not shown. Messages need engine 1.1.1 or later. Is the TV on another network than the agent? Then the agent must reach it on TCP port 3001 as well as 9761.
The agent is a Python program, so there is one Linux download for every machine: a PC or any Raspberry Pi with Python 3.7 or later. It works like the other agents: homylonlg install, homylonlg start, homylonlg boot on and so on. Unpack it into its own folder homylon/agents/lg, without the version number:
mkdir -p ~/homylon/agents/lg cd ~/homylon/agents/lg tar xzf ~/homylon/downloads/homylonlg-*-linux.tar.gz --strip-components=1 ./homylonlg install
Install asks for the TV's keycode and address the first time. The README in the folder tells where to find them on the TV. More about downloading and installing: see the Introduction.
Download here: