GithubHelp home page GithubHelp logo

klattimer / lgwebosremote Goto Github PK

View Code? Open in Web Editor NEW
498.0 498.0 97.0 191 KB

Command line webOS remote for LGTVs

License: MIT License

Python 100.00%
lg python python3 smart-tv smarthome webos websockets

lgwebosremote's People

Contributors

balcsida avatar barak avatar binozo avatar burnee avatar c0rn3j avatar cbirchinger avatar chron0 avatar clougyy avatar clownbreath avatar darkceptor44 avatar dependabot[bot] avatar dominicvonk avatar drewx2 avatar eudes avatar gravmatt avatar gustry avatar harveyrandall avatar icebotyt avatar ilikeplayinggames avatar itay-sharoni avatar jaklan avatar jjc1138 avatar keyofblues avatar klattimer avatar luckyman76489 avatar microraptor avatar nopdotcom avatar tenzer avatar tonycassara avatar tykus160 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  avatar  avatar

lgwebosremote's Issues

RuntimeError: cannot join current thread

I assume you are running in a python 3.x environment, since
python -m venv lgtv-venv looks 3.x, in 2.x this has to be used: virtualenv lgtv-venv

My Environment is Python 3.8.2 in Ubuntu 20.04
the first error occured whille running pip install git+https://github.com/klattimer/LGWebOSRemote:

error: invalid command 'bdist_wheel'

so I added pip install wheel just after activating the virtual environment.
I was able to scan and auth, but issiong a swInfo command failed:

AttributeError: 'str' object has no attribute 'decode'

This issue was already fixed (issue an MR still open) and did work for me.

But I got another error:

lgtv MyTV swInfo
DEBUG:root:Initiating handshake
DEBUG:root:Received response
DEBUG:root:{"type":"registered","id":"register_0","payload":{"client-key":"b3ed4708d529f0e69f1d6f81f69f2240"}}
DEBUG:root:Handshake complete
DEBUG:root:{'id': 'sw_info_0', 'type': 'request', 'uri': 'ssap://com.webos.service.update/getCurrentSWInformation'}
{"closing": {"code": 1006, "reason": "Going away"}}
Exception in thread WebSocketClient:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "./lgtv-venv/lib/python3.8/site-packages/ws4py/websocket.py", line 528, in run
if not self.once():
File "./lgtv-venv/lib/python3.8/site-packages/ws4py/websocket.py", line 410, in once
if not self.process(self.buf[:requested]):
File "./lgtv-venv/lib/python3.8/site-packages/ws4py/websocket.py", line 480, in process
self.received_message(s.message)
File "./lgtv-venv/lib/python3.8/site-packages/LGTV/remote.py", line 95, in received_message
self.__waiting_callback(json.loads(str(response)))
File "./lgtv-venv/lib/python3.8/site-packages/LGTV/remote.py", line 104, in __handshake
self.__execute()
File "./lgtv-venv/lib/python3.8/site-packages/LGTV/remote.py", line 115, in __execute
self.__waitClose()
File "./lgtv-venv/lib/python3.8/site-packages/LGTV/remote.py", line 118, in __waitClose
self._th.join(timeout=1)
File "/usr/lib/python3.8/threading.py", line 1008, in join
raise RuntimeError("cannot join current thread")

I think there is some auzhentication failure, but I found a rather old installation, in a python 2.7.16 environment, against commit 130e619 which is still working

$ lgtv swInfo
{"type": "response", "id": "sw_info_0", "payload": {"auth_flag": "N", "minor_ver": "80.50", "country": "DE", "sw_type": "FIRMWARE", "major_ver": "05", "ignore_disable": "N", "eco_info": "01", "model_name": "HE_DTV_W17P_AFADABAA", "config_key": "00", "returnValue": true, "language_code": "de-DE", "device_id": "78:5d:c8:54:21:d4", "product_name": "webOSTV 3.5", "country_group": "EU"}}
{"closing": {"reason": "", "code": 1000}}

unfortunately this version lacks multiple screen support...

Send media (audio/video) via DLNA

Hey there,

Curious if there is a way to utilize this app to send media (audio/video) to the TV via DLNA, similar to the YouTube example.

That would be awesome!

I messed up something...

Hey,

i messed up something something... πŸ˜…

When i try to run lgtv scan:

timed out
timed out
timed out

$ cat ~/.lgtv.json

cat: /home/pi/.lgtv.json: No such file or directory

But lgtv on and lgtv off are working fine πŸ€”

But when i run lgtv mute or other command i get

Traceback (most recent call last):
File "/usr/local/bin/lgtv", line 11, in
load_entry_point('LGTV==0.1.2', 'console_scripts', 'lgtv')()
File "build/bdist.linux-armv7l/egg/LGTV/main.py", line 86, in main
File "build/bdist.linux-armv7l/egg/LGTV/init.py", line 225, in init
TypeError: cannot concatenate 'str' and 'NoneType' objects

Using Raspberry Pi 3 B+ with Raspbian Buster

In which way i can use the "auth" command??

i'm trying to control my tv, but command "auth" don't work. (i try "python lgtv.py auth" or "python lgtv.py auth ipaddress", or create the json file manually, but nothing)

Socket Timeout Error When Using Scan Command

The command lgtv scan is causing a Socket Timeout error almost instantly which makes me think the timeout might be set to one second or less or it's a different cause I don't really know.
Anyway the full error is:

Traceback (most recent call last):
  File "H:\Programacao\Python\lgtv-os\lgtv-venv\Scripts\lgtv-script.py", line 11, in <module>
    load_entry_point('LGTV==0.2', 'console_scripts', 'lgtv')()    
  File "h:\programacao\python\lgtv-os\lgtv-venv\lib\site-packages\LGTV\__init__.py", line 109, in main
    results = LGTVScan()
  File "h:\programacao\python\lgtv-os\lgtv-venv\lib\site-packages\LGTV\scan.py", line 25, in LGTVScan
    response, address = sock.recvfrom(512)
socket.timeout: timed out

trying with webOS 3.0 on lg 60sj8500, can't scan

Trying to figure out how the 'scan' works, and whether I have to edit lgtv.py or the .json file.

My LAN is 192.168.1.* and the TV is .118. I know its MAC by asking my router for it. What's the next step to having it scan? Should I just try nmap on the TV to figure out how different webOS is?

YouTube

Finally got this awesome script working tonight on my QNAP NAS with Entware!

However, disappointed to find out that the openYoutubeId and openYoutubeURL functions don't seem to have any effect on my TV; YouTube will open, but doesn't load any video, regardless of what you specify.

Using the openBrowserAt command with the URL works, but I'd love to get the YouTube app working properly. I thought maybe I could try to get it working via the openAppWithPayload command and passing the ID as a parameter to it, but that doesn't work either.

Any ideas why this doesn't work?

UPDATE: I think this is because the linux machine running the script actually needs to "pair" with the YouTube app (similar to what a phone does when casting to it)

I found some examples of this in other sources:

Where essentially the parameter being passed is contentId with some additional variables added to it:
params.put("contentId", String.format("%s&pairingCode=%s&t=%.1f", contentId, UUID.randomUUID().toString(), startTime));

so basically it needs a random UUID passed with a time value?

Something like:
{"contentId": videoid+'&pairingCode='+randomUUID+'&t=1'}}

I tried editing the script and passing something like this when openYoutubeId was being called, but it didn't help; YouTube would still open but no video would play.

LG OLED55C9 mostly working, but queries broken?

I'm playing with master, and it looks like you're working on it, so my issue may just be due to living on the bleeding edge. Seems like the package is Python 3 now among other things. Anyway, before I start, thanks for putting this together, exactly what I was looking for!

So, I'm using it with an LG OLED55C9 with WebOS 4.7.0. Installed using Python 3.4, which worked well, except for wakeonlan which I had to install manually. After looking at the source a bit, I managed to figure out the new syntax requiring the device name, and authenticated. Basic commands work fine, on/off/mute/volume. None of the commands for retrieving information seem to work though, eg:

pi$ lgtv LGOLED listInputs
{"closing": {"code": 1000, "reason": ""}}

My only goal here is to be able to turn on the TV and switch inputs, but I can't figure out the correct input names, so I'm stuck. I've tried the input names, like:

pi$ lgtv LGOLED setInput "HDMI 2"
{"closing": {"reason": "", "code": 1000}}

and also the names I assigned to the various inputs, but nothing seems to work.

Any idea?

Thanks again!

TypeError: __init__() got an unexpected keyword argument 'exclude_headers'

When I do

python lgtv.py auth <IP_ADDRESS>

I get:

Traceback (most recent call last):
File "lgtv.py", line 484, in
ws = LGTVClient()
File "lgtv.py", line 215, in init
super(LGTVClient, self).init('ws://' + self.__hostname + ':3000/', exclude_headers=["Origin"])
TypeError: init() got an unexpected keyword argument 'exclude_headers'

Closing Web Browser Doesn't Work

When I have loaded the webbrowser with openBrowserAt (to http://google.com), and then I do

python lgtv.py closeApp com.webos.app.browser

I get:

{"payload": {}, "type": "error", "id": "0", "error": "403 access denied"}
{"payload": {}, "type": "error", "id": "0", "error": "403 access denied"}
{"closing": {"reason": "", "code": 1000}}

and the TV starts displaying a screensaver. Any ideas why? I can't find a reliable way to close it. Any suggestions would be great.

Unable to open Youtube Video

Hi,

I'm trying to open a Youtube video using the two methods in the README, however neither seem to work.

Does anyone have any ideas?

root@orangepizero:/usr/src/LGWebOSRemote# python lgtv.py openYoutubeId eyA2lWQrxwg
{"payload": {"returnValue": false}, "type": "error", "id": "0", "error": "500 Application error"}
{"payload": {"returnValue": false}, "type": "error", "id": "0", "error": "500 Application error"}
{"closing": {"reason": "", "code": 1000}}
root@orangepizero:/usr/src/LGWebOSRemote# python lgtv.py openYoutubeURL "https://www.youtube.com/watch?v=wbSwFU6tY1c"
{"payload": {"returnValue": false}, "type": "error", "id": "0", "error": "500 Application error"}
{"payload": {"returnValue": false}, "type": "error", "id": "0", "error": "500 Application error"}
{"closing": {"reason": "", "code": 1000}}

Thanks

AttributeError: 'str' object has no attribute 'decode'

How to reproduce: lgtv <TVName> volumeDown.

Full tracelog:

Traceback (most recent call last):
  File "c:\program files\python38\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "c:\program files\python38\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "h:\programacao\python\lgtv-os\lgwebosremote\venv-git\lib\site-packages\ws4py\webso
cket.py", line 531, in run
    self.terminate()
  File "h:\programacao\python\lgtv-os\lgwebosremote\venv-git\lib\site-packages\ws4py\webso
cket.py", line 431, in terminate
    self.closed(1006, "Going away")
  File "h:\programacao\python\lgtv-os\lgwebosremote\venv-git\lib\site-packages\LGTV\remote
.py", line 87, in closed
    "reason": reason.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'

Any plans for Python3 code migration?

[farid@unknown LGWebOSRemote]$ ./install.sh
Using base prefix '/usr'
New python executable in /home/farid/git/LGWebOSRemote/venv/bin/python
Installing setuptools, pip, wheel...
done.
Collecting wakeonlan==0.2.2 (from -r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/26/87/4164f76446fb372ce9ff10f9458ac00dade098ef054772ab3333139e8cfa/wakeonlan-0.2.2.tar.gz
Collecting ws4py from git+https://github.com/Lawouach/WebSocket-for-Python.git#egg=ws4py (from -r requirements.txt (line 2))
  Cloning https://github.com/Lawouach/WebSocket-for-Python.git to /tmp/pip-install-hqw___dd/ws4py
  Running command git clone -q https://github.com/Lawouach/WebSocket-for-Python.git /tmp/pip-install-hqw___dd/ws4py
Building wheels for collected packages: wakeonlan, ws4py
  Building wheel for wakeonlan (setup.py) ... done
  Stored in directory: /home/farid/.cache/pip/wheels/25/52/13/d3cc3bb426cab70bc012874759d47a8d653488c29f3359a775
  Building wheel for ws4py (setup.py) ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-0gcmsbrb/wheels/f8/28/22/19457c71112349cdb67cb617b0687db6ee9ce532044314eeb6
Successfully built wakeonlan ws4py
Installing collected packages: wakeonlan, ws4py
Successfully installed wakeonlan-0.2.2 ws4py-0.5.1

**[farid@unknown LGWebOSRemote]$ python lgtv.py scan**
Traceback (most recent call last):
  File "/home/farid/git/LGWebOSRemote/LGTV/__init__.py", line 120, in LGTVScan
    response, address = sock.recvfrom(512)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "lgtv.py", line 59, in <module>
    results = LGTVScan()
  File "/home/farid/git/LGWebOSRemote/LGTV/__init__.py", line 136, in LGTVScan
    print(e.message)
AttributeError: 'timeout' object has no attribute 'message'

[farid@unknown]$ python --version
Python 3.7.3

For those who has python3 by default installed on Linux (Manjaro, Arch) the solution is:

pacman -S python-virtualenv
pacman -S python2-setuptools
pacman -S python2-pip

Change install.sh line from:
pip install -r requirements.txt
to:
pip2.7 install -r requirements.txt

Then run:
sudo install.sh


[farid@unknown LGWebOSRemote]$ python2.7 lgtv.py scan
timed out
{
    "count": 1, 
    "list": [
        {
            "address": "192.168.1.111", 
            "model": "LF631V", 
            "uuid": "xxxx-xxxx-xxxx-xxxx"
        }
    ], 
    "result": "ok"
}
[farid@unknown LGWebOSRemote]$ 

Is it possible to turn screen off while keeping the tv on

Using a TV remove users can go to the ECO mode and turn screen off. However, is it possible to do this from the app? That way music can be playing on the TV while the screen is off.

This is possible from the remote & LG menu. Just checking to find out if is it possible to automate it.

problem with auth command

Hello

I have problem with auth command frm LGWebOsRemote, scan works OK

SCAN:
/LGWebOSRemote-master$ python lgtv.py scan
{
"count": 1,
"list": [
{
"address": "10.100.188.164",
"model": "UK6500MLA",
"uuid": "763af48f-0d45-671c-251d-887bfe13ec95"
}
],
"result": "ok"
}

AUTH:

/LGWebOSRemote-master$ python lgtv.py auth 10.100.188.164
Traceback (most recent call last):
File "lgtv.py", line 81, in
ws = LGTVClient(sys.argv[2])
File "/home/mlody/LGWebOSRemote-master/LGTV/init.py", line 212, in init
self.__macAddress = getMacAddress(self.__ip)
File "/home/mlody/LGWebOSRemote-master/LGTV/init.py", line 156, in getMacAddress
pid = subprocess.Popen(["arp", "-n", address], stdout=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 390, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

What file or directory is needed ?

Problem when calling lgtv.sh from child process in node.js

Hi and thanks for your great libary!
I have succesfully installed it on my pi and I can controll the TV from a command line.
I am trying to integrate it into my HAP-Node.js, so I can for example turn on my TV. To do this I call lgtv.sh as a child process with exec('/home/pi/LGWebOSRemote/lgtv.sh on');
Unfortunately I get this error:
stdout:
stderr: Traceback (most recent call last):
File "lgtv.py", line 87, in
ws = LGTVClient()
File "/home/pi/LGWebOSRemote/LGTV/init.py", line 217, in init
super(LGTVClient, self).init('ws://' + self.__hostname + ':3000/', exclude_headers=["Origin"])
TypeError: cannot concatenate 'str' and 'NoneType' objects

exec error: Error: Command failed: /home/pi/LGWebOSRemote/lgtv.sh inputChannelDown
Traceback (most recent call last):
File "lgtv.py", line 87, in
ws = LGTVClient()
File "/home/pi/LGWebOSRemote/LGTV/init.py", line 217, in init
super(LGTVClient, self).init('ws://' + self.__hostname + ':3000/', exclude_headers=["Origin"])
TypeError: cannot concatenate 'str' and 'NoneType' objects

Can you give any advice on this?
Thanks in advance!

Problem with send more than 1 word in notification

I have problem with send notification with spaces (more than 1 word).

This is the result:
root@rpi2:/var/log# /var/www/nettemp/LGWebOSRemote/lgtv.sh notification "Test Test"
Error: Argument lengths do not match
LGTV Controller
Author: Karl Lattimer [email protected]
Usage: lgtv [parameter]

Available Commands:
scan
auth Hostname/IP Authenticate and exit, creates initial config ~/.lgtv. json
audioStatus
audioVolume
closeApp appid
getTVChannel
input3DOff
input3DOn
inputChannelDown
inputChannelUp
inputMediaFastForward
inputMediaPause
inputMediaPlay
inputMediaRewind
inputMediaStop
listApps
listChannels
listInputs
listServices
mute muted
notification message
off
on
openAppWithPayload payload
openBrowserAt url
openYoutubeId videoid
openYoutubeURL url
setInput input_id
setTVChannel channel
setVolume level
startApp appid
swInfo
volumeDown
volumeUp
Traceback (most recent call last):
File "lgtv.py", line 87, in
ws.exec_command(sys.argv[1], args)
NameError: name 'args' is not defined

invalid syntax , ws4py and ws.send issue

Hello! First of all, many thanks for your great work!

I tried to install & configure and ran into some troubles. A friend of mine came up with the following fixes. Not sure if i can help you with this but it helped my situation:

Device: Raspberry Pi 3 with Jessie Lite
Python version 2.7.9

1. Syntax Error(s)

It started with syntax error's on lgtv.py. Maybe it had to do with the python version I used (?)

  File "lgtv.py", line 3
    from __future__ import print
                               ^
SyntaxError: invalid syntax

Fix:
Edit in file: lgtv.py
Comment: see first line and #.

from __future__ import print_function
import sys
import json
#from __future__ import print_function
from inspect import getargspec
from LGTV import LGTVScan, LGTVClient, getCommands

2. Module ws4py error(s)

After that we got the following error (see below). After some searching it seems to have something to do with the ws4py version and python 2.7.9 (not totally sure)

python lgtv.py auth 192.168.1.23
Traceback (most recent call last):
  File "lgtv.py", line 77, in <module>
    ws = LGTVClient(sys.argv[2])
  File "/home/pi/domoticz/scripts/lgtv/LGWebOSRemote/LGTV/__init__.py", line 214, in __init__
    super(LGTVClient, self).__init__('ws://' + self.__hostname + ':3000/', exclude_headers=["Origin"])
TypeError: __init__() got an unexpected keyword argument 'exclude_headers'

Fix:
Got the latest version directly from git (seems to be newer then via pip)
git clone https://github.com/Lawouach/WebSocket-for-Python.git

3. global name 'ws' is not defined error

And at last we got the 'global name 'ws' is not defined error' (see below)

 python lgtv.py auth 192.168.1.23
{"closing": {"reason": "Going away", "code": 1006}}
Exception in thread WebSocketClient:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "build/bdist.linux-armv7l/egg/ws4py/websocket.py", line 522, in run
    self.opened()
  File "/home/pi/domoticz/scripts/lgtv/LGWebOSRemote/LGTV/__init__.py", line 249, in opened
    ws.send(json.dumps(hello_data))
NameError: global name 'ws' is not defined

Fix:
File: LGWebOSRemote/LGTV/init.py
We fixed that one by changing ws.send to self.send

Where do I put the MAC address?

All commands except 'lgtv on' work (simply typing them in Windows cmd) because it doesn't have the MAC address. I can't figure out where to write it.

Youtube does not start with URL/ID

I don't get the two commands

  • openYoutubeURL
  • openYoutubeId

to work properly. Youtube is started, but not the video.
I'm using it on WebOS 3.5 (LG55UK6100PLB)

Any advice what is causing this problem and how to resolve?

Here is the log:

python lgtv.py openYoutubeId vOW0i8wopaE
{"type": "response", "id": "0", "payload": {"sessionId": "eW91dHViZS5sZWFuYmFjay52NA==", "id": "youtube.leanback.v4", "returnValue": true}}
{"closing": {"reason": "", "code": 1000}}

lgtv.py on

Turning on the TV via Wake on LAN is unreliable after a few minutes, this is probably because LG haven't gotten the state of the wifi hardware setup correctly when the TV is in standby and the setting is correctly enabled on the TV.

I'd appreciate someone confirming this bug for me if possible.

arp command deprecated - use ip neigh command instead

arp command is deprecated on Debian 9.6. Replacement command to get mac addresses is ip neigh show

Here modified getMacAddress

def getMacAddress(address):
    pid = subprocess.Popen(["ip", "neigh", "show", address], stdout=subprocess.PIPE)
    s = pid.communicate()[0].decode('utf-8')
    matches = re.search("(([a-f\d]{1,2}\:){5}[a-f\d]{1,2}) REACHABLE", s)
    if not matches:
        return None
    mac = matches.groups()[0]
    m = mac.split(':')
    mac = ':'.join(['%02x' % int(x, 16) for x in m])
    return mac

Getting usage error with auth

Thank you for doing this.

My system:
Linux 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux (pi3B+)

lgtv scan
{"count": 1, "result": "ok", "list": [{"uuid": "e86da400-8ee2-a745-ef08-ddf01a0ac54b", "address": "192.168.88.250", "model": "UK6300PUE"}]}

lgtv auth 192.168.88.250
Error: TV name is required for auth

Not sure what to look at to fix this. The webOS version on the tv is 4.1.4-5726.

Thanks again.

Missing resource

I get the an import error "no module named ws4py". Tried on Python 2. Also converted to Python 3, same result. Any idea ? Running on Rapian Jessie

Socket error no route to host fix

I made a mistake the first time I tried to run the auth process, using the wrong IP address of my TV. This created an lgtv.json with the wrong IP and then when I reran auth, it seemed to use the file and I got lots of "no route to host" errors. I deleted the file and then auth ran perfectly.

Installation Process

Good day, would appreciate help installing your tool. The read me is not detailed enough; would this be correct:
-download zip
-apt-get install net-tools
-modify "lgtv-example.json" with your tv details
-./install.sh

thank you

'exclude headers'

#1 I just started with a brand new Ubuntu 16.04 VM and followed your instructions to perfectly. I am using Pythong 2.7.12. When executing python lgtv.py auth "IP Address," I am receiving this same error message. Can you point me in the correct direct in order to resolve it?

How can I start with the tool? (scan and on)

Hi Klattimer, thanks for providing this tool for us.
After the installation, I assume that I need to do a scan before I can use all the feature. However, when I try SCAN or ON function, I got an error from the python code. (I am new to HA and python...)

pi@hassbian:~/LGTVControl/LGWebOSRemote-master $ python lgtv.py scan
File "lgtv.py", line 3
from future import print_function
SyntaxError: from future imports must occur at the beginning of the file

pi@hassbian:~/LGTVControl/LGWebOSRemote-master $ python lgtv.py on
File "lgtv.py", line 3
from future import print_function
SyntaxError: from future imports must occur at the beginning of the file

N.B. my TV is LG 65FL6350, it is a WebOS 2.0 TV. I have set a static IP for the TV, and enabled the LG Connect APP feature from the setting.

Thanks a lot for this.

lgtv.py off

(venv)Laptop:amazon-alexa-lg-tv-master User$ python lgtv.py off
{"type": "response", "id": "0", "payload": {"returnValue": true}}

When running python lgtv.py off shortly after the TV turns on the command hangs at the statement above. It seems to be on the ws.connect() command.

This seems only seems to be an issue with the off command. When sending a 'notification', it hangs while the TV boots up, then delivers it successfully. However, if the 'off' is executed even 30 seconds after the TV has fully booted it hangs indefinitely.

Confirmed support for UF776V

Hi,
I tried this with my LG UF776V (latest updates installed) - worked flawlessly. You can add it to the list.
I did scan, auth, volup, voldown, open browser, open youtube - they all worked.

Thank you for this project πŸ‘

[UJ6309] New device: working, suggestions towards Readme update

Thanks a lot for your great work here.

It took me some time to get it up and running, possibly due to changes done to the code and not reflected in the examples (e.g. the devices do not show the necessity of the device name)

I would recommend to update the Readme.md to reflect this, like:

lgtv scan
lgtv off

etc.

Power on command doesn't seem to work

When I issue a power on command, i get no feedback on the command line, and then command itself seems to fail. TV doesn't turn on. If I use the remote to turn on the set, I can shut off via lgtv.py, as well as all of the other controls.

Power On doesn't work however.

Thoughts?

Slow to execute

Hi there, thanks for your work! It is working great!

Hi have only one grief, I'm running it on an PI and I have a delay of 4 seconds before a command is executed. I wondering if it's normal or I can speed up things. thanks in advance.

Notification message sentence

How do you use the the notification command to send a sentence to the tv?

This works for one word:
lgtv.sh notification test
Or this: lgtv.sh notification test_test_test

Tried using quotes or double quotes. But it dont work when I use blank space or special characters, example Γ₯Àâ in my language.

Otherwise it works great! I think my lack of knowledge is the problem. Thanks.

Is-it possible to add left, right, up, down and select buttons?

Very nice tool, it's working well.
So as to set my channel, I need to use arrows such as left, right, up, down and click (ok) on my remote. Is it possible to add these buttons in this CLI tool?

I can do it my self, but I can't find some documentation about what is the command to send to the TV. Is there a doc somewhere? Would it be feasible?

Thanks

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.