LGWebOS Binding (for LG WebOS TVs)

FYI

I decided not to go through the process of integrating this version of the binding into the main project.

Instead I am right now working on a version for openhab2, as this naturally fits the way this framework works and discovered devices. Yesterday I was able to get the basic functionality working.

Sebastian

An initial version for openhab 2 is ready for review.

The plugin performs background auto discovery of WebOS TVs. It will connect to the TV only if at least one channel is connected.

The plugin will attempt to auto detect the local network interface. The IP can also be configured in a configuration file cons/services/connectsdk.cfg with following content (example)
binding.connectsdk.discovery:localIP=192.168.1.1
This will not be necessary if your hostname resolves to this IP or if you just have one non-loopback interface.

This plugin now theoretically also supports IPv6, even though I have not tested.
Also the size could be further reduced. (1.53 MB -> 0.97MB) as OH2 provides more of the required libraries out of the box.

Oh, and Happy Easter to all of you !!

1 Like

Okay, i started to completly set everything up new from scratch (Installed raspbian on pi2, installed java 1.8, installed openhab over apt-get). After first connection my TV doesn’t gets paired again. You can see, that openHAB is recognizing the TV when you turn it on and off, but no pairing is done. So same behavior as before. Don’t know whats wrong.

And you have at least ohne item configured for this binding I assume.

Did you try with eth and with wifi?

For a test I would suggest connect you tv with a lan cable to see if this behavior goes away.

Also experimenting with any powersaving settings in the tv may help.

I don’t think it’s your openhab install nor the binding that is causing this hick up. But as always, I could be wrong

I already tried over Wifi and over LAN Cable, but same behavior. Is there something i should look out when i install openHAB with “apt-get” such as read/write rights in directories or other things because of the privileged openHAB User which executes openHAB instead of root? I already gave rights to the directory “/etc/openhab/jetty/etc/” where connectsdk saves the connected Devices. Maybe there are other directorys which connectsdk saves to?

So if you tried with the tv connected over lan we can rule out the network for now.

Connects do only stores information in one file. Openhab/etc/connect_sdk/StoredDevices

If you run openhab under root, then there will be no permission issue.

Somehow I think it is related to the settings in the tv. Especially since the binding makes a connection attempt. Its connection simply gets refused.

Okay, but i’m not running openHAB as root. If you install openHAB over apt-get it creates a new User “openhab” which is running openhab. Don’t know if this could be a Problem. I will look into my TV Settings later. Maybe there is something else i haven’t seen yet.

Worked straight away.
Wondering if there are any options to check the state of the power. Now thinking of using the NetworkHealth binding for this but if it’s possible with SDK


And also the SDK page states you can launch an app. Any plans of integrating this?
Thanks for the great binding

After Switching to openHAB 2 i have a problem that is related to the problem i had before under oh1. The first Connection succeded. After Restarting the TV it doesn’t reconnect. In the Logs there are some errors. Maybe you can use the Log to Debug my Problem.

http://pastebin.com/UjMA2hz8

Hi,

there is actually a power section and a special note on how to power on in the documentation:

starting apps is not yet supported, but I’ll keep it in mind. I also welcome anyone to send a pull request to implement it.

Kind Regards
Sebastian

Hi, well, checked the log
 but does not give me any hint. this null pointer exception happens deep in smart home code during the thingUpdate execution. Don’t think any of the parameters the binding hands over are null.

btw. I don’t think OH2 is quite production ready yet
 At least I personally have not yet switched. Only have a test instance running right now.

Any progress on checking the TV settings?

Many thanks for this addon, Sebastian! I’m using it since some months now w/o any problem.

Just your hint for powering up the device doesn’t work for me. Wake-on-LAN does not seem to be supported on my device (tested with command line tools). At least, I can’t find a setting for this in the webOS menu. Do you also use it on a 2014er WebOS model like me or did you test your addon on newer devices only?

Best

I have a menu entry under general settings to allow mobile devices to start the TV. This had to be enabled.

I own this model: LG 60UF7709. OS Version shown in Info Menu on TV is 4.00.70
Interestingly the version reported through the API on response to hello command is different:

20:09:15.847 DEBUG o.o.binding.connectsdk.Log[:23]- Connect SDK - webOS Socket [IN] : {"type":"hello","payload":{"protocolVersion":1,"deviceType":"tv","deviceOS":"webOS","deviceOSVersion":"4.1.0","deviceOSReleaseVersion":"2.2.0","deviceUU
ID":"6da62662-1369-a82d-95c7-353c235ed503","pairingTypes":["PIN","PROMPT","COMBINED"]}}

OK, this appears to be a 2015 model. In my 2014 model (w/ webOS 1.6), there is no such an option. :frowning:
Thanks for your quick reply!

Same here. I have a WebOS2 2015 model 32lf652 with no option of wol.
I also wonder. After almost every power on the tv keeps asking to allow connection. Is it possible to get rid of this?

Normally this is only required to do once.

I will try to monitor and get back with logs.

Hi,
I’m trying to use Connect SDK binding to control my WebOS tv.

at startup I get this error:

Failed to resolve {“modelName”:“LG Smart TV”,“lastConnected”:9223372036854775807,“lastKnownIPAddress”:“10.0.0.131”,“id”:“339fb44d-c828-453d-b0bd-263e08149018”,“services”:{“04451361-d4e2-ea98-d480-5062c8409d72”:{“description”:{“filter”:“urn:lge-com:service:webos-second-screen:1”,“modelName”:“LG Smart TV”,“port”:1852,“ipAddress”:“10.0.0.131”,“serviceId”:“webOS TV”,“uuid”:“04451361-d4e2-ea98-d480-5062c8409d72”,“version”:“4.1.0”,“friendlyName”:"[LG] webOS TV"},“class”:“WebOSTVService”,“config”:{“lastDetection”:1461622478,“UUID”:“04451361-d4e2-ea98-d480-5062c8409d72”,“class”:“ServiceConfig”}}},“lastDetection”:1461622478,“friendlyName”:"[LG] webOS TV"} to IP address. Skipping update on item LG_TV0_VolumeUp.

and when I try to send a command I get

Failed to resolve lgwebostv.fritz.box to IP address. Skipping item LG_TV0_VolumeUp

any help would be appreciated.

Izhar

The device hostname you have given in your Items config cannot be resolved. Pls double check lgwebostv.fritz.box can be resolved to the ip you expect.