LGWebOS Binding (for LG WebOS TVs)

Reinstalling from karaf console solves my issue.
Thank you.

Managed to get it working. Had to uninstall the binding then i downloaded the latest binding from the link provided by @brononius. I assumed I had already got the latest version installed. oops.

Thanks for the help everyone :slight_smile:

Have started with a documentation for this binding.

https://github.com/sprehn/openhab2-addons/blob/master/addons/binding/org.openhab.binding.connectsdk/README.md

2 Likes

Hi.
I still have issue with update OH2 via apt, binding not starting after update.
If i reinstall binding, it start works.

Thanks!
The documentation looks pretty complete (and easy to understand).

The examples are also interesting. I noticed how you were able to use a player-item using a rule. I didn’t think of that before, but I’m going to implement it like that. It is much more user-friendly than separate switches.

One question I have is related to the AppLauncher. By sending the command “youtube.leanback.v4”, you can start the Youtube app on your TV. Is it also possible to trigger Youtube to play a certain video? Same question goes for any other app (Netflix, Spotify,…).

Hi Sebastian…

I’m on a LG TV 42LB650V-ZN and also have had problems with the autoconnection…

Set the IP of the RaspPi instead of LG TV in the configure connect SDK binding… fixed it for me… and thing was found correctly…

:slight_smile:

many thanks to your work… i really love that binding :slight_smile:

@kugelsicha @sprehn

I had the same issue. I couldn’t get auto connection and I accidentally entered the Pi’s IP instead of the TV’s IP when entering into the binding setting and it immediately showed up in my inbox thereafter. Otherwise, it’s working!

Does anyone have a “good” remote/sitemap setup?

I am trying to use this for Volume and cannot get the rule to work

Switch item=LG_TV0_VolumeUp label="Volume Up/Down" mappings=[1="UP", 0="DOWN"]

and Rule:

rule "VolumeUpDown"
when Item LG_TV0_VolumeUp received command
then
    switch receivedCommand{
        case 0: LG_TV0_VolumeDown.send(ON)
        case 1: LG_TV0_VolumeUp.send(ON)
    }
    //LG_TV0_Toast.sendCommand(receivedCommand.toString)
end

Hey,Thanks for the plugin… Great work!

I’ve got a question (I couldn’t find an answer):

The volume is showing in a decimal value. How can I turn in it into a whole value?

Thanks (Y)

I have added the .jar file to to add ons file and the binding is appearing on the paperUI. The TV is not discovered when auto discover is run. I have set the IP of openhab server on sdk configuration but not
work.
these is the server response:
openhab> java.net.SocketException: socket closed
at java.net.TwoStacksPlainDatagramSocketImpl.receive0(Native Method)
at java.net.TwoStacksPlainDatagramSocketImpl.receive(TwoStacksPlainDatag
ramSocketImpl.java:114)
at java.net.DatagramSocket.receive(DatagramSocket.java:812)
at com.connectsdk.discovery.provider.ssdp.SSDPClient.multicastReceive(SS
DPClient.java:115)
at com.connectsdk.discovery.provider.SSDPDiscoveryProvider$4.run(SSDPDis
coveryProvider.java:275)
at java.lang.Thread.run(Thread.java:748)
java.net.SocketException: socket closed
at java.net.DualStackPlainDatagramSocketImpl.socketReceiveOrPeekData(Nat
ive Method)
at java.net.DualStackPlainDatagramSocketImpl.receive0(DualStackPlainData
gramSocketImpl.java:124)
at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagra
mSocketImpl.java:143)
at java.net.DatagramSocket.receive(DatagramSocket.java:812)
at com.connectsdk.discovery.provider.ssdp.SSDPClient.responseReceive(SSD
PClient.java:103)
at com.connectsdk.discovery.provider.SSDPDiscoveryProvider$3.run(SSDPDis
coveryProvider.java:255)
at java.lang.Thread.run(Thread.java:748)

this is the event log:
2017-08-27 18:24:42.482 [hingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:560c3ed2’ changed from OFFLINE to UNINITIALIZED
2017-08-27 18:24:42.482 [hingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:560c3ed2’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2017-08-27 18:24:42.514 [hingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:560c3ed2’ changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2017-08-27 18:24:42.529 [hingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:560c3ed2’ changed from INITIALIZING to OFFLINE
2017-08-27 18:25:09.721 [hingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:560c3ed2’ changed from OFFLINE to UNINITIALIZED
2017-08-27 18:25:09.721 [hingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:560c3ed2’ changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2017-08-27 18:25:09.721 [hingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:560c3ed2’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2017-08-27 18:25:09.737 [hingStatusInfoChangedEvent] - ‘connectsdk:WebOSTV:560c3ed2’ changed from INITIALIZING to OFFLINE

Thanks for the help everyone :slight_smile:

@svaguilarv My solution was to create a dummy Item in an items file:

.items:

Number LG_TV0_VolLevelDummy //to display the correct volume number
Number LG_TV0_VolDummy "VolumeUpDown" - to control volume up and down

and a rule like this:

rule "VolumeUpDown"
when Item LG_TV0_VolDummy received command
then
    switch receivedCommand{
        case 0: LG_TV0_VolumeDown.sendCommand(ON)
        case 1: LG_TV0_VolumeUp.sendCommand(ON)
    }
    var vol = 100*LG_TV0_Volume.state as DecimalType //multiply by 100 to get the value to an integer.
    LG_TV0_VolLevelDummy.postUpdate(vol.toString)
end

Sitemap:

Text item=LG_TV0_VolLevelDummy label="Vol [%.0f]"
Switch item=LG_TV0_VolDummy icon="soundvolume" label="Volume" mappings=[1="▲UP", 0="▼DOWN"]

The only thing I can’t figure out and I don’t know if this is possible is being able to press and hold a button so the volume can continuously move up or down. I don’t think switch items support sendFrequency.

1 Like

Thanks! it worked great :wink:

Hello, I’m interested to use this binding. I downloaded the latest jar file from @sprehn github page and put it in my addon folder, restarted openhab, but it has not show up in installed bindings on paper UI. Is there some step that I missed? Thank you

Hi, could you check your openhab.log file.
and provide the output here.

I have this one line with connectSDK

9228 2017-09-25 21:34:19.719 [DEBUG] [mpl.info.InfoBundleTrackerCustomizer] - Ignore incorrect info null provided by bundle org.openhab.binding.connectsdk

between theese lines

9222 2017-09-25 21:34:19.725 [DEBUG] [e.paho.client.mqttv3.TimerPingSender] - null: Check schedule at 1,506,350,059,725
9223 2017-09-25 21:34:19.996 [DEBUG] [o.client.mqttv3.internal.ClientState] - paho626040644230796: checkForActivity entered
9224 2017-09-25 21:34:19.997 [DEBUG] [o.client.mqttv3.internal.ClientState] - paho626040644230796: ping not needed yet. Schedule next ping
9225 2017-09-25 21:34:19.998 [DEBUG] [org.eclipse.jetty.io.SelectorManager] - Selector loop woken up from select, 0/0 selected
9226 2017-09-25 21:34:20.120 [DEBUG] [org.eclipse.jetty.io.SelectorManager] - Running change org.eclipse.jetty.io.SelectorManager$ManagedSelector$Connect@32cec2eb
9227 2017-09-25 21:34:20.126 [DEBUG] [org.eclipse.jetty.io.SelectorManager] - Selector loop waiting on select
9228 2017-09-25 21:34:19.719 [DEBUG] [mpl.info.InfoBundleTrackerCustomizer] - Ignore incorrect info null provided by bundle org.openhab.binding.connectsdk
9229 2017-09-25 21:34:19.606 [DEBUG] [eclipse.jetty.client.HttpDestination] - Queued HttpRequest[GET /code/up%20hall%20off HTTP/1.1]@752f1150 for HttpDestination[http://192.168.1.68:7474]15ca5cf4,queue=3,pool=ConnectionPool[c=1/64,a=0,i=0]
9230 2017-09-25 21:34:19.606 [DEBUG] [eclipse.jetty.client.HttpDestination] - Queued HttpRequest[GET /code/AC%20master%20bedroom%20off HTTP/1.1]@3af06d14 for HttpDestination[http://192.168.1.68:7474]15ca5cf4,queue=2,pool=ConnectionPool[c=1/64,a=0,i=0]
9231 2017-09-25 21:34:20.141 [DEBUG] [.eclipse.jetty.client.ConnectionPool] - Connection 2/64 creation
9232 2017-09-25 21:34:20.141 [DEBUG] [.eclipse.jetty.client.ConnectionPool] - Connection 3/64 creation
9233 2017-09-25 21:34:19.999 [DEBUG] [o.client.mqttv3.internal.ClientState] - paho626040644230796: Schedule next ping at 14,302
9234 2017-09-25 21:34:20.197 [INFO ] [vice.internal.HttpServiceFactoryImpl] - Binding bundle: [org.openhab.core_2.1.0 [166]] to http service
9235 2017-09-25 21:34:20.198 [DEBUG] [.service.internal.HttpServiceStarted] - Creating http service for: org.openhab.core_2.1.0 [166]

@sprehn sometimes the binding loses the connection to the TV. I’m not sure how to debug it, but the way I “fix” it is to change the IP address in the binding config and then change it back to the correct IP of the OH device. Is this a known issue? How can I help give you debug information?

Hi,
it looks like sth changes in the OH2 distribution. Are you using a nightly build or a release?
I have not yet traced down what would need to change in the binding to make it work.

Kind Regards
Sebastian

Hi,

not a known issue so far. The workaround you describe makes me think that your network device may not be stable up, could that be the case?

Anyway, please enable debug logging for org.openhab.binding.connectsdk and com.connectsdk please

see http://docs.openhab.org/administration/logging.html

and lets see if we can learn sth from the output.

Kind Regards
Sebastian

I use stable OH 2.1. Just use some official bindings (http, mqtt, Xiaomi
smart home), broadlink unofficial binding, and rrd4j+influxdb persistence.
Do this beta binding same with what you suggest to OH2 release? Because I
see in the github that this come from OH1 add-ons

Use this link, it should solve the problem :wink:

1 Like

@sprehn I think I’ve correctly enabled DEBUG in karaf

log:set DEBUG org.openhab.binding.connectsdk

Debug ConnectSDK

Currently connection between the TV and opehab is lost. What are we looking for or how can I elicit some debug messages to clue us in on the issue?