LGWebOS Binding (for LG WebOS TVs)

@sprehn I tested the new version and the discovery works on first try, but There is one problem starting with the handler, something with the youtube channel.
12:00:24.355 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:192_168_1_197’ changed from UNINITIALIZED to INITIALIZING
12:00:24.374 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while initializing handler of thing ‘connectsdk:WebOSTV:192_168_1_197’: java.lang.IllegalArgumentException: Channel with ID ‘youtubeLauncher’ does not exists.
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Channel with ID ‘youtubeLauncher’ does not exists.
at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_121]
at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_121]
at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:194)[100:org.eclipse.smarthome.core:0.9.0.201703060943]
at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:83)[100:org.eclipse.smarthome.core:0.9.0.201703060943]
at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:67)[100:org.eclipse.smarthome.core:0.9.0.201703060943]
at org.eclipse.smarthome.core.thing.internal.ThingManager$9.run(ThingManager.java:698)[107:org.eclipse.smarthome.core.thing:0.9.0.201703060943]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: java.lang.IllegalArgumentException: Channel with ID ‘youtubeLauncher’ does not exists.
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.isLinked(BaseThingHandler.java:574)[107:org.eclipse.smarthome.core.thing:0.9.0.201703060943]
at org.openhab.binding.connectsdk.handler.ConnectSDKHandler.isAnyChannelLinked(ConnectSDKHandler.java:199)[227:org.openhab.binding.connectsdk:2.1.0.201703102337]
at org.openhab.binding.connectsdk.handler.ConnectSDKHandler.onDeviceAdded(ConnectSDKHandler.java:212)[227:org.openhab.binding.connectsdk:2.1.0.201703102337]
at com.connectsdk.discovery.DiscoveryManager.addListener(DiscoveryManager.java:300)[227:org.openhab.binding.connectsdk:2.1.0.201703102337]
at org.openhab.binding.connectsdk.handler.ConnectSDKHandler.initialize(ConnectSDKHandler.java:85)[227:org.openhab.binding.connectsdk:2.1.0.201703102337]
at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:701)[107:org.eclipse.smarthome.core.thing:0.9.0.201703060943]
at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)[107:org.eclipse.smarthome.core.thing:0.9.0.201703060943]
at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:181)[100:org.eclipse.smarthome.core:0.9.0.201703060943]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
… 3 more
12:00:24.395 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:192_168_1_197’ changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): Channel with ID ‘youtubeLauncher’ does not exists.

ah. i commented the channel definition out as it does not seem to work to open youtube clips by id

will create a new version tonight

OK, new jar uploaded
@jmv_driver could you retest please

Thanks for your quick support! Now the toasts are working! thanks a lot! Maybe I will suggest you to make one action implementation, where we can send one message with one icon from the available iconset from openhab! this would be great!! :slight_smile:

Was thinking the same thing. Also actions for other features instead of item. I just don’t know yet how this is done. Don’t want to create a second binding but rather publish these actions in this Osgi bundle. Maybe anyone can help me or direct me to a binding example where this is done.

Hello!
I managed to connect to my TV!

Thanks for the help!

Thanks for this great job and for the time spent on it!
Unfortunately I did not have the opportunity to fully test, the next weekend will continue. I noticed that the volume is displayed as a tenth (0.12), is it something I messed up or should it be? I mostly use smartshare (com.webos.app.smartshare - SmartShare), in this mode do not work: forward, rewind, should they work in this mode?
Can I switch to video immediately by selecting this mode?
Can I get the name of the track and artist?

I managed to open a browser, but how to transfer the required URL to it?
Thank you!

I think that you don’t need one new binding, simply add one new service to the osgi. Example:

<implementation class="org.openhab.action.openwebif.internal.OpenWebIfActionService" />

	<service>
		<provide interface="org.openhab.core.scriptengine.action.ActionService" />
		<provide interface="org.osgi.service.cm.ManagedService" />
	</service>

	<property name="service.pid" type="String" value="org.openhab.openwebif" />

Check the implementation class here:

You can inject your service using osgi, into the action service and then simply call your methods to perform the actions.
If you need help, ask me and I will try to help you! :slight_smile:

Cheers!

Maybe a little bit off-topic, but did anyone get WOL (Wake on LAN) to work? I installed the WOL binding, everything is configured correctly (broadcast IP, MAC address), a sniffer on my PC is getting the WOL signal, but the TV is not getting turned on. I’m using LG 55EC930V / WebOS 1.4.0. Turning off via Connect SDK works fine…

Hello!
I also have WebOS 1.4
My TV does not support WOL. When the TV is turned off, there is no power on the network interfaces. To check, connect the TV to the router by cable, via LAN. Turn off the TV and see if the LED on the LAN LIGHT of the TV lights up. If not, you can not turn it on.
So here is the information from the author of this binding:

I understand English very badly, but he says:
In the settings menu of your TV you need to enable the option to allow Apps to remotely turn on the television.
I have no such settings :frowning:
I hope that I’m wrong and you can turn on any TV, if someone knows something about this, please let me know.

I have the same problem (no WOL option).
My workaround is to turn on the TV via HDMI-CEC. I have a Chromecast, after streaming something to the Chromecast the TV is activated. Even if you don’t want to show something on ChromeCast, you could:

  • Start a Chromecast stream - TV turns on;
  • Switch to the relevant channel;
  • Stop the Chromecast stream (TV remains on);

On my LG 60UF7709 this can be enabled in the general settings.

Unfortunately, I don’t have this option. Probably this means that my TV does not support it :frowning: Chromecast is a nice idea, but I intentionally turned CEC power synchronization off, otherwise my TV’s power status would be bound to my AVR which I want to control independently…

Hello Sebastian!
Thank you for showing how it looks, it is better to see once than to hear a hundred times :slight_smile: Indeed, I do not have such a setting, you are very lucky !!!
//***
Have I offended you by anything?
Or my English (Google translator) is so bad that you can not understand what I’m asking for help (Connect SDK Binding (for LG WebOS TVs))?
Thank you!

Hey Sergey,

I am not offended at all. The truth is, I don’t know all the answer to your questions.

With the latest version you can sent the url as a string to the browser channel. It will open the browser application with the given url. I noticed it will open a new tab every time you send it.

I am not familiar with smart share. I only expose those connect sdk features in the binding. if those player controls don’t work it may have to do with the smart share app on the TV.

Regarding Track and Artist, that is currently not possible with this binding. Not sure if this is accessible through the TV’s API.

Re volume, It is a Percent Type, I guess that is why it will display like this if rendered as a text.

Thank you so much, I don’t know why I hadn’t seen this before.
Is it possible that you can update the version for OpenHAB 1.8 as well, it seems the addon starts acting up after a couple of hours.

java.io.IOException: Can't assign requested address
	at java.net.PlainDatagramSocketImpl.send(Native Method)
	at java.net.DatagramSocket.send(DatagramSocket.java:693)
	at com.connectsdk.discovery.provider.ssdp.SSDPClient.send(SSDPClient.java:90)
	at com.connectsdk.discovery.provider.SSDPDiscoveryProvider$4.run(SSDPDiscoveryProvider.java:209)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)```

My 75UH885V has this setting and I enabled it. But it does not work. If I switch the TV by TV-remote on/off the switch on my sitemap shows the status well. I cannot switch the TV on by this binding. It only works via the Wake-On-Lan binding. What am I doing wrong?!

Hm, I had it running for over a year, and did not experience this kind of issue. I’ll see if I find time. At the moment I am working on enhancements in OH2 version.

works as desired. turning the system on is not supported by connect sdk

Ah ok … then I got it wrong. Thanks a lot for the fast reply!!!

I had some hiccups with another binding, it might have had something to do with that, I’ll look at it later tonight.
Thanks again.