LGWebOS Binding (for LG WebOS TVs)

I am not aware which would be the relevant api call, and if it is supported at all.

So I removed the LG TV “thing” and successfully discovered it from PaperUI with the binding in DEBUG logging:

[home.event.InboxAddedEvent] - Discovery Result with UID 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' has been added.
[INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' to inbox.
[me.event.InboxRemovedEvent] - Discovery Result with UID 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' has been removed.
[hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' changed from UNINITIALIZED to INITIALIZING
[DEBUG] [ng.lgwebos.internal.WakeOnLanUtility] - MAC address of host 192.168.1.102 is c8:08:e9:5f:xx:xx
[DEBUG] [ebos.internal.handler.LGWebOSHandler] - Determined MAC address: c8:08:e9:5f:xx:xx for host: 192.168.1.102
[me.event.ThingUpdatedEvent] - Thing 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' has been updated.
...
[hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' changed from INITIALIZING to OFFLINE: TV is off
[DEBUG] [bos.internal.handler.LGWebOSTVSocket] - Connecting to: ws://192.168.1.102:3000
[DEBUG] [bos.internal.handler.LGWebOSTVSocket] - WebSocket Connected to: /192.168.1.102
...
[me.event.ThingUpdatedEvent] - Thing 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' has been updated.
[hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' changed from OFFLINE: TV is off to ONLINE: Registering - You may need to confirm pairing on TV.
[DEBUG] [bos.internal.handler.LGWebOSTVSocket] - Error: {"type":"error","id":1,"error":"403 User denied access","payload":{}}
[DEBUG] [bos.internal.handler.LGWebOSTVSocket] - Registration failed with message: 403 User denied access
[hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' changed from ONLINE: Registering - You may need to confirm pairing on TV. to OFFLINE: TV is off
[DEBUG] [bos.internal.handler.LGWebOSTVSocket] - WebSocket Closed - Code: 1000, Reason: null
...
[vent.ItemStateChangedEvent] - TVWoonkamerLG_Power changed from ON to OFF
[DEBUG] [bos.internal.handler.LGWebOSTVSocket] - Connecting to: ws://192.168.1.102:3000
[DEBUG] [bos.internal.handler.LGWebOSTVSocket] - WebSocket Connected to: /192.168.1.102
[me.event.ThingUpdatedEvent] - Thing 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' has been updated.
[hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' changed from OFFLINE: TV is off to ONLINE: Registering - You may need to confirm pairing on TV.
...
[me.event.ThingUpdatedEvent] - Thing 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' has been updated.
[DEBUG] [bos.internal.handler.LGWebOSTVSocket] - Error: {"type":"error","id":3,"error":"403 User denied access","payload":{}}
[DEBUG] [bos.internal.handler.LGWebOSTVSocket] - Registration failed with message: 403 User denied access
[hingStatusInfoChangedEvent] - 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' changed from ONLINE: Registering - You may need to confirm pairing on TV. to OFFLINE: TV is off
...
[WARN ] [bos.internal.handler.LGWebOSTVSocket] - No Connection to TV, skipping [out]: {"id":27,"type":"register","payload":{"pairingType":"PROMPT","manifest":{"manifestVersion":1,"permissions":["LAUNCH","LAUNCH_WEBAPP","APP_TO_APP","CONTROL_AUDIO","CONTROL_INPUT_MEDIA_PLAYBACK","CONTROL_POWER","READ_INSTALLED_APPS","CONTROL_DISPLAY","CONTROL_INPUT_JOYSTICK","CONTROL_INPUT_MEDIA_RECORDING","CONTROL_INPUT_TV","READ_INPUT_DEVICE_LIST","READ_NETWORK_STATE","READ_TV_CHANNEL_LIST","WRITE_NOTIFICATION_TOAST","CONTROL_INPUT_TEXT","CONTROL_MOUSE_AND_KEYBOARD","READ_CURRENT_CHANNEL","READ_RUNNING_APPS"]}}}

MAC address is discovered and filled out in the “thing” settings. If I run into issues I will let you know.

1 Like

Great news, thx

Perhaps one comment so far, the binding is causing log entries every minute:

[me.event.ThingUpdatedEvent] - Thing 'lgwebos:WebOSTV:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' has been updated.

Even after setting binding logging back to DEFAULT or ERROR. Would be nice if the binding is less verbose and not causing logs without anything happening.

good point. will fix it

In case there are users in the place having problems with fast detection of power on/off, I proposed a change and you have a jar for testing in my PR. Your feedback is welcome. It could be necessary that you first clear your inbox before installaing the new version, you can do it with the following console command: smarthome:inbox clear

2 Likes

@Lolodomo
Initial testing seems to be favorable. Is the WOL function still required? I tried it with and without the WOL rule. With WOL the TV turns on and off with no apparent issues.

Testing without the WOL rule, the TV turns OFF ok (as expected) and will turn ON as well, if you trigger the on/off switch twice.

the WOL functionality is developed under a different feature branch and not merged yet. so this is not included in lolodomos preview.

the WOL functionality is developed under a different feature branch and not merged yet. so this is not included in lolodomos preview.

@swamiller : my PR is for users that did not see a fast update of the power channel when they use the on/off button of their TV remote control.
Were you concerned by this problem?

Yes, I have a symptomatic issue related to this problem. I have a goodnight button rule that (among other stuff) sends a power off command to my harmony hub. Frequently if the TV was recently turned off (before running the goodnight routine), the command would turn the TV back on. I learned if you wait for a few minutes after turning off the TV before running the goodnight routine the TV would stay off as expected…

I always have that issue!

And do you confirm that it is fixed with my fix?

Hey can you take a look at my post. I was using optical out on the tv and having a rule change my denon receiver. I’m no longer able to do this.

I can only test if it is part of the next milestone build…

It did not fix my issue.

Apologies if I have gone about this the wrong way.

Just noticed that within the LGwebOS binding that the channel name seems to have disappeared. Doesn’t seem to be by accident as it has been pulled from the documentation as well. Just wondering what has happened as I was in the process of upgrading my existing OpenHAB instance where the previous version had the capability and I was using it but the new version doesn’t.

Any plans to reinstate this capability?

@Lolodomo can explain. there is an options feature which allows us to combine channel number and name in one channel

Thanks Sebastian. I have been doing just that in a rule already so it might be a better outcome.

I can confirm the issue that the tv is turned on again when the off command is sent a second time after the tv was first turned off.
An issue has to be declared in Github and I will try to fix it.