Connect SDK Binding (for LG WebOS TVs)

webos
connectsdk
Tags: #<Tag:0x00007f014b57e7b8> #<Tag:0x00007f014b57e5b0>

(Sebastian Prehn) #486

@smhgit: this may be the solution to your problem as well.


(Eyal Cohen) #487

@sprehn thx, will test it tomorrow. I am using openhabian - openHAB 2.3.0. I didn’t try yet any 2.4 binding. will it work on my version?

Thx!


(Sebastian Prehn) #488

yes, it should work. I dropped it into my installation, which is 2.3 as well, and it worked


(Eyal Cohen) #489

Just got this:

018-10-31 00:30:11.313 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-network #lgwebos': Error restarting bundles:

	Unable to acquire the state change lock for the module: osgi.identity; type="osgi.bundle"; version:Version="0.10.0.oh230"; osgi.identity="org.eclipse.smarthome.model.rule.runtime"; singleton:="true" [id=136] STARTED [STARTED]

(Sebastian Prehn) #490

I had to install the previous version - otherwise the new addon will not start. There can only be one running at a time.


(Eyal Cohen) #491

OK, I have restarted openHAB and I still get same error (but also for network binding, don’t know why). ANy case, seems that it is running. I will monitor this release and update. Do u plan to merge it to official release?

openhab> bundle:list | grep webOS                                                                                                                                                                        
242 │ Active   │  80 │ 2.4.0.201810302056     │ LG webOS Binding
openhab> 

First quick test - it is working.


(Andras Miklos) #492

I bought a new LG TV. And I noticed that toast is not working on this.

2018-10-31 10:52:13.971 [DEBUG] [nding.lgwebos.handler.LGWebOSHandler] - handleCommand(lgwebos:WebOSTV:96d3cc51-df25-482b-a495-b90b358e96a3:volume,13) is called
2018-10-31 10:52:14.150 [DEBUG] [.lgwebos.internal.BaseChannelHandler] - org.openhab.binding.lgwebos.internal.VolumeControlVolume: {"returnValue":true}.
2018-10-31 10:52:15.335 [DEBUG] [nding.lgwebos.handler.LGWebOSHandler] - handleCommand(lgwebos:WebOSTV:96d3cc51-df25-482b-a495-b90b358e96a3:volume,12) is called
2018-10-31 10:52:15.684 [DEBUG] [.lgwebos.internal.BaseChannelHandler] - org.openhab.binding.lgwebos.internal.VolumeControlVolume: {"returnValue":true}.
2018-10-31 10:52:16.460 [DEBUG] [nding.lgwebos.handler.LGWebOSHandler] - handleCommand(lgwebos:WebOSTV:96d3cc51-df25-482b-a495-b90b358e96a3:volume,11) is called
2018-10-31 10:52:16.649 [DEBUG] [.lgwebos.internal.BaseChannelHandler] - org.openhab.binding.lgwebos.internal.VolumeControlVolume: {"returnValue":true}.
2018-10-31 10:52:19.146 [DEBUG] [nding.lgwebos.handler.LGWebOSHandler] - handleCommand(lgwebos:WebOSTV:96d3cc51-df25-482b-a495-b90b358e96a3:mute,ON) is called
2018-10-31 10:52:19.183 [DEBUG] [.lgwebos.internal.BaseChannelHandler] - org.openhab.binding.lgwebos.internal.VolumeControlMute: {"returnValue":true}.
2018-10-31 10:52:19.580 [DEBUG] [nding.lgwebos.handler.LGWebOSHandler] - handleCommand(lgwebos:WebOSTV:96d3cc51-df25-482b-a495-b90b358e96a3:mute,OFF) is called
2018-10-31 10:52:19.654 [DEBUG] [.lgwebos.internal.BaseChannelHandler] - org.openhab.binding.lgwebos.internal.VolumeControlMute: {"returnValue":true}.
2018-10-31 10:52:22.050 [DEBUG] [nding.lgwebos.handler.LGWebOSHandler] - handleCommand(lgwebos:WebOSTV:96d3cc51-df25-482b-a495-b90b358e96a3:toast,Test message) is called

Could I ask you, what I have to do to get it working?

2018-10-31 10:50:35.403 [DEBUG] [.internal.discovery.LGWebOSDiscovery] - Device removed: {"modelName":"LG Smart TV","lastConnected":1540979337,"lastKnownIPAddress":"192.168.1.104","modelNumber":"43UK6300MLB","id":"96d3cc51-df25-482b-a495-b90b358e96a3","services":{},"lastDetection":1540979336,"friendlyName":"[LG] webOS TV UK6300MLB"}
2018-10-31 10:50:35.411 [DEBUG] [nding.lgwebos.handler.LGWebOSHandler] - Capabilities updated: {"modelName":"LG Smart TV","lastConnected":1540979337,"lastKnownIPAddress":"192.168.1.104","modelNumber":"43UK6300MLB","id":"96d3cc51-df25-482b-a495-b90b358e96a3","services":{},"lastDetection":1540979336,"friendlyName":"[LG] webOS TV UK6300MLB"} - added: [] - removed: [VolumeControl.Get, VolumeControl.Set, VolumeControl.UpDown, VolumeControl.Subscribe, VolumeControl.Mute.Get, VolumeControl.Mute.Set, VolumeControl.Mute.Subscribe, MediaPlayer.Display.Image, MediaPlayer.Play.Video, MediaPlayer.Play.Audio, MediaPlayer.Close, MediaPlayer.MetaData.Title, MediaPlayer.MetaData.Description, MediaPlayer.MetaData.Thumbnail, MediaPlayer.MetaData.MimeType, MediaPlayer.MediaInfo.Get, MediaPlayer.MediaInfo.Subscribe, TextInputControl.Send, TextInputControl.Enter, TextInputControl.Delete, TextInputControl.Subscribe, MouseControl.Connect, MouseControl.Disconnect, MouseControl.Click, MouseControl.Move, MouseControl.Scroll, KeyControl.Up, KeyControl.Down, KeyControl.Left, KeyControl.Right, KeyControl.OK, KeyControl.Back, KeyControl.Home, KeyControl.KeyCode, MediaPlayer.Display.Image, MediaPlayer.Play.Video, MediaPlayer.Play.Audio, MediaPlayer.Close, MediaPlayer.MetaData.Title, MediaPlayer.MetaData.Description, MediaPlayer.MetaData.Thumbnail, MediaPlayer.MetaData.MimeType, MediaPlayer.MediaInfo.Get, MediaPlayer.MediaInfo.Subscribe, Launcher.App, Launcher.App.Params, Launcher.App.Close, Launcher.App.List, Launcher.Browser, Launcher.Browser.Params, Launcher.Hulu, Launcher.Hulu.Params, Launcher.Netflix, Launcher.Netflix.Params, Launcher.YouTube, Launcher.YouTube.Params, Launcher.AppStore, Launcher.AppStore.Params, Launcher.AppState, Launcher.AppState.Subscribe, Launcher.RunningApp, Launcher.RunningApp.Subscribe, TVControl.Channel.Get, TVControl.Channel.Set, TVControl.Channel.Up, TVControl.Channel.Down, TVControl.Channel.List, TVControl.Channel.Subscribe, TVControl.Program.Get, TVControl.Program.List, TVControl.Program.Subscribe, TVControl.Program.List.Subscribe, TVControl.3D.Get, TVControl.3D.Set, TVControl.3D.Subscribe, ExternalInputControl.Picker.Launch, ExternalInputControl.Picker.Close, ExternalInputControl.List, ExternalInputControl.Set, ToastControl.Show, ToastControl.Show.Clickable.App, ToastControl.Show.Clickable.App.Params, ToastControl.Show.Clickable.URL, PowerControl.Off, WebAppLauncher.Launch, WebAppLauncher.Launch.Params, WebAppLauncher.Message.Send, WebAppLauncher.Message.Receive, WebAppLauncher.Message.Send.JSON, WebAppLauncher.Message.Receive.JSON, WebAppLauncher.Connect, WebAppLauncher.Disconnect, WebAppLauncher.Join, WebAppLauncher.Close, WebAppLauncher.Pin, MediaControl.Play, MediaControl.Pause, MediaControl.Stop, MediaControl.Rewind, MediaControl.FastForward, MediaControl.Seek, MediaControl.Previous, MediaControl.Next, MediaControl.Duration, MediaControl.PlayState, MediaControl.PlayState.Subscribe, MediaControl.Position, MediaPlayer.Subtitle.WebVTT, PlaylistControl.JumpToTrack, PlaylistControl.Next, PlaylistControl.Previous, MediaPlayer.Loop]
2018-10-31 10:50:35.413 [DEBUG] [.lgwebos.internal.BaseChannelHandler] - Unsubscribed org.openhab.binding.lgwebos.internal.VolumeControlVolume on IP: 192.168.1.104
2018-10-31 10:50:35.417 [DEBUG] [nding.lgwebos.handler.LGWebOSHandler] - Device disconnected: {"modelName":"LG Smart TV","lastConnected":1540979337,"lastKnownIPAddress":"192.168.1.104","modelNumber":"43UK6300MLB","id":"96d3cc51-df25-482b-a495-b90b358e96a3","services":{},"lastDetection":1540979336,"friendlyName":"[LG] webOS TV UK6300MLB"}
2018-10-31 10:50:35.420 [DEBUG] [.lgwebos.internal.BaseChannelHandler] - Unsubscribed org.openhab.binding.lgwebos.internal.LauncherApplication on IP: 192.168.1.104
2018-10-31 10:50:35.442 [DEBUG] [.lgwebos.internal.BaseChannelHandler] - Unsubscribed org.openhab.binding.lgwebos.internal.VolumeControlMute on IP: 192.168.1.104
2018-10-31 10:50:35.418 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception
java.lang.NullPointerException: null
        at org.openhab.binding.lgwebos.internal.BaseChannelHandler.refreshSubscription(BaseChannelHandler.java:59) ~[?:?]
        at org.openhab.binding.lgwebos.handler.LGWebOSHandler.lambda$4(LGWebOSHandler.java:210) ~[?:?]
        at java.util.HashMap.forEach(HashMap.java:1289) [?:?]
        at java.util.Collections$UnmodifiableMap.forEach(Collections.java:1505) [?:?]
        at org.openhab.binding.lgwebos.handler.LGWebOSHandler.refreshAllChannelSubscriptions(LGWebOSHandler.java:210) [250:org.openhab.binding.lgwebos:2.3.0]
        at org.openhab.binding.lgwebos.handler.LGWebOSHandler.onCapabilityUpdated(LGWebOSHandler.java:156) [250:org.openhab.binding.lgwebos:2.3.0]
        at com.connectsdk.device.ConnectableDevice$2.run(ConnectableDevice.java:217) [250:org.openhab.binding.lgwebos:2.3.0]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
2018-10-31 10:50:35.606 [DEBUG] [lgwebos.internal.VolumeControlVolume] - 0 null connection lost
2018-10-31 10:50:35.610 [DEBUG] [g.lgwebos.internal.VolumeControlMute] - 0 null connection lost
2018-10-31 10:50:35.611 [DEBUG] [lgwebos.internal.LauncherApplication] - 0 null connection lost

(Eyal Cohen) #493

@sprehn

For some reason which I cannot explain, the current webOS binding seems to work as expected. I will wait day or two to see the stability and then switch to the new beta version.

Question: Does the binding has config file? I don’t seem to have one.

Thx for your continues support and this binding development!


(Alpoy) #494

Tried the binding yesterday, seems the problem is still there (still goes off/on)… :neutral_face:

250 x Active x 80 x 2.4.0.201810302056 x LG webOS Binding

This is the event/thing log while watching a movie :

2018-10-31 20:42:51.196 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from OFFLINE: TV is off to ONLINE: Device Ready
2018-10-31 20:42:51.489 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Device Ready to ONLINE: Connected
2018-10-31 20:44:02.338 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Connected to OFFLINE: TV is off
2018-10-31 20:51:49.078 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from OFFLINE: TV is off to ONLINE: Device Ready
2018-10-31 20:51:49.326 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Device Ready to ONLINE: Connected
2018-10-31 20:52:52.316 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Connected to OFFLINE: TV is off
2018-10-31 21:06:39.685 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from OFFLINE: TV is off to ONLINE: Device Ready
2018-10-31 21:06:39.922 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Device Ready to ONLINE: Connected
2018-10-31 21:07:42.339 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Connected to OFFLINE: TV is off
2018-10-31 21:21:30.291 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from OFFLINE: TV is off to ONLINE: Device Ready
2018-10-31 21:21:30.523 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Device Ready to ONLINE: Connected
2018-10-31 21:22:32.423 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Connected to OFFLINE: TV is off
2018-10-31 21:36:20.898 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from OFFLINE: TV is off to ONLINE: Device Ready
2018-10-31 21:36:21.125 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Device Ready to ONLINE: Connected
2018-10-31 21:37:22.469 [hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:a0a07629-dd4f-4157-bf34-585a2261d022' changed from ONLINE: Connected to OFFLINE: TV is off

(Zachery Held) #495

hi @sprehn. recently switched from Samsung to LG and now trying to get things to work as I am used from Samsung tv binding. I really appreciate your work and instant replies in this thread so I hope you can help me with my issues… just in case: I am at

231 │ Active │ 80 │ 2.4.0.201810302056 │ LG webOS Binding

1.) when switching TV off the power button switches back on instantly (seems to be a known bug fixed? but in my case still not resolved)
2.) switching channels is very slow (is this a known issue?)
3.) is it possible to access other buttons from the remote (sth like keycode=up,down)?
4.) is it possible to switch to specific channels (like RTL or ch.no. 3)??


(Sebastian Prehn) #496

Hi

  1. I don’t think it is a bug. It has to do with autoaupdate=false. The binding will set this channel OFF, once the TV disappears, which will be a few seconds after it actually turned off. You could also remove the autoupdate setting, in this case you would see the switch
  2. switching channels requires two interactions with the device. one to pull the current list of channels, and another to set the new channel. This will be improved through caching the list in one of the next versions. When we have the rule engine in place there will also be an increase and decrease command.
  3. with the next release and rule engine
  4. yes, possible today already via the channel named: channel

Sebastian


(Nakh Home) #497

(Sebastian Prehn) #498

with action support in hopefully the next release, yes.


(Nakh Home) #499

Thanks for your answer

next version? you mean in 2.4?

Available as a milestone


(Tobias) #500

Good morning,

yesterday I installed the WebOS binding (snapshot) and it seems to work. However, I get an error message during boot

2018-12-05 22:37:08.378 [ERROR] [org.openhab.binding.lgwebos         ] - bundle org.openhab.binding.lgwebos:2.4.0.201812050105 (232)[org.openhab.binding.lgwebos.internal.action.ActionService(274)] : Could not load implementation object class org.openhab.binding.lgwebos.internal.action.ActionService
java.lang.ClassNotFoundException: org.openhab.binding.lgwebos.internal.action.ActionService cannot be found by org.openhab.binding.lgwebos_2.4.0.201812050105

Is this a known bug, or am I doing something wrong?

My items list includes the TV according to the examples:

Switch LG_TV_Power "Fernseher" <television>  { autoupdate="false", channel="lgwebos:WebOSTV:0f19e30f-5fa6-47a2-bad2-22dc4428242b:power" }

Thanks for help!


(Sebastian Prehn) #501

I am actually surprised how this ends up in any snapshot build. Pull Request #2926 is not ready for merge yet.


(Tobias) #502

@sprehn Dear Sebastian,

thanks - so this is not a mistake on my side?
I also switched back to milestone as currently, snapshot builds are tricky. The WebOS binding seems to work fine there…


(Eyal Cohen) #503

@sprehn

LG binding is working without issues, but I don’t understand how :slight_smile:

My LG Thing is commented:

// Thing lgwebos:WebOSTV:tv0 @ "Living Room" [ deviceId="36cc2432-6389-45e9-bc51-dca4f40e9efa" ]

And the thing that I see in paperUI is (here is the power channel):

lgwebos:WebOSTV:c580ac91-59aa-4a7b-bae9-159ededd84ec:power

So I guess that the thing is saved somewhere. Am I right? If so, how can I delete it and add it back via thing configuration file?

Also, what is the latest and greatest binding version?

Thx for you help!


(Nolan Garrett) #504

I have the same issue. Debug logs show the command called. No errors. Removing and re-adding the TV Thing also generates no errors. All controls (power, mute, etc.) seem to work except the toast. I’m running the latest stable release.


(Tobias) #505

I observe the same behavior. This is a bit ugly as I use the power status to switch my amplifier as well. Thus, on switching the TV off it will also go OFF - ON (for 10sec) - OFF. I solved this with a time delay to switch off the amp.

So this is a bug, or can I change this behaviour by the autoUpdate mechanism (which I did not really understand yet).

Thanks a lot!