Git Product home page Git Product logo

lgtv2's People

Contributors

emontnemery avatar forty2 avatar germanbluefox avatar hobbyquaker avatar merdok avatar msloth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lgtv2's Issues

Send screen off while playing music

Is it possible to send a command to turn the TV screen off while leaving the music playing. There is a option on the TV to turn screen off while keeping the TV running. However, it is buried in menus and it is much more convenient to trigger it through node.

Device pairing one time only

Hey, I have 2 questions about usage of this project.

  1. In repo README, you have asked to configure TV settings
    You need to allow "LG Connect Apps" on your TV - see http://www.lg.com/uk/support/product-help/CT00008334-1437131798537-others
    But the link does not open specific issue solution, it just lands on main support page.

  2. I was able to connect to the TV using your repo.
    Now the issues is : I have to allow pairing from TV every time TV starts. So, is there a way using which, the device gets paired once and does not need to be allowed every time?
    Please guide me.

Thanks!

I cant not connect to LG TV i want to develop the remote control app.

events.js:174
throw er; // Unhandled 'error' event
^

Error: getaddrinfo ENOTFOUND lgwebostv lgwebostv:8000
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
Emitted 'error' event at:
at WebSocketClient. (/var/www/html/lgtv2/node_modules/lgtv2/index.js:82:18)
at WebSocketClient.emit (events.js:189:13)
at ClientRequest.handleRequestError (/var/www/html/lgtv2/node_modules/websocket/lib/WebSocketClient.js:227:14)
at ClientRequest.emit (events.js:189:13)
at TLSSocket.socketErrorListener (_http_client.js:392:9)
at TLSSocket.emit (events.js:189:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)

Question

When I connect to my LGTV from my laptop (Windows 10) on WiFi, it asks me once to allow pairing, and then the API works. I can restart node over and over and I'm not asked to pair again.

When I connect from a machine on ethernet (Ubuntu), I'm asked to pair (by the TV) every time I restart node.

Any ideas?

enable multiview app on lg webos 3.0 tv

Hi,

I have LG 55LH600T (web os 3.0 based) TV. In my TV , multi-view app is not enabled.
How can I enable / install multi-view app and use multi-view feature using lgtv2?

Question about 3D

you have implemented 3DOn and 3DOff.

Does 3DOn just take whatever state you had left 3D with before, such as left/Right or Top/Bottom?

system.launcher/launch app id

I have successfully managed to get any app id (Sky, Netflix, Prime, Disney+) with:

lgtv.request('ssap://com.webos.applicationManager/listApps', function(err,res) { console.log(res); });

Is there a way to retrieve information about the current stream, such as title or runtime, from any of the above apps?

Is there a complete list of possible commands somewhere?

I'm receiving an LG CX 48" soon and would like to control some things on it with this project. However, I tried googling for a list of commands and just can't seem to find one that is any more comprehensive.

Is there a full list of supported commands somewhere or do I have to send button inputs in sequence if I want to for example change picture preset or toggle OLED motion?

Q: Delay between TV on and websocket ready for connect ?

Hi, curious if anyone with an LG TV is observing very long delays (10-15s) before the LG TV websocket is available for connection after the TV is powered on? I have an 2017 OLED65E7 webos3.7

I have a written a very small bash script using netcat to detect when ws is ready for connection and will stop when netcat connects to LG ws. I've executed it many times, and my LG ws is only ready after 10-15sec.

wakeonlan [LG mac addr];./checkport.sh

checkport.sh

#!/bin/bash
time=0;
result=1;
while [ $result -ne 0 ]; do
nc -z -w1 [LG IP] 3000;

if [ $? -eq 0 ]; then
let result=0;
fi

echo Port: $? Time: $time;

sleep 1;
((time++));

done

Thanks for an insight/info !

how to pairing the tv

hello,

i try to use your module but when i try exemple (with good ip) i take systematically an error connexion refused.
could you help me ?

best regards

Unable to connect after recent LGTV software update <solved>

lgtv2 can no longer connect to the LG TV on port 3000 after a recent firmware upgrade of the TVs webOS.
Also the menu entry "LG Connect Apps" is no longer present :(

Can anyone confirm this?

webOS TV NANO916NA


UPDATE: Fixed by changing connection string to use secure socket on port 3001: wss://LGwebOSTV:3001
and adding wsconfig parameters: tlsOptions: {rejectUnauthorized: false}

Full API documentation?

Hello, I would like to see the full documentation of the API. Where can I find it? Thank you!

switchInput example

Hi,

Create project! I would like to use switchInput to change the hdmi, but can't seem to find the right command. Could you please give an example on how to use this command? I've found some other sources that use the same api, but no official documentation. Do you have a link for that as well?

Thanks!

Roy

How do I open an URL from a web hosted app into the television's browser?

I am developing a web hosted app. I need to open an internet page inside that app in a way that I see the cursor and I can move it around the page and click on buttons, using the regular remote control.

I don't see a way to enable the cursor and make it move as I click on the remote arrows, as it does in the internet browser that comes with the tv.

So, I need one of two things:

  1. a way to launch a specific URL from the app and make that URL open on the television's browser or
  2. enable the cursor inside the app in a way that it moves as I press the remote arrows. The app is running inside chromium engine, right? So, the cursor must be disabled. Any way to enable it?

thanks

Webostv.command and youtube

hi guys i've been trying to get the YouTube app to open from the webostv.command service for two days. do you know what his 'id' is?
I can open Netflix but not YouTube from home assistant. Thank you all

Support "Screen Mute" functionality

Does this library have a way to send the "screen mute" command?

I see that requests are sent with a uri and payload as per:

lgtv2/index.js

Lines 186 to 188 in d58f870

this.request = function (uri, payload, cb) {
this.send('request', uri, payload, cb);
};

I'm trying to make a change to homebridge-webos (which uses this library) to turn off the screen only (different than powering off the tv). This is useful to listen to music while the display is off.

I've managed to connect to my TV over IP with Telnet and sent the command SCREEN_MUTE screenmuteon which keeps the TV on but turns off the screen. There's also a menu option under power settings called "screen off" that I think is doing the same thing.

In homebridge-webos there is a list of URIs in the form ssap://system/turnOff:

https://github.com/merdok/homebridge-webos-tv/blob/28befc4304ec943528bfdeae88e2c33737862a1b/lib/LgTvController.js#L16-L57

Is there documentation on all of the URIs? There may be a command to send SCREEN_MUTE but I don't know what the URI or parameters would be. Any pointers would be helpful.

A question about Energy Saving control

I have a question:
Would it be possible to control energy saving mode (Off, Low, Mid, High, Screen off) in a LG TV (SJ8000), running WebOS 3.7.0?
Thanks for your clarification.

eArc Connected Sound Bar Volume

It seem as though when an eArc sound bar is connected to the tv I'm unable to control its volume, aside from mute.
When the sound bar is not connected though I'm able to control as expected.

Client connection gets stuck forever

If you disconnect the LG TV from the power supply and then switch it on again, there is a small time window during the boot-up sequence where a TCP connection can be established. Approx. 7 seconds. If the LGTV2 client establishes the connection to the LG TV exactly during this time, the client hangs forever and blocks any further processes.

Do you have an idea or a workaround to prevent this?

You can test it by pinging the TV during boot-up. If the server responds, try to establish a connection with your LGTV2 client.
Important: Before disconnecting the LG TV from the power supply, switch off the TV with the remote control and wait 10 minutes until the pixel cleaning process has been completed. This process runs in the background after switching off the TV.

(Windows ping)
c:\>ping 192.168.1.70 -t

Pinging 192.168.1.70 with 32 bytes of data:
Reply from 192.168.1.10: Destination host unreachable. <--- Boot up LGTV
Reply from 192.168.1.10: Destination host unreachable.
Reply from 192.168.1.10: Destination host unreachable.
Reply from 192.168.1.10: Destination host unreachable.
Reply from 192.168.1.10: Destination host unreachable.
Reply from 192.168.1.10: Destination host unreachable.
Reply from 192.168.1.10: Destination host unreachable.
Reply from 192.168.1.70: bytes=32 time=5ms TTL=63 <--- Connect here
Reply from 192.168.1.70: bytes=32 time=4ms TTL=63
Reply from 192.168.1.70: bytes=32 time=5ms TTL=63
Reply from 192.168.1.70: bytes=32 time=5ms TTL=63
Reply from 192.168.1.70: bytes=32 time=5ms TTL=63
Reply from 192.168.1.70: bytes=32 time=5ms TTL=63
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.1.10: Destination host unreachable.
Reply from 192.168.1.10: Destination host unreachable.
Reply from 192.168.1.10: Destination host unreachable.

TypeError: Arguments to path.join must be strings

Hi there,

I have an issue running this on my Synology NAS. Wondering if you could help me solve the problem.

When I run my code locally, for example;

        var lgtv = require('lgtv2')({
        url: 'ws://192.168.178.31:3000'
    });

    lgtv.on('error', function(err) {
        console.log(err);
    });

    lgtv.on('connect', function() {
        console.log('connected');
        lgtv.request('ssap://system/turnOff', function(err, res) {
            lgtv.disconnect();
        });

    });

It run's fine. However, the same code, deployed to my Synology NAS, results in an error.

TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at exports.join (path.js:358:36)
at module.exports (/volume1/web/NodeJS/node_modules/persist-path/index.js:19:22)
at new LGTV (/volume1/web/NodeJS/node_modules/lgtv2/index.js:47:16)
at LGTV (/volume1/web/NodeJS/node_modules/lgtv2/index.js:38:16)
at Object.module.exports.setNetflix (/volume1/web/NodeJS/controllers/tv.js:50:36)
at /volume1/web/NodeJS/routes/routes.js:43:12
at Layer.handle [as handle_request] (/volume1/web/NodeJS/node_modules/express/lib/router/layer.js:95:5)
at next (/volume1/web/NodeJS/node_modules/express/lib/router/route.js:137:13)

The only actual difference I can spot is the NPM version, which is v10.14.1 locally and v0.10.48 on my NAS. Is there any way to bypass this problem and get this working?

WebOS 4 - port 3000 is closed

I can’t connect to my LG tv.
Scanning the opened ports, it seems that the 3000 is closed,
And there is no open port for the WebSocket

Developer Mode?

Hi,
There is any way to get to developer mode/service mode?

I want to change region

view the pause status?

Hi, is there a way to receive the pause status of the tv? for example if the viewer has put the netflix, youtube or plex in pause?

new WebOS 04.70.50 is always asking "CONNECTION REQUEST" YES / NO

Everything was running fine with WebOS 04.70.35.
Start Browser, open a Website and Switch TV off (see ct "Smart-TV eingespannt").
But my TV made an update to 04.70.50. After that TV is asking at each command YES or NO. I have to confirm this by remote control. LG said it is not possible to restore the old firmware.
I think the pairing function is changed in new firmware.
Do anyone help?

turnOff command switches TV on when LAN port still awake

If you turn your TV off with the remote and then send the system/turnOff command within the first minute or so, the TV switches back on.
Seems like the LAN port is still accepting connections at that point.
This won't happen if you wait a bit longer. Then a WOL is needed to switch on the TV.

This issue is in a way related to #12

Any idea on how to prevent this?

Can't get app icons from TV

When you send a "ssap://com.webos.applicationManager/listApps" request to TV, it gives you an array of all apps which contains URLs of icons too. But what is very interesting to me is that none of these links work! They are all dead links.
I tried to sniff into my phone's LG TV Plus traffic to see how it gets app icons from TV, but no luck!
Can someone help me with this?

Thanks.


Edit: Sorry, the solution was to use "listLaunchPoints" instead of "listApps".

pin code paring

i would like to pair using a pin code that is shown in a popup instead of needing to click yes to the popup

It works but in a function doesn't work...why?

This does not work!

addr="10.42.0.235";
lgtv=require("lgtv2")({url: 'ws://' + addr + ':3000'});  
lgtv.on('connect', function () {
    console.log('connected');
    lgtv.request('ssap://audio/setVolume','{"volume": 0}', function (err, res) {
        console.log(res,err);
        lgtv.disconnect();
        process.exit(1);
    });
    
});

This works:

addr="lgtv";  //lgtv = 10.42.0.235 in /etc/hosts
lgtv=require("lgtv2")({url: 'ws://' + addr + ':3000'});  
lgtv.on('connect', function () {
    console.log('connected');
    lgtv.request('ssap://audio/setVolume','{"volume": 0}', function (err, res) {
        console.log(res,err);
        lgtv.disconnect();
        process.exit(1);
    });
    
});

Reliable way to determine the TV's power status (on/off)?

Just wondering if you know of a good way to check this? Might be a good feature to add.

I've tried various endpoints through the websocket but it responds happily to them even when the TV is off. I also tried sending ICMP packets to see if it would reject them when off but no luck.

Any ideas?

Open Web Browser on specific website

Hello.

I've successfully managed to connect to my Web OS TV and I can open the web browser. Is it possible to open the web browser on a specific website?

Thanks in advance

saveKey throws deprecation warning

In that.saveKey(), you call writeFile() without a callback. Node complains about it.

Maybe you want to call writeFileSync() ?
Or provide a default cb that does nothing.

Cheers

I think it's on line 140.

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.