A Node.js module to remotely control LG WebOS smart TVs via WebSocket.
LGTV2 is a Node.js module that allows developers to control LG WebOS smart TVs programmatically. It connects to the TV via WebSocket and provides an API to send commands, subscribe to events, and automate TV functions like power, volume, app launching, and media playback.
Developers building home automation systems, IoT projects, or integrations that require remote control of LG WebOS TVs, such as with Node-RED, Homebridge, or MQTT-based setups.
It offers a straightforward, event-driven interface specifically for LG WebOS TVs, with support for real-time subscriptions and custom authentication, making it a reliable choice for automation scenarios over proprietary apps.
Control LG WebOS TV using node.js :tv:
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a straightforward Node.js interface for sending commands like turning off the TV or adjusting volume, as demonstrated in the concise usage examples with minimal boilerplate code.
Enables subscribing to TV events such as volume changes via WebSocket, allowing responsive automation without polling, as shown in the subscription example for audio updates.
Integrates seamlessly with popular platforms like Node-RED, MQTT, and Homebridge, as listed in the 'Projects using this Module' section, making it ideal for IoT setups.
Supports custom key storage and authentication methods through options like saveKey and clientKey, providing flexibility for persistent connections in diverse environments.
Only compatible with LG WebOS TVs, limiting its use in multi-brand smart home systems where control across different TV manufacturers is needed.
The README warns that v1.4.0 changed the keyFile location, requiring re-authorization on the TV, which can disrupt existing deployments and add maintenance overhead.
Users must enable 'LG Connect Apps' on the TV beforehand, adding a non-trivial setup step that might confuse less technical users or in automated deployments.
Relies on WebSocket connections over the network, so control can fail if the TV is offline or experiences network instability, with error handling that may require custom logic.