LG TV WebOs 3.0

Moderator: leecollings

Nefsolive
Posts: 69
Joined: Monday 04 September 2017 17:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: LG TV WebOs 3.0

Post by Nefsolive »

Hello,

Thanks for sharing the plungin.

All working fine, but whit some lag. And i can´t power ON my tv! Just power OFF.
I see all settings on TV and they are enable.
Anythink i need for take my TV ON?

Best Regards
Nefsolive
Posts: 69
Joined: Monday 04 September 2017 17:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: LG TV WebOs 3.0

Post by Nefsolive »

basmaaks wrote: Tuesday 31 July 2018 21:33 got it running (sort of)

Some small problem, status isn't showing the channel I'm watching. Input selector doesn't work, can't switch my tv off. But I can switch my TV on.

Any help ?
I have instead, i can take my tv off and i can´t take on!
Bluelightcrew
Posts: 19
Joined: Thursday 02 February 2017 20:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6708
Location: Deutschland
Contact:

Re: LG TV WebOs 3.0

Post by Bluelightcrew »

I found for a other home automation a script where you can send notifications to the LG tv. A very cool thing. But I have no idea how to include that in domoticz or the LG tv script. Maybe some one other have the know how to include that. I would spend some money onver PayPal.
https://www.home-assistant.io/component ... y.webostv/
nono212
Posts: 39
Joined: Sunday 18 December 2016 13:47
Target OS: Linux
Domoticz version: 3.6179
Contact:

Re: LG TV WebOs 3.0

Post by nono212 »

Hello
Thanks for your great Job .
I would like to know How you did to command your TV ...
I mean Now that is working ,what is the next step ?
I do not think that people do cli to change channel ;-)
Maybe integration on alexa ?
for example Alexa ,put cnn on Tv ...
What should be the next step for that any idea ?
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: LG TV WebOs 3.0

Post by Nautilus »

Bluelightcrew wrote: Wednesday 08 August 2018 9:03 I found for a other home automation a script where you can send notifications to the LG tv. A very cool thing. But I have no idea how to include that in domoticz or the LG tv script. Maybe some one other have the know how to include that. I would spend some money onver PayPal.
https://www.home-assistant.io/component ... y.webostv/
I'm using pylgtv (https://github.com/TheRealLink/pylgtv) for notifications. Not sure about the best way to set it up, but I have a python script (lgnotify.py):

Code: Select all

#!/usr/bin/env python3
from pylgtv import WebOsClient
import sys

try:
    webos_client = WebOsClient('xxx.xxx.xxx.xxx')
    webos_client.send_message(str(sys.argv[1]), icon_path="/home/pi/domoticz/scripts/domoticz.png")
except:
    print("Error connecting to TV")
which I then call from event system (i.e. form Lua scripts, or Blockly), e.g.

Code: Select all

os.execute('/usr/bin/python3 /home/pi/domoticz/scripts/lgnotify.py "This is my message!" &')
I think the icon is optional but if you want to specify certain icon to be shown with the notification you need to specify it here: icon_path="/home/pi/domoticz/scripts/domoticz.png" I'm currently using just a plain domoticz icon for all notifications.
Bluelightcrew
Posts: 19
Joined: Thursday 02 February 2017 20:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6708
Location: Deutschland
Contact:

Re: LG TV WebOs 3.0

Post by Bluelightcrew »

Nautilus wrote: Thursday 20 September 2018 0:08
Bluelightcrew wrote: Wednesday 08 August 2018 9:03 I found for a other home automation a script where you can send notifications to the LG tv. A very cool thing. But I have no idea how to include that in domoticz or the LG tv script. Maybe some one other have the know how to include that. I would spend some money onver PayPal.
https://www.home-assistant.io/component ... y.webostv/
I'm using pylgtv (https://github.com/TheRealLink/pylgtv) for notifications. Not sure about the best way to set it up, but I have a python script (lgnotify.py):

Code: Select all

#!/usr/bin/env python3
from pylgtv import WebOsClient
import sys

try:
    webos_client = WebOsClient('xxx.xxx.xxx.xxx')
    webos_client.send_message(str(sys.argv[1]), icon_path="/home/pi/domoticz/scripts/domoticz.png")
except:
    print("Error connecting to TV")
which I then call from event system (i.e. form Lua scripts, or Blockly), e.g.

Code: Select all

os.execute('/usr/bin/python3 /home/pi/domoticz/scripts/lgnotify.py "This is my message!" &')
I think the icon is optional but if you want to specify certain icon to be shown with the notification you need to specify it here: icon_path="/home/pi/domoticz/scripts/domoticz.png" I'm currently using just a plain domoticz icon for all notifications.
Cool i will try it ,thanks
RapTile
Posts: 53
Joined: Saturday 10 March 2018 2:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: LG TV WebOs 3.0

Post by RapTile »

Thanks for sharing!
marrossko
Posts: 1
Joined: Tuesday 04 December 2018 14:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: LG TV WebOs 3.0

Post by marrossko »

Hello,

I have finally managed to connect my LGTV and Domoticz, but the interface respond is very-very slow. I dont know where is the problem. I have reinstalled pylgtv (sudo pip3 uninstall pylgtv) first and than install it again. But it didn't help. In my domoticz I can see the status of the TV, volume and option to change the inputs but every time when I click on any of them it takes number of seconds until anything happen on the TV. I'm running my Domoticz on RPI3 but I don't thing the problem is with my HW. Any ideas? Any help is much appreciated. Thanx!
rirethy
Posts: 8
Joined: Friday 26 September 2014 14:06
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: LG TV WebOs 3.0

Post by rirethy »

Hello, I'm trying to use this plugin .... but I have an issue installing pylgtv

I tried to install it for Pyton 3.4. in the documentation, this pylgtv is supposed to be compatoble with pyton >= 3.3 : here https://github.com/TheRealLink/pylgtv and here https://pypi.org/project/pylgtv/

Running sudo pip3 install pylgtv, I have this output :
sudo pip3 install pylgtv
Downloading/unpacking pylgtv
Downloading pylgtv-0.1.9-py3-none-any.whl
Downloading/unpacking asyncio (from pylgtv)
Downloading asyncio-3.4.3-py3-none-any.whl (101kB): 101kB downloaded
Downloading/unpacking websockets (from pylgtv)
Downloading websockets-8.1.tar.gz (58kB): 58kB downloaded
Running setup.py (path:/tmp/pip-build-vuxwm67e/websockets/setup.py) egg_info for package websockets
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-vuxwm67e/websockets/setup.py", line 12, in <module>
long_description = (root_dir / 'README.rst').read_text(encoding='utf-8')
AttributeError: 'PosixPath' object has no attribute 'read_text'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 17, in <module>

File "/tmp/pip-build-vuxwm67e/websockets/setup.py", line 12, in <module>

long_description = (root_dir / 'README.rst').read_text(encoding='utf-8')

AttributeError: 'PosixPath' object has no attribute 'read_text'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-vuxwm67e/websockets
Storing debug log for failure in /root/.pip/pip.log
And, It doesn't install.

If someone has any clue for this, it will be very helpfull.

Thanks in advance.
2 Raspberry Pi (xbian + Domoticz)
Synology NAS 214 Play
NAS and Raspberrys monitoring
Sigma design Zwave+ USB controler
1 Aeon MiniMote
1 Qubino ZMNHAA2 (Flush 1 relay)
1 Qubino ZMNHCA2 (Flush shutter)
4 1-Wire Temp Sensor DS18B20
1 relay GPIO controled
qmax
Posts: 2
Joined: Friday 27 March 2020 19:16
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Poland
Contact:

Re: LG TV WebOs 3.0

Post by qmax »

Hello
At first I want to apologize for my English
Anyone helps??
Domoticz does not start, I have such an error
This happened after installation LGTV Plugin

Code: Select all

.
.
.
2020-03-27 19:09:27.282  Error: Domoticz(pid:3569, tid:3583('MainWorker')) received fatal signal 11 (Segmentation fault)
2020-03-27 19:09:27.282  Error: siginfo address=0x27206465, address=(nil)
.
.
.
2020-03-27 19:09:29.730  Error: Thread 12 (Thread 0x701fd430 (LWP 3583)):
2020-03-27 19:09:29.730  Error: #0  __waitpid (options=0, stat_loc=0x701fc0f0, pid=3586) at ../sysdeps/unix/sysv/linux/waitpid.c:30
2020-03-27 19:09:29.730  Error: #1  __waitpid (pid=3586, stat_loc=0x701fc0f0, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:25
2020-03-27 19:09:29.730  Error: #2  0x00109454 in dumpstack_gdb(bool) ()
2020-03-27 19:09:29.730  Error: #3  0x00109a20 in signal_handler(int, siginfo_t*, void*) ()
2020-03-27 19:09:29.731  Error: #4  <signal handler called>
2020-03-27 19:09:29.731  Error: #5  0x00097004 in std::map<unsigned char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<unsigned char>, std::allocator<std::pair<unsigned char const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::operator[](unsigned char const&) ()
2020-03-27 19:09:29.731  Error: #6  0x0007c12c in CEventSystem::UpdateJsonMap(CEventSystem::_tDeviceStatus&, unsigned long long) [clone .constprop.1290] ()
2020-03-27 19:09:29.731  Error: #7  0x0008ece8 in CEventSystem::GetCurrentStates() ()
2020-03-27 19:09:29.731  Error: #8  0x0008f644 in CEventSystem::StartEventSystem() ()
2020-03-27 19:09:29.731  Error: #9  0x000d8444 in MainWorker::Do_Work() ()
2020-03-27 19:09:29.731  Error: #10 0x0077dd94 in execute_native_thread_routine ()
2020-03-27 19:09:29.731  Error: #11 0x76c3e648 in start_thread (arg=0x701fd430) at pthread_create.c:479
2020-03-27 19:09:29.731  Error: #12 0x76b06778 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
Naruszenie ochrony pamięci
After clean installation of Domoticz and after plugin installation i have an error, Domoticz does not start, I have a problem removing the device

Code: Select all

.
.
.
2020-03-27 23:37:37.997  Error: (LG TV) failed to parse parameters, valid Notifier Name expected, received 'LG TV 1'.
.
.
.
Fatal Python error: Segmentation fault
Thread 0x76f89010 (most recent call first):
2020-03-27 23:38:51.602  Error: Domoticz(pid:1631, tid:1637('WebServer_8080')) received fatal signal 11 (Segmentation fault)
2020-03-27 23:38:51.602  Error: siginfo address=0x65f, address=(nil)
2020-03-27 23:38:54.646  Error: Thread 7 (Thread 0x72d3b220 (LWP 1637)):
2020-03-27 23:38:54.646  Error: #0  __waitpid (options=0, stat_loc=0x72d39180, pid=1685) at ../sysdeps/unix/sysv/linux/waitpid.c:30
2020-03-27 23:38:54.646  Error: #1  __waitpid (pid=1685, stat_loc=0x72d39180, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:25
2020-03-27 23:38:54.646  Error: #2  0x00109454 in dumpstack_gdb(bool) ()
2020-03-27 23:38:54.646  Error: #3  0x00109a20 in signal_handler(int, siginfo_t*, void*) ()
2020-03-27 23:38:54.646  Error: #4  <signal handler called>
2020-03-27 23:38:54.646  Error: #5  raise (sig=11) at ../sysdeps/unix/sysv/linux/raise.c:50
2020-03-27 23:38:54.646  Error: #6  <signal handler called>
2020-03-27 23:38:54.646  Error: #7  0x676c7970 in ?? ()
2020-03-27 23:38:54.646  Error: #8  0x72409ab0 in ?? ()
qmax
Posts: 2
Joined: Friday 27 March 2020 19:16
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Poland
Contact:

Re: LG TV WebOs 3.0

Post by qmax »

Problem solved after another clean instalation.
Plugin works fine, downloaded from :

Code: Select all

https://github.com/GameDevHobby/Domoticz-LGTV-WebOS-Plugin
I just don't know how to do automatic pairing with the TV, I have to confirm pairing every time I start it.
I found a modified lg.py file, it has automatic pairing but unfortunately it doesn't work.
Romel
Posts: 15
Joined: Tuesday 06 August 2019 14:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Kromeriz / Czech
Contact:

Re: LG TV WebOs 3.0

Post by Romel »

remote control in domoticz panel can switch channel UP and DOWN . Volume is working too.. but button OK not. Is there some script to control own command ? for example - switch channel no 31, set volume to 8.

EDIT:
ok. I found:

Code: Select all

/usr/bin/python3 /home/pi/domoticz/plugins/LGTV/lg.py -c send-message -a "Message shown on TV" 192.168.88.214
Here are commands
self.commandLines = {
'off': self.off,
'on': self.wakeonlan,
'software-info': self.software_info,
'volume-up': self.volume_up,
'volume-down': self.volume_down,
'current-app': self.current_app,
'apps': self.apps,
'services': self.services,
'get-volume': self.get_volume,
'get-inputs': self.get_inputs,
'app': self.app,
'set-volume': self.set_volume,
'close-app': self.close_app,
'mute': self.mute,
'unmute': self.unmute,
'get-mute': self.get_mute,
'get-input': self.get_input,
'set-input': self.set_input,
'channel-up': self.channel_up,
'channel-down': self.channel_down,
'channels': self.channels,
'get-channel': self.get_channel,
'info': self.info,
'set-channel': self.set_channel,

'play': self.play,
'pause': self.pause,
'stop': self.stop,
'close': self.close,
'rewind': self.rewind,
'fast-forward': self.fast_forward,

'send-message': self.send_message,

'enter': self.enter,
'delete': self.delete,

#'3d-on': threeDOn,
#'3d-off': threeDOff,
How I can use set-channel ?
lamama1234
Posts: 14
Joined: Tuesday 17 October 2017 9:02
Target OS: Windows
Domoticz version:
Contact:

Re: LG TV WebOs 3.0

Post by lamama1234 »

Hi,

I installed Domoticz-LGTV-WebOS-Plugin from scratch (including pylgtv libary) and defined IP + MAC address within Domoticz hardware configuration. However, I'm not able to get my TV show the pairing code no matter what I tried.

Any tips?

Thanks
bramv
Posts: 17
Joined: Wednesday 27 June 2018 23:53
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands/Westland
Contact:

Re: LG TV WebOs 3.0

Post by bramv »

@Mayki
Does it work for anyone on the new TV? For example, OLEDC9?
It did not work well on my OLEDE9. I've made some changes and you can find it at my fork of this project. I hope the creator of the plugin will merge it with the original. My new plugin might not work well with older LG TVs.
I included a few new sources like Disney+, Spotify, Apple TV, and the LG app PhotoVideo .

It's on : https://github.com/bramvreugd/Domoticz- ... bOS-Plugin
drwurn
Posts: 68
Joined: Sunday 10 June 2018 16:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: LG TV WebOs 3.0

Post by drwurn »

I've got this running on my B9.

The data on the LG TV STATUS is '{'returnValue': True} ({'returnValue': False, 'errorCode': -106, 'errorText': 'No resource: 9A8adAeFA301AFE6Ba348d857362Dd5'} )'

I've only got the status and source, fine by me because I only use the status to dim one light in the room when the TV is on.
DarkG
Posts: 89
Joined: Friday 15 September 2017 18:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10076
Location: Germany
Contact:

Re: LG TV WebOs 3.0

Post by DarkG »

bramv wrote: Monday 17 August 2020 8:18 @Mayki
Does it work for anyone on the new TV? For example, OLEDC9?
It did not work well on my OLEDE9. I've made some changes and you can find it at my fork of this project. I hope the creator of the plugin will merge it with the original. My new plugin might not work well with older LG TVs.
I included a few new sources like Disney+, Spotify, Apple TV, and the LG app PhotoVideo .

It's on : https://github.com/bramvreugd/Domoticz- ... bOS-Plugin

How do you change it? I need buttons for SkyQ and Plex
RPi4 Shelly1 Shelly2.5 ESPEasy Tuya Domoticz Beta Dashticz 3.6
bramv
Posts: 17
Joined: Wednesday 27 June 2018 23:53
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands/Westland
Contact:

Re: LG TV WebOs 3.0

Post by bramv »

If you want them to be added to the pull down list it's easy.

First turn on debugging in domoticz. Then start the app you want to add on the LG TV.
Search for the text: "App: " in the logging of domoticz. The text after the semicolon you have to remember.

Now open the plugin.py file. Add the name of the app you want to add just before unknown in the following line.

"LevelNames" : "Off|TV|HDMI1

Change the following lines. The bold text is added or changed. If you add another please be sure you update unknown to 160

elif "photovideo" in self.tvPlaying.lower():
self.tvSource = 130
UpdateDevice(3, 1, str(self.tvSource))
elif <a part form the tet you found in the debugger" in self.tvPlaying.lower():
self.tvSource = 140
UpdateDevice(3, 1, str(self.tvSource))

else:
self.tvSource = 150
UpdateDevice(3, 1, str(self.tvSource)) # Set source device to Unknown

add after the lines
if Level == 130:
self.tvPlaying = "PhotoVideo"
self.run("app", "com.webos.app.photovideo")
add the following lines:
if Level == 140:
self.tvPlaying = <you appname>
self.run("app", "<the text from the debugger>")


and add 10 to the level of unknown.
if Level == 140:

you can restart a plugin by disabling it then click update. Enable it and click update again.

You can also send the text from the debugger to me and I will do it for you.
I can also change the plugin with an extra option where you can add extra sources.
bramv
Posts: 17
Joined: Wednesday 27 June 2018 23:53
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands/Westland
Contact:

Re: LG TV WebOs 3.0

Post by bramv »

I'm working on an almost complete rewrite of the LG tv plugin.
Is there anyone who like to test it or have a feature requests.

Status so far.
-Inclusief pylgtv library because of is no longer maintained and it had soms bugs in it.
Of is also a little faster because pylgtv is inckuded instead of running a new python for each command.
- status device now reports also the program you are watching.
- extra device in witch you can select witch tv channel hou want to see.

Possible thjngs to do:

- Code cleanup. There was a lot of code of the bravia plugin that should be removed.
- now the channel includes all posibilities of channels of tv, radio and satelite. That is a long list in my csse because all HD channels are also broadcasted in SD. It's several hjndreds long.. I plan to make a filter in which you van filter to have only High definition (no SD) and no radio.
- Maybe all the radio chanels in seperate device
- Custom screen with all remore buttons.
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: LG TV WebOs 3.0

Post by Nautilus »

Sounds excellent. If it is compatible with B7 model I'd be happy to test...:)
DarkG
Posts: 89
Joined: Friday 15 September 2017 18:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10076
Location: Germany
Contact:

Re: LG TV WebOs 3.0

Post by DarkG »

I habe this error in log

2020-11-12 00:59:49.946 Error: (tv) 'onHeartbeat' failed 'NameError':'name 'out' is not defined'.
2020-11-12 00:59:49.946 Error: (tv) ----> Line 466 in '/home/pi/domoticz/plugins/Domoticz-LGTV-WebOS-Plugin-master/plugin.py', function onHeartbeat
2020-11-12 00:59:49.946 Error: (tv) ----> Line 298 in '/home/pi/domoticz/plugins/Domoticz-LGTV-WebOS-Plugin-master/plugin.py', function onHeartbeat
2020-11-12 00:59:49.946 Error: (tv) ----> Line 351 in '/home/pi/domoticz/plugins/Domoticz-LGTV-WebOS-Plugin-master/plugin.py', function GetTVInfo
RPi4 Shelly1 Shelly2.5 ESPEasy Tuya Domoticz Beta Dashticz 3.6
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest