Well, I have some bad news… the SmartThings framework doesn’t support the usage of WebSockets… which is the only way to control the current generation of LG TVs that I have found. I’ve researched it extensively and there does not appear to be another way to control the newer generation of LG TVs. There is also no way to have this work with SmartThings without additional hardware. Unfortunately, that makes this a lot more complicated.
Having said that, I am currently working on node.js implementations for each of the following TV protocols:
Sony Bravia TVs
LG Smart TV UDAP 2.0 (Netcast)
LG Web OS TVs
Vizio TVs (not sure on specific protocol yet - but I have a 2018/2019 model TV that I will be working on)
There are some node.js implementations that already exist, but they aren’t quite what I am looking for. I’ll write independent implementations for each TV, then I’ll write an HTTP server on top of it and finally a new Device Handler that can be used for each of those TV types. The Device Handler will be written generically, so it should be easy to add support for additional TV protocols by adding them underneath the HTTP server.
I am planning on testing this on a Raspberry Pi 4, but it would all theoretically be able to be ran on any system that can run node.js. I’ll make this as easy to implement as possible - but there will be some hardware costs with buying a Raspberry Pi. I’ve already tested out a proof of concept and it looks promising. This would ultimately allow us to control just about any variation of TVs out there that support some type of external control. I’ll keep the group posted - but this is probably a several month effort to get done.