LGWebOS Binding (for LG WebOS TVs)

I am new to OH2

Please share any document how to install this addan

I have copied t eh jar file \addons\org.openhab.binding.connectsdk_2.0.0.201603250427

\demo.things \copied
Frame label=“TVControl” { ( everyting in your post )
Text item=LG_TV0_Channel from to Switch item=LG_TV0_MediaStop mappings=[ON=“Stop”]
}
\demo.items
/*Lg TV */
Switch LG1_vol_up “Volume Up 1” { connectsdk=“192.168.2.32:VolumeControl:up”, autoupdate=“false” }
Switch LG1_vol_down “Volume Down 1” { connectsdk=“192.168.2.32:VolumeControl:down”, autoupdate=“false”}
Switch LG1_vol_mute “Mute 1” { connectsdk=“192.168.2.32:VolumeControl:mute” }
Switch LG1_power “Power” { connectsdk=“192.168.2.32:PowerControl:power”, autoupdate=“false” }

Now I can see the remote function but TV not responding for any key pressed - TV LG running latest WebOS

Please help I may missed any configuration /steps
Thanks

Hi @muthu,

The example configuration is actually for version 1.8.

Under Openhab2 you should go through the discovery process and bind the different channels. And make sure you use the OH2 version of the binding: Version 2 Releases

For a production setup I think the project still recommends Openhab 1.8.
But you can try it out with OH2 of course.

Kind Regards
Sebastian

Hello,
does the binding still works?
I’ve upgrade to 2.0 version after 1.8.3 but it doesn’t work anymore with the same config.

there is a 2.0 version of the binding https://github.com/sprehn/openhab2-addons/releases/
but it is beta of course

I’ve used that version of the binding but doesn’t work and I don’t see log entries that helps in debug

hm, you should discover the TV as a “thing” and bind properties. At the moment I cannot test myself, sorry.

I tried using the paperUI, forcing the discovery but nothing new appeared in inbox

This is the log I have after installation.

2017-01-04 09:06:09.300 [INFO ] [org.apache.felix.fileinstall        ] - Installing bundle org.openhab.binding.connectsdk;singleton:=true / 2.0.0.201603250427
2017-01-04 09:06:10.297 [INFO ] [g.apache.aries.spifly.dynamic.bundle] - Bundle Considered for SPI providers: org.openhab.binding.connectsdk
2017-01-04 09:06:10.300 [INFO ] [g.apache.aries.spifly.dynamic.bundle] - No 'SPI-Provider' Manifest header. Skipping bundle: org.openhab.binding.connectsdk
2017-01-04 09:06:10.648 [INFO ] [ternal.discovery.ConnectSDKDiscovery] - {service.pid=binding.connectsdk.discovery, localIP=192.168.1.106, component.name=binding.connectsdk.discovery, component.id=214}
2017-01-04 09:06:10.734 [INFO ] [org.apache.felix.fileinstall        ] - Started bundle: file:/usr/share/openhab2/addons/org.openhab.binding.connectsdk_2.0.0.201603250427.jar
2017-01-04 09:06:12.749 [INFO ] [org.apache.felix.fileinstall        ] - Updating bundle org.openhab.binding.connectsdk / 2.0.0.201603250427
2017-01-04 09:06:13.211 [INFO ] [g.apache.aries.spifly.dynamic.bundle] - Bundle Considered for SPI providers: org.openhab.binding.connectsdk
2017-01-04 09:06:13.219 [INFO ] [g.apache.aries.spifly.dynamic.bundle] - No 'SPI-Provider' Manifest header. Skipping bundle: org.openhab.binding.connectsdk
2017-01-04 09:06:13.534 [INFO ] [ternal.discovery.ConnectSDKDiscovery] - {service.pid=binding.connectsdk.discovery, localIP=192.168.1.106, component.name=binding.connectsdk.discovery, component.id=216}

Hi, just rechecked the binding with my TV on latest build of OH2 and it worked as expected.
DId you enable LG Connect Apps in the TV Network Settings?

Yes, it is enabled. As I said, with OH1 it worked fine but after upgrading to OH2, I still not able to connect.
Using PaperUI, when I search for a thing, nothing appear.

How do you think I can debug?

moskovskiy82 did you ever fix the TV requiring authorization with every reboot? I am having the same issue?

Somehow after several reconnects and openhab reboots - never was asked again

Hi, may be small bug in OH2 binding, if i sending fast, one by one 3 or more toasts to LGTV errors in log:

23:55:09.168 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while calling handler: java.lang.ArrayIndexOutOfBoundsException
java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_101]
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_101]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:188)[98:org.eclipse.smarthome.core:0.9.0.201701140927]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:81)[98:org.eclipse.smarthome.core:0.9.0.201701140927]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:65)[98:org.eclipse.smarthome.core:0.9.0.201701140927]
        at org.eclipse.smarthome.core.thing.internal.ThingManager.receiveCommand(ThingManager.java:369)[105:org.eclipse.smarthome.core.thing:0.9.0.201701140927]
        at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:46)[98:org.eclipse.smarthome.core:0.9.0.201701140927]
        at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:192)[98:org.eclipse.smarthome.core:0.9.0.201701140927]
        at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:1)[98:org.eclipse.smarthome.core:0.9.0.201701140927]
        at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:179)[98:org.eclipse.smarthome.core:0.9.0.201701140927]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
Caused by: java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)[:1.8.0_101]
        at com.android.internal.util.GrowingArrayUtils.insert(GrowingArrayUtils.java:118)[231:org.openhab.binding.connectsdk:2.0.0.201603250427]
        at android.util.SparseArray.put(SparseArray.java:207)[231:org.openhab.binding.connectsdk:2.0.0.201603250427]
        at com.connectsdk.service.webos.WebOSTVServiceSocketClient.sendCommand(WebOSTVServiceSocketClient.java:596)[231:org.openhab.binding.connectsdk:2.0.0.201603250427]
        at com.connectsdk.service.WebOSTVService.sendCommand(WebOSTVService.java:2893)[231:org.openhab.binding.connectsdk:2.0.0.201603250427]
        at com.connectsdk.service.command.ServiceCommand.send(ServiceCommand.java:70)[231:org.openhab.binding.connectsdk:2.0.0.201603250427]
        at com.connectsdk.service.WebOSTVService.sendToast(WebOSTVService.java:940)[231:org.openhab.binding.connectsdk:2.0.0.201603250427]
        at com.connectsdk.service.WebOSTVService.showToast(WebOSTVService.java:845)[231:org.openhab.binding.connectsdk:2.0.0.201603250427]
        at org.openhab.binding.connectsdk.handler.ToastControlToast.onReceiveCommand(ToastControlToast.java:51)[231:org.openhab.binding.connectsdk:2.0.0.201603250427]
        at org.openhab.binding.connectsdk.handler.ConnectSDKHandler.handleCommand(ConnectSDKHandler.java:73)[231:org.openhab.binding.connectsdk:2.0.0.201603250427]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$4.call(ThingManager.java:372)[105:org.eclipse.smarthome.core.thing:0.9.0.201701140927]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$4.call(ThingManager.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.201701140927]
        ... 5 more

For switching from TV to HDMI2, for example, Input must be set to ‘HDMI_2’.
But did anyone figure out how to switch back to TV?

Only by setting a TV Channel

Is it possible to set the time how long a toast message is shown on the TV?
Is it possibel to see at the LG TV the connected devices like openhab?

Thank you @sprehn, that works!

Btw, what is the preferred way of installing the binding? It’s not listed on the OH2 website - do I have to install the jar file manually?

at the moment you have to put the jar file into the addons folder

I think the answer is 2x No. , at least I am not aware how this could be done

I found out how. There is a launch app feature. I’ll make it accessible in the next beta version.

1 Like