You'll have to get to a smart tv developers forum to see what interface is supported. I don't know where the LG forum would be but know Samsung has a Developers portal for such work. May have to call LG to see where theirs is.
I've used telnet access to control this TV and was developing a plugin for my home automation gateway when today, the TV just stopped responding to the commands via IP. I can still connect to it on port 9761 like before, but it just doesn't respond to any command and also prints no response. It usually issues an "OK" or "NG" after any command, but now it's not doing anything. I tried to unplug the set for a few minutes, and even lastly did a dreaded factory init and setup the TV all over again. But even after that, it still isn't working anymore via IP. The remote LG Plus android app still works fine. I'm really baffled as to why this just stopped working.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic