GithubHelp home page GithubHelp logo

lgtv's Introduction

LG TV Remote control

Inspired by LGWebOSRemote.

Simple NodeJS scripts to turn a LG TV on and off. Useful when using a LG TV as a monitor.

Requirements;

  • NodeJS 18+
  • NPM 8+
  • LG TV with firmware major version 4, product name "webOSTV 2.0"
  • TV must be on same lan segment
  • Must turn on "TV On With Mobile" setting on TV side to allow remote websocket connections
  • Must know the network IP of your TV (this script does not scan)

Getting started

npm install

Auth

To be able to turn the on the TV you need to get a client key for authentication

# get the IP of the TV and call the auth script
IP=192.168.1.50 npm run auth

Response output example;

Connected to TV, sending register prompt
Accept the TV register prompt
Successfully registered!

 client-key: 67c467bd233806c95dcf2967791a556a
 mac-address: 80:5c:64:2b:3a:b5

Remember the client-key and mac-address for future use.

Turn the TV On

# use the mac address from the auth step
MAC="80:5c:64:2b:3a:b5" npm run on

Turn the TV Off

# use the client key from the auth step
IP=192.168.1.50 CLIENT_KEY=67c467bd233806c95dcf2967791a556a npm run off

License

MIT

lgtv's People

Contributors

savid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.